mmc: sdhci-s3c: derive transfer width host cap from max_width in platdata
authorThomas Abraham <thomas.abraham@linaro.org>
Sun, 1 Apr 2012 03:29:45 +0000 (23:29 -0400)
committerChris Ball <cjb@laptop.org>
Thu, 5 Apr 2012 23:57:58 +0000 (19:57 -0400)
max_width member in platform data can be used to derive the mmc bus transfer
width that can be supported by the controller.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci-s3c.c

index 5fce143859101a0d9d877a2b04bc6c9dfaafd417..dab1a770cb8ab06ad42bb66a9583d1fcc1bbe857 100644 (file)
@@ -562,6 +562,14 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
        if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
                host->mmc->caps = MMC_CAP_NONREMOVABLE;
 
+       switch (pdata->max_width) {
+       case 8:
+               host->mmc->caps |= MMC_CAP_8_BIT_DATA;
+       case 4:
+               host->mmc->caps |= MMC_CAP_4_BIT_DATA;
+               break;
+       }
+
        if (pdata->pm_caps)
                host->mmc->pm_caps |= pdata->pm_caps;