diff options
Diffstat (limited to 'drivers/spi/davinci_spi.c')
-rw-r--r-- | drivers/spi/davinci_spi.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c index 105c686b2cea..82dddf83daf7 100644 --- a/drivers/spi/davinci_spi.c +++ b/drivers/spi/davinci_spi.c | |||
@@ -65,9 +65,10 @@ | |||
65 | #define SPI_INTLVL_1 0x000001FFu | 65 | #define SPI_INTLVL_1 0x000001FFu |
66 | #define SPI_INTLVL_0 0x00000000u | 66 | #define SPI_INTLVL_0 0x00000000u |
67 | 67 | ||
68 | /* SPIDAT1 */ | 68 | /* SPIDAT1 (upper 16 bit defines) */ |
69 | #define SPIDAT1_CSHOLD_MASK BIT(28) | 69 | #define SPIDAT1_CSHOLD_MASK BIT(12) |
70 | #define SPIDAT1_CSNR_SHIFT 16 | 70 | |
71 | /* SPIGCR1 */ | ||
71 | #define SPIGCR1_CLKMOD_MASK BIT(1) | 72 | #define SPIGCR1_CLKMOD_MASK BIT(1) |
72 | #define SPIGCR1_MASTER_MASK BIT(0) | 73 | #define SPIGCR1_MASTER_MASK BIT(0) |
73 | #define SPIGCR1_LOOPBACK_MASK BIT(16) | 74 | #define SPIGCR1_LOOPBACK_MASK BIT(16) |
@@ -235,8 +236,8 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value) | |||
235 | { | 236 | { |
236 | struct davinci_spi *davinci_spi; | 237 | struct davinci_spi *davinci_spi; |
237 | struct davinci_spi_platform_data *pdata; | 238 | struct davinci_spi_platform_data *pdata; |
238 | u32 data1_reg_val; | ||
239 | u8 chip_sel = spi->chip_select; | 239 | u8 chip_sel = spi->chip_select; |
240 | u16 spidat1_cfg = CS_DEFAULT; | ||
240 | 241 | ||
241 | davinci_spi = spi_master_get_devdata(spi->master); | 242 | davinci_spi = spi_master_get_devdata(spi->master); |
242 | pdata = davinci_spi->pdata; | 243 | pdata = davinci_spi->pdata; |
@@ -245,17 +246,12 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value) | |||
245 | * Board specific chip select logic decides the polarity and cs | 246 | * Board specific chip select logic decides the polarity and cs |
246 | * line for the controller | 247 | * line for the controller |
247 | */ | 248 | */ |
248 | data1_reg_val = CS_DEFAULT << SPIDAT1_CSNR_SHIFT; | ||
249 | if (value == BITBANG_CS_ACTIVE) { | 249 | if (value == BITBANG_CS_ACTIVE) { |
250 | data1_reg_val |= SPIDAT1_CSHOLD_MASK; | 250 | spidat1_cfg |= SPIDAT1_CSHOLD_MASK; |
251 | data1_reg_val &= ~((0x1 << chip_sel) << SPIDAT1_CSNR_SHIFT); | 251 | spidat1_cfg &= ~(0x1 << chip_sel); |
252 | } | 252 | } |
253 | 253 | ||
254 | iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1); | 254 | iowrite16(spidat1_cfg, davinci_spi->base + SPIDAT1 + 2); |
255 | while ((ioread32(davinci_spi->base + SPIBUF) | ||
256 | & SPIBUF_RXEMPTY_MASK) == 0) | ||
257 | cpu_relax(); | ||
258 | |||
259 | } | 255 | } |
260 | 256 | ||
261 | /** | 257 | /** |