Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: pxamci: set proper buswidth capabilities according to PXA flavor

From PXA27x, it is possible to do 4-bit data transfers.

Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

authored by

Bridge Wu and committed by
Pierre Ossman
df456f47 fe2dc44e

+10 -1
+9 -1
drivers/mmc/host/pxamci.c
··· 284 284 host->data = NULL; 285 285 if (host->mrq->stop) { 286 286 pxamci_stop_clock(host); 287 - pxamci_start_cmd(host, host->mrq->stop, 0); 287 + pxamci_start_cmd(host, host->mrq->stop, host->cmdat); 288 288 } else { 289 289 pxamci_finish_request(host, host->mrq); 290 290 } ··· 382 382 host->cmdat |= CMDAT_INIT; 383 383 } 384 384 385 + if (ios->bus_width == MMC_BUS_WIDTH_4) 386 + host->cmdat |= CMDAT_SD_4DAT; 387 + else 388 + host->cmdat &= ~CMDAT_SD_4DAT; 389 + 385 390 pr_debug("PXAMCI: clkrt = %x cmdat = %x\n", 386 391 host->clkrt, host->cmdat); 387 392 } ··· 465 460 mmc->ocr_avail = host->pdata ? 466 461 host->pdata->ocr_mask : 467 462 MMC_VDD_32_33|MMC_VDD_33_34; 463 + mmc->caps = 0; 464 + if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) 465 + mmc->caps |= MMC_CAP_4_BIT_DATA; 468 466 469 467 host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); 470 468 if (!host->sg_cpu) {
+1
drivers/mmc/host/pxamci.h
··· 25 25 #define SPI_EN (1 << 0) 26 26 27 27 #define MMC_CMDAT 0x0010 28 + #define CMDAT_SD_4DAT (1 << 8) 28 29 #define CMDAT_DMAEN (1 << 7) 29 30 #define CMDAT_INIT (1 << 6) 30 31 #define CMDAT_BUSY (1 << 5)