Skip to content

Commit 27151dc

Browse files
Kishore Kadiyalatorvalds
authored andcommitted
mmc: omap: fix for bus width which improves SD card's peformance.
This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading performance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <[email protected]> Signed-off-by: Venkatraman S <[email protected]> Signed-off-by: Nishanth Menon <[email protected]> Acked-by: Madhusudhan Chikkature <[email protected]> Tested-by: Jarkko Nikula <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Tony Lindgren <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent fc8a098 commit 27151dc

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

drivers/mmc/host/omap_hsmmc.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,10 +2096,23 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
20962096
mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
20972097
MMC_CAP_WAIT_WHILE_BUSY;
20982098

2099-
if (mmc_slot(host).wires >= 8)
2099+
switch (mmc_slot(host).wires) {
2100+
case 8:
21002101
mmc->caps |= MMC_CAP_8_BIT_DATA;
2101-
else if (mmc_slot(host).wires >= 4)
2102+
/* Fall through */
2103+
case 4:
21022104
mmc->caps |= MMC_CAP_4_BIT_DATA;
2105+
break;
2106+
case 1:
2107+
/* Nothing to crib here */
2108+
case 0:
2109+
/* Assuming nothing was given by board, Core use's 1-Bit */
2110+
break;
2111+
default:
2112+
/* Completely unexpected.. Core goes with 1-Bit Width */
2113+
dev_crit(mmc_dev(host->mmc), "Invalid width %d\n used!"
2114+
"using 1 instead\n", mmc_slot(host).wires);
2115+
}
21032116

21042117
if (mmc_slot(host).nonremovable)
21052118
mmc->caps |= MMC_CAP_NONREMOVABLE;

0 commit comments

Comments
 (0)