aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/au1550_spi.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/spi/au1550_spi.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/spi/au1550_spi.c')
-rw-r--r--drivers/spi/au1550_spi.c17
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