diff options
Diffstat (limited to 'drivers/spi/au1550_spi.c')
-rw-r--r-- | drivers/spi/au1550_spi.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/spi/au1550_spi.c b/drivers/spi/au1550_spi.c index 76cbc1a66598..3c9ade69643f 100644 --- a/drivers/spi/au1550_spi.c +++ b/drivers/spi/au1550_spi.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/slab.h> | ||
26 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
27 | #include <linux/device.h> | 28 | #include <linux/device.h> |
28 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
@@ -237,8 +238,14 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t) | |||
237 | unsigned bpw, hz; | 238 | unsigned bpw, hz; |
238 | u32 cfg, stat; | 239 | u32 cfg, stat; |
239 | 240 | ||
240 | bpw = t ? t->bits_per_word : spi->bits_per_word; | 241 | bpw = spi->bits_per_word; |
241 | hz = t ? t->speed_hz : spi->max_speed_hz; | 242 | hz = spi->max_speed_hz; |
243 | if (t) { | ||
244 | if (t->bits_per_word) | ||
245 | bpw = t->bits_per_word; | ||
246 | if (t->speed_hz) | ||
247 | hz = t->speed_hz; | ||
248 | } | ||
242 | 249 | ||
243 | if (bpw < 4 || bpw > 24) { | 250 | if (bpw < 4 || bpw > 24) { |
244 | dev_err(&spi->dev, "setupxfer: invalid bits_per_word=%d\n", | 251 | dev_err(&spi->dev, "setupxfer: invalid bits_per_word=%d\n", |
@@ -406,11 +413,13 @@ static int au1550_spi_dma_txrxb(struct spi_device *spi, struct spi_transfer *t) | |||
406 | } | 413 | } |
407 | 414 | ||
408 | /* put buffers on the ring */ | 415 | /* put buffers on the ring */ |
409 | res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, hw->rx, t->len); | 416 | res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, virt_to_phys(hw->rx), |
417 | t->len, DDMA_FLAGS_IE); | ||
410 | if (!res) | 418 | if (!res) |
411 | dev_err(hw->dev, "rx dma put dest error\n"); | 419 | dev_err(hw->dev, "rx dma put dest error\n"); |
412 | 420 | ||
413 | res = au1xxx_dbdma_put_source(hw->dma_tx_ch, (void *)hw->tx, t->len); | 421 | res = au1xxx_dbdma_put_source(hw->dma_tx_ch, virt_to_phys(hw->tx), |
422 | t->len, DDMA_FLAGS_IE); | ||
414 | if (!res) | 423 | if (!res) |
415 | dev_err(hw->dev, "tx dma put source error\n"); | 424 | dev_err(hw->dev, "tx dma put source error\n"); |
416 | 425 | ||