diff options
author | Manjunathappa, Prakash <prakash.pm@ti.com> | 2013-03-28 09:11:59 -0400 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2013-04-03 00:12:16 -0400 |
commit | d7ca4c755a82eda8f0fc4f72c52130056b28c7d2 (patch) | |
tree | a7ed22e94854f51fa43483c4cb4fecc8460bf0ad /drivers/mmc | |
parent | bb170e6118e76903bf03fc14ab60a34c26aac747 (diff) |
ARM: davinci: mmc: derive version information from device name
Remove specifying mmc controller IP version information via platform
data, instead specify device name so that driver derives it from
platform_device_id table. Also change the clock node name to match
the changed dev_id.
Tested on da850-evm to make sure driver loads without clk_get failures.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/davinci_mmc.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 20636772c09b..b5f1c019ecad 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c | |||
@@ -1157,6 +1157,18 @@ static void __init init_mmcsd_host(struct mmc_davinci_host *host) | |||
1157 | mmc_davinci_reset_ctrl(host, 0); | 1157 | mmc_davinci_reset_ctrl(host, 0); |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | static struct platform_device_id davinci_mmc_devtype[] = { | ||
1161 | { | ||
1162 | .name = "dm6441-mmc", | ||
1163 | .driver_data = MMC_CTLR_VERSION_1, | ||
1164 | }, { | ||
1165 | .name = "da830-mmc", | ||
1166 | .driver_data = MMC_CTLR_VERSION_2, | ||
1167 | }, | ||
1168 | {}, | ||
1169 | }; | ||
1170 | MODULE_DEVICE_TABLE(platform, davinci_mmc_devtype); | ||
1171 | |||
1160 | static int __init davinci_mmcsd_probe(struct platform_device *pdev) | 1172 | static int __init davinci_mmcsd_probe(struct platform_device *pdev) |
1161 | { | 1173 | { |
1162 | struct davinci_mmc_config *pdata = pdev->dev.platform_data; | 1174 | struct davinci_mmc_config *pdata = pdev->dev.platform_data; |
@@ -1165,6 +1177,7 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev) | |||
1165 | struct resource *r, *mem = NULL; | 1177 | struct resource *r, *mem = NULL; |
1166 | int ret = 0, irq = 0; | 1178 | int ret = 0, irq = 0; |
1167 | size_t mem_size; | 1179 | size_t mem_size; |
1180 | const struct platform_device_id *id_entry; | ||
1168 | 1181 | ||
1169 | /* REVISIT: when we're fully converted, fail if pdata is NULL */ | 1182 | /* REVISIT: when we're fully converted, fail if pdata is NULL */ |
1170 | 1183 | ||
@@ -1237,7 +1250,9 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev) | |||
1237 | if (pdata && (pdata->wires == 8)) | 1250 | if (pdata && (pdata->wires == 8)) |
1238 | mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); | 1251 | mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); |
1239 | 1252 | ||
1240 | host->version = pdata->version; | 1253 | id_entry = platform_get_device_id(pdev); |
1254 | if (id_entry) | ||
1255 | host->version = id_entry->driver_data; | ||
1241 | 1256 | ||
1242 | mmc->ops = &mmc_davinci_ops; | 1257 | mmc->ops = &mmc_davinci_ops; |
1243 | mmc->f_min = 312500; | 1258 | mmc->f_min = 312500; |
@@ -1408,6 +1423,7 @@ static struct platform_driver davinci_mmcsd_driver = { | |||
1408 | .pm = davinci_mmcsd_pm_ops, | 1423 | .pm = davinci_mmcsd_pm_ops, |
1409 | }, | 1424 | }, |
1410 | .remove = __exit_p(davinci_mmcsd_remove), | 1425 | .remove = __exit_p(davinci_mmcsd_remove), |
1426 | .id_table = davinci_mmc_devtype, | ||
1411 | }; | 1427 | }; |
1412 | 1428 | ||
1413 | static int __init davinci_mmcsd_init(void) | 1429 | static int __init davinci_mmcsd_init(void) |