aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/omap.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 50e08f03aa65..a5999a74496a 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -668,7 +668,7 @@ mmc_omap_clk_timer(unsigned long data)
668static void 668static void
669mmc_omap_xfer_data(struct mmc_omap_host *host, int write) 669mmc_omap_xfer_data(struct mmc_omap_host *host, int write)
670{ 670{
671 int n; 671 int n, nwords;
672 672
673 if (host->buffer_bytes_left == 0) { 673 if (host->buffer_bytes_left == 0) {
674 host->sg_idx++; 674 host->sg_idx++;
@@ -678,15 +678,23 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int write)
678 n = 64; 678 n = 64;
679 if (n > host->buffer_bytes_left) 679 if (n > host->buffer_bytes_left)
680 n = host->buffer_bytes_left; 680 n = host->buffer_bytes_left;
681
682 nwords = n / 2;
683 nwords += n & 1; /* handle odd number of bytes to transfer */
684
681 host->buffer_bytes_left -= n; 685 host->buffer_bytes_left -= n;
682 host->total_bytes_left -= n; 686 host->total_bytes_left -= n;
683 host->data->bytes_xfered += n; 687 host->data->bytes_xfered += n;
684 688
685 if (write) { 689 if (write) {
686 __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); 690 __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA),
691 host->buffer, nwords);
687 } else { 692 } else {
688 __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); 693 __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA),
694 host->buffer, nwords);
689 } 695 }
696
697 host->buffer += nwords;
690} 698}
691 699
692static inline void mmc_omap_report_irq(u16 status) 700static inline void mmc_omap_report_irq(u16 status)