aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-pltfm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/sdhci-pltfm.c')
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index b6ee0d719698..e045e3c61dde 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -24,6 +24,7 @@
24 24
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/highmem.h> 26#include <linux/highmem.h>
27#include <linux/mod_devicetable.h>
27#include <linux/platform_device.h> 28#include <linux/platform_device.h>
28 29
29#include <linux/mmc/host.h> 30#include <linux/mmc/host.h>
@@ -32,6 +33,7 @@
32#include <linux/sdhci-pltfm.h> 33#include <linux/sdhci-pltfm.h>
33 34
34#include "sdhci.h" 35#include "sdhci.h"
36#include "sdhci-pltfm.h"
35 37
36/*****************************************************************************\ 38/*****************************************************************************\
37 * * 39 * *
@@ -51,10 +53,14 @@ static struct sdhci_ops sdhci_pltfm_ops = {
51static int __devinit sdhci_pltfm_probe(struct platform_device *pdev) 53static int __devinit sdhci_pltfm_probe(struct platform_device *pdev)
52{ 54{
53 struct sdhci_pltfm_data *pdata = pdev->dev.platform_data; 55 struct sdhci_pltfm_data *pdata = pdev->dev.platform_data;
56 const struct platform_device_id *platid = platform_get_device_id(pdev);
54 struct sdhci_host *host; 57 struct sdhci_host *host;
55 struct resource *iomem; 58 struct resource *iomem;
56 int ret; 59 int ret;
57 60
61 if (!pdata && platid && platid->driver_data)
62 pdata = (void *)platid->driver_data;
63
58 iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 64 iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
59 if (!iomem) { 65 if (!iomem) {
60 ret = -ENOMEM; 66 ret = -ENOMEM;
@@ -150,6 +156,15 @@ static int __devexit sdhci_pltfm_remove(struct platform_device *pdev)
150 return 0; 156 return 0;
151} 157}
152 158
159static const struct platform_device_id sdhci_pltfm_ids[] = {
160 { "sdhci", },
161#ifdef CONFIG_MMC_SDHCI_CNS3XXX
162 { "sdhci-cns3xxx", (kernel_ulong_t)&sdhci_cns3xxx_pdata },
163#endif
164 { },
165};
166MODULE_DEVICE_TABLE(platform, sdhci_pltfm_ids);
167
153static struct platform_driver sdhci_pltfm_driver = { 168static struct platform_driver sdhci_pltfm_driver = {
154 .driver = { 169 .driver = {
155 .name = "sdhci", 170 .name = "sdhci",
@@ -157,6 +172,7 @@ static struct platform_driver sdhci_pltfm_driver = {
157 }, 172 },
158 .probe = sdhci_pltfm_probe, 173 .probe = sdhci_pltfm_probe,
159 .remove = __devexit_p(sdhci_pltfm_remove), 174 .remove = __devexit_p(sdhci_pltfm_remove),
175 .id_table = sdhci_pltfm_ids,
160}; 176};
161 177
162/*****************************************************************************\ 178/*****************************************************************************\
@@ -181,4 +197,3 @@ module_exit(sdhci_drv_exit);
181MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); 197MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver");
182MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>"); 198MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
183MODULE_LICENSE("GPL v2"); 199MODULE_LICENSE("GPL v2");
184MODULE_ALIAS("platform:sdhci");