diff options
Diffstat (limited to 'drivers/mmc/host/omap.c')
| -rw-r--r-- | drivers/mmc/host/omap.c | 16 | 
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 50e08f03aa6..c6259a82954 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -33,11 +33,9 @@  #include <asm/io.h>  #include <asm/irq.h> -#include <plat/board.h>  #include <plat/mmc.h>  #include <asm/gpio.h>  #include <plat/dma.h> -#include <plat/mux.h>  #include <plat/fpga.h>  #define	OMAP_MMC_REG_CMD	0x00 @@ -668,7 +666,7 @@ mmc_omap_clk_timer(unsigned long data)  static void  mmc_omap_xfer_data(struct mmc_omap_host *host, int write)  { -	int n; +	int n, nwords;  	if (host->buffer_bytes_left == 0) {  		host->sg_idx++; @@ -678,15 +676,23 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int write)  	n = 64;  	if (n > host->buffer_bytes_left)  		n = host->buffer_bytes_left; + +	nwords = n / 2; +	nwords += n & 1; /* handle odd number of bytes to transfer */ +  	host->buffer_bytes_left -= n;  	host->total_bytes_left -= n;  	host->data->bytes_xfered += n;  	if (write) { -		__raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); +		__raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), +			      host->buffer, nwords);  	} else { -		__raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); +		__raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), +			     host->buffer, nwords);  	} + +	host->buffer += nwords;  }  static inline void mmc_omap_report_irq(u16 status)  |