aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-xilinx.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 1890af8f8636..d933207c212c 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -167,8 +167,11 @@ static void xspi_init_hw(struct xilinx_spi *xspi)
167 /* Reset the SPI device */ 167 /* Reset the SPI device */
168 xspi->write_fn(XIPIF_V123B_RESET_MASK, 168 xspi->write_fn(XIPIF_V123B_RESET_MASK,
169 regs_base + XIPIF_V123B_RESETR_OFFSET); 169 regs_base + XIPIF_V123B_RESETR_OFFSET);
170 /* Disable all the interrupts just in case */ 170 /* Enable the transmit empty interrupt, which we use to determine
171 xspi->write_fn(0, regs_base + XIPIF_V123B_IIER_OFFSET); 171 * progress on the transmission.
172 */
173 xspi->write_fn(XSPI_INTR_TX_EMPTY,
174 regs_base + XIPIF_V123B_IIER_OFFSET);
172 /* Enable the global IPIF interrupt */ 175 /* Enable the global IPIF interrupt */
173 xspi->write_fn(XIPIF_V123B_GINTR_ENABLE, 176 xspi->write_fn(XIPIF_V123B_GINTR_ENABLE,
174 regs_base + XIPIF_V123B_DGIER_OFFSET); 177 regs_base + XIPIF_V123B_DGIER_OFFSET);
@@ -237,7 +240,6 @@ static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi, int n_words)
237static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) 240static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
238{ 241{
239 struct xilinx_spi *xspi = spi_master_get_devdata(spi->master); 242 struct xilinx_spi *xspi = spi_master_get_devdata(spi->master);
240 u32 ipif_ier;
241 243
242 /* We get here with transmitter inhibited */ 244 /* We get here with transmitter inhibited */
243 245
@@ -246,14 +248,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
246 xspi->remaining_bytes = t->len; 248 xspi->remaining_bytes = t->len;
247 reinit_completion(&xspi->done); 249 reinit_completion(&xspi->done);
248 250
249
250 /* Enable the transmit empty interrupt, which we use to determine
251 * progress on the transmission.
252 */
253 ipif_ier = xspi->read_fn(xspi->regs + XIPIF_V123B_IIER_OFFSET);
254 xspi->write_fn(ipif_ier | XSPI_INTR_TX_EMPTY,
255 xspi->regs + XIPIF_V123B_IIER_OFFSET);
256
257 for (;;) { 251 for (;;) {
258 u16 cr; 252 u16 cr;
259 int n_words; 253 int n_words;
@@ -290,9 +284,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
290 break; 284 break;
291 } 285 }
292 286
293 /* Disable the transmit empty interrupt */
294 xspi->write_fn(ipif_ier, xspi->regs + XIPIF_V123B_IIER_OFFSET);
295
296 return t->len - xspi->remaining_bytes; 287 return t->len - xspi->remaining_bytes;
297} 288}
298 289