mmc: atmel-mci: fix multiblock SDIO transfers

Based on report made by Yauhen in:
"MMC: Fix multiblock SDIO transfers in AT91 MCI" patch,
I report those changes to the brother driver: atmel-mci.

So, this patch sets SDIO transfer types: SDIO block and SDIO byte
transfers instead of using ordinary MMC block transfers.
It is checking opcode for SDIO CMD53 and setting transfer
type in MCI_CMDR register properly.

Reported-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
Cc: <stable@kernel.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

authored by Nicolas Ferre and committed by Chris Ball 2f1d7918 a2255ff4

+12 -6
+12 -6
drivers/mmc/host/atmel-mci.c
··· 26 26 #include <linux/stat.h> 27 27 28 28 #include <linux/mmc/host.h> 29 + #include <linux/mmc/sdio.h> 29 30 30 31 #include <mach/atmel-mci.h> 31 32 #include <linux/atmel-mci.h> ··· 533 532 data = cmd->data; 534 533 if (data) { 535 534 cmdr |= MCI_CMDR_START_XFER; 536 - if (data->flags & MMC_DATA_STREAM) 537 - cmdr |= MCI_CMDR_STREAM; 538 - else if (data->blocks > 1) 539 - cmdr |= MCI_CMDR_MULTI_BLOCK; 540 - else 541 - cmdr |= MCI_CMDR_BLOCK; 535 + 536 + if (cmd->opcode == SD_IO_RW_EXTENDED) { 537 + cmdr |= MCI_CMDR_SDIO_BLOCK; 538 + } else { 539 + if (data->flags & MMC_DATA_STREAM) 540 + cmdr |= MCI_CMDR_STREAM; 541 + else if (data->blocks > 1) 542 + cmdr |= MCI_CMDR_MULTI_BLOCK; 543 + else 544 + cmdr |= MCI_CMDR_BLOCK; 545 + } 542 546 543 547 if (data->flags & MMC_DATA_READ) 544 548 cmdr |= MCI_CMDR_TRDIR_READ;