aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/dw_spi.c17
-rw-r--r--include/linux/spi/dw_spi.h2
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c
index 11fbbf6fb07b..56247853c298 100644
--- a/drivers/spi/dw_spi.c
+++ b/drivers/spi/dw_spi.c
@@ -181,10 +181,6 @@ static void flush(struct dw_spi *dws)
181 wait_till_not_busy(dws); 181 wait_till_not_busy(dws);
182} 182}
183 183
184static void null_cs_control(u32 command)
185{
186}
187
188static int null_writer(struct dw_spi *dws) 184static int null_writer(struct dw_spi *dws)
189{ 185{
190 u8 n_bytes = dws->n_bytes; 186 u8 n_bytes = dws->n_bytes;
@@ -322,7 +318,7 @@ static void giveback(struct dw_spi *dws)
322 struct spi_transfer, 318 struct spi_transfer,
323 transfer_list); 319 transfer_list);
324 320
325 if (!last_transfer->cs_change) 321 if (!last_transfer->cs_change && dws->cs_control)
326 dws->cs_control(MRST_SPI_DEASSERT); 322 dws->cs_control(MRST_SPI_DEASSERT);
327 323
328 msg->state = NULL; 324 msg->state = NULL;
@@ -549,13 +545,13 @@ static void pump_transfers(unsigned long data)
549 */ 545 */
550 if (dws->cs_control) { 546 if (dws->cs_control) {
551 if (dws->rx && dws->tx) 547 if (dws->rx && dws->tx)
552 chip->tmode = 0x00; 548 chip->tmode = SPI_TMOD_TR;
553 else if (dws->rx) 549 else if (dws->rx)
554 chip->tmode = 0x02; 550 chip->tmode = SPI_TMOD_RO;
555 else 551 else
556 chip->tmode = 0x01; 552 chip->tmode = SPI_TMOD_TO;
557 553
558 cr0 &= ~(0x3 << SPI_MODE_OFFSET); 554 cr0 &= ~SPI_TMOD_MASK;
559 cr0 |= (chip->tmode << SPI_TMOD_OFFSET); 555 cr0 |= (chip->tmode << SPI_TMOD_OFFSET);
560 } 556 }
561 557
@@ -704,9 +700,6 @@ static int dw_spi_setup(struct spi_device *spi)
704 chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); 700 chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
705 if (!chip) 701 if (!chip)
706 return -ENOMEM; 702 return -ENOMEM;
707
708 chip->cs_control = null_cs_control;
709 chip->enable_dma = 0;
710 } 703 }
711 704
712 /* 705 /*
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h
index cc813f95a2f2..c91302f3a257 100644
--- a/include/linux/spi/dw_spi.h
+++ b/include/linux/spi/dw_spi.h
@@ -14,7 +14,9 @@
14#define SPI_MODE_OFFSET 6 14#define SPI_MODE_OFFSET 6
15#define SPI_SCPH_OFFSET 6 15#define SPI_SCPH_OFFSET 6
16#define SPI_SCOL_OFFSET 7 16#define SPI_SCOL_OFFSET 7
17
17#define SPI_TMOD_OFFSET 8 18#define SPI_TMOD_OFFSET 8
19#define SPI_TMOD_MASK (0x3 << SPI_TMOD_OFFSET)
18#define SPI_TMOD_TR 0x0 /* xmit & recv */ 20#define SPI_TMOD_TR 0x0 /* xmit & recv */
19#define SPI_TMOD_TO 0x1 /* xmit only */ 21#define SPI_TMOD_TO 0x1 /* xmit only */
20#define SPI_TMOD_RO 0x2 /* recv only */ 22#define SPI_TMOD_RO 0x2 /* recv only */