diff options
Diffstat (limited to 'drivers/mmc/host/omap.c')
-rw-r--r-- | drivers/mmc/host/omap.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 50e08f03aa65..87c0293a1eef 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <asm/io.h> | 33 | #include <asm/io.h> |
34 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
35 | 35 | ||
36 | #include <plat/board.h> | ||
37 | #include <plat/mmc.h> | 36 | #include <plat/mmc.h> |
38 | #include <asm/gpio.h> | 37 | #include <asm/gpio.h> |
39 | #include <plat/dma.h> | 38 | #include <plat/dma.h> |
@@ -668,7 +667,7 @@ mmc_omap_clk_timer(unsigned long data) | |||
668 | static void | 667 | static void |
669 | mmc_omap_xfer_data(struct mmc_omap_host *host, int write) | 668 | mmc_omap_xfer_data(struct mmc_omap_host *host, int write) |
670 | { | 669 | { |
671 | int n; | 670 | int n, nwords; |
672 | 671 | ||
673 | if (host->buffer_bytes_left == 0) { | 672 | if (host->buffer_bytes_left == 0) { |
674 | host->sg_idx++; | 673 | host->sg_idx++; |
@@ -678,15 +677,23 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int write) | |||
678 | n = 64; | 677 | n = 64; |
679 | if (n > host->buffer_bytes_left) | 678 | if (n > host->buffer_bytes_left) |
680 | n = host->buffer_bytes_left; | 679 | n = host->buffer_bytes_left; |
680 | |||
681 | nwords = n / 2; | ||
682 | nwords += n & 1; /* handle odd number of bytes to transfer */ | ||
683 | |||
681 | host->buffer_bytes_left -= n; | 684 | host->buffer_bytes_left -= n; |
682 | host->total_bytes_left -= n; | 685 | host->total_bytes_left -= n; |
683 | host->data->bytes_xfered += n; | 686 | host->data->bytes_xfered += n; |
684 | 687 | ||
685 | if (write) { | 688 | if (write) { |
686 | __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); | 689 | __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), |
690 | host->buffer, nwords); | ||
687 | } else { | 691 | } else { |
688 | __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); | 692 | __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), |
693 | host->buffer, nwords); | ||
689 | } | 694 | } |
695 | |||
696 | host->buffer += nwords; | ||
690 | } | 697 | } |
691 | 698 | ||
692 | static inline void mmc_omap_report_irq(u16 status) | 699 | static inline void mmc_omap_report_irq(u16 status) |