diff options
Diffstat (limited to 'drivers/spi')
| -rw-r--r-- | drivers/spi/atmel_spi.c | 2 | ||||
| -rw-r--r-- | drivers/spi/kirkwood_spi.c | 12 | 
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index c7a51f7f3..ce7d46085 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c @@ -92,7 +92,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,  	as->slave.cs = cs;  	as->regs = regs;  	as->mr = ATMEL_SPI_MR_MSTR | ATMEL_SPI_MR_MODFDIS -#if defined(CONFIG_AT91SAM9X5) +#if defined(CONFIG_AT91SAM9X5) || defined(CONFIG_AT91SAM9M10G45)  			| ATMEL_SPI_MR_WDRBT  #endif  			| ATMEL_SPI_MR_PCS(~(1 << cs) & 0xf); diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c index a7cda751b..de81064b9 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;  }  |