diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2013-01-09 15:57:03 (GMT) |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2013-01-09 15:57:03 (GMT) |
commit | ea33fb1a32e8e3f408b311823cabbb7453148f80 (patch) | |
tree | a81f26a32a32e33c2a25a82423d0bcc8ad48973a /drivers/spi | |
parent | 61bdb9133593f0f881a57232039296f64bd662ed (diff) | |
parent | bfbfab94fd0b38ca780e6dda99657b0c848c9bb9 (diff) | |
download | u-boot-fsl-qoriq-ea33fb1a32e8e3f408b311823cabbb7453148f80.tar.xz |
Merge branch 'u-boot-marvell/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/kirkwood_spi.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c index a7cda75..de81064 100644 --- a/drivers/spi/kirkwood_spi.c +++ b/drivers/spi/kirkwood_spi.c @@ -41,7 +41,10 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, { struct spi_slave *slave; u32 data; - u32 kwspi_mpp_config[] = { 0, 0 }; + static const u32 kwspi_mpp_config[2][2] = { + { MPP0_SPI_SCn, 0 }, /* if cs == 0 */ + { MPP7_SPI_SCn, 0 } /* if cs != 0 */ + }; if (!spi_cs_is_valid(bus, cs)) return NULL; @@ -68,12 +71,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, writel(KWSPI_IRQMASK, &spireg->irq_mask); /* program mpp registers to select SPI_CSn */ - if (cs) { - kwspi_mpp_config[0] = MPP7_SPI_SCn; - } else { - kwspi_mpp_config[0] = MPP0_SPI_SCn; - } - kirkwood_mpp_conf(kwspi_mpp_config, cs_spi_mpp_back); + kirkwood_mpp_conf(kwspi_mpp_config[cs ? 1 : 0], cs_spi_mpp_back); return slave; } |