diff options
-rw-r--r-- | drivers/spi/spi_bfin5xx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index a9ac1fdb3094..7fea3cf4588a 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
@@ -608,6 +608,7 @@ static void pump_transfers(unsigned long data) | |||
608 | u8 width; | 608 | u8 width; |
609 | u16 cr, dma_width, dma_config; | 609 | u16 cr, dma_width, dma_config; |
610 | u32 tranf_success = 1; | 610 | u32 tranf_success = 1; |
611 | u8 full_duplex = 0; | ||
611 | 612 | ||
612 | /* Get current state information */ | 613 | /* Get current state information */ |
613 | message = drv_data->cur_msg; | 614 | message = drv_data->cur_msg; |
@@ -658,6 +659,7 @@ static void pump_transfers(unsigned long data) | |||
658 | } | 659 | } |
659 | 660 | ||
660 | if (transfer->rx_buf != NULL) { | 661 | if (transfer->rx_buf != NULL) { |
662 | full_duplex = transfer->tx_buf != NULL; | ||
661 | drv_data->rx = transfer->rx_buf; | 663 | drv_data->rx = transfer->rx_buf; |
662 | drv_data->rx_end = drv_data->rx + transfer->len; | 664 | drv_data->rx_end = drv_data->rx + transfer->len; |
663 | dev_dbg(&drv_data->pdev->dev, "rx_buf is %p, rx_end is %p\n", | 665 | dev_dbg(&drv_data->pdev->dev, "rx_buf is %p, rx_end is %p\n", |
@@ -740,7 +742,8 @@ static void pump_transfers(unsigned long data) | |||
740 | * successful use different way to r/w according to | 742 | * successful use different way to r/w according to |
741 | * drv_data->cur_chip->enable_dma | 743 | * drv_data->cur_chip->enable_dma |
742 | */ | 744 | */ |
743 | if (drv_data->cur_chip->enable_dma && drv_data->len > 6) { | 745 | if (!full_duplex && drv_data->cur_chip->enable_dma |
746 | && drv_data->len > 6) { | ||
744 | 747 | ||
745 | disable_dma(drv_data->dma_channel); | 748 | disable_dma(drv_data->dma_channel); |
746 | clear_dma_irqstat(drv_data->dma_channel); | 749 | clear_dma_irqstat(drv_data->dma_channel); |
@@ -828,7 +831,7 @@ static void pump_transfers(unsigned long data) | |||
828 | /* IO mode write then read */ | 831 | /* IO mode write then read */ |
829 | dev_dbg(&drv_data->pdev->dev, "doing IO transfer\n"); | 832 | dev_dbg(&drv_data->pdev->dev, "doing IO transfer\n"); |
830 | 833 | ||
831 | if (drv_data->tx != NULL && drv_data->rx != NULL) { | 834 | if (full_duplex) { |
832 | /* full duplex mode */ | 835 | /* full duplex mode */ |
833 | BUG_ON((drv_data->tx_end - drv_data->tx) != | 836 | BUG_ON((drv_data->tx_end - drv_data->tx) != |
834 | (drv_data->rx_end - drv_data->rx)); | 837 | (drv_data->rx_end - drv_data->rx)); |