npcx: spi: disable all port from board struct

We have two port(as is FALSH_, ACCEL_) on SPI defines
Let's prevent build error so that We can use particular
enable/disable port

BUG=None
TEST=Buildall is OK

Change-Id: Ib6fe14c4edd91947bde0a2da1c889da31db291a4
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/341576
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Wonjoon Lee
2016-04-30 16:51:50 +09:00
committed by chrome-bot
parent 2c162ddade
commit be930e3425

View File

@@ -186,12 +186,14 @@ int spi_transaction(const struct spi_device_t *spi_device,
*/
static void spi_init(void)
{
int i;
/* Enable clock for SPI peripheral */
clock_enable_peripheral(CGC_OFFSET_SPI, CGC_SPI_MASK,
CGC_MODE_RUN | CGC_MODE_SLEEP);
/* Disabling spi module */
spi_enable(CONFIG_SPI_FLASH_PORT, 0);
for (i = 0; i < spi_devices_used; i++)
spi_enable(spi_devices[i].port, 0);
/* Disabling spi irq */
CLEAR_BIT(NPCX_SPI_CTL1, NPCX_SPI_CTL1_EIR);
@@ -217,7 +219,7 @@ DECLARE_HOOK(HOOK_INIT, spi_init, HOOK_PRIO_INIT_SPI);
/*****************************************************************************/
/* Console commands */
#ifdef CONFIG_CMD_SPI_FLASH
static int printrx(const char *desc, const uint8_t *txdata, int txlen,
int rxlen)
{
@@ -236,7 +238,6 @@ static int printrx(const char *desc, const uint8_t *txdata, int txlen,
return EC_SUCCESS;
}
static int command_spirom(int argc, char **argv)
{
uint8_t txmandev[] = {0x90, 0x00, 0x00, 0x00};
@@ -261,3 +262,4 @@ DECLARE_CONSOLE_COMMAND(spirom, command_spirom,
NULL,
"Test reading SPI EEPROM",
NULL);
#endif