aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/s3cmci.c
diff options
context:
space:
mode:
authorBen Dooks <ben@simtec.co.uk>2009-10-01 18:44:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-01 19:11:14 -0400
commit44d0e19968b3b2703aa4ee1f9a5b684425b40448 (patch)
tree63efaef3a24295199f89efb62273772978ef2aae /drivers/mmc/host/s3cmci.c
parentda52a7ca7a689712e689e2cc5936cd9fa34df443 (diff)
s3cmci: update probe to use new platform id list
Use the platform id list to match the three different versions of the hardware block that this driver supports. This will change the prefix of the console messages produced by this driver to be prefixed by s3c-mci instead of the hardware block name, such as s3c2440-mci. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc/host/s3cmci.c')
-rw-r--r--drivers/mmc/host/s3cmci.c71
1 files changed, 24 insertions, 47 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 84e088c44540..20ed46cef13b 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1244,11 +1244,14 @@ static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
1244} 1244}
1245#endif 1245#endif
1246 1246
1247static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) 1247static int __devinit s3cmci_probe(struct platform_device *pdev)
1248{ 1248{
1249 struct s3cmci_host *host; 1249 struct s3cmci_host *host;
1250 struct mmc_host *mmc; 1250 struct mmc_host *mmc;
1251 int ret; 1251 int ret;
1252 int is2440;
1253
1254 is2440 = platform_get_device_id(pdev)->driver_data;
1252 1255
1253 mmc = mmc_alloc_host(sizeof(struct s3cmci_host), &pdev->dev); 1256 mmc = mmc_alloc_host(sizeof(struct s3cmci_host), &pdev->dev);
1254 if (!mmc) { 1257 if (!mmc) {
@@ -1473,20 +1476,22 @@ static int __devexit s3cmci_remove(struct platform_device *pdev)
1473 return 0; 1476 return 0;
1474} 1477}
1475 1478
1476static int __devinit s3cmci_2410_probe(struct platform_device *dev) 1479static struct platform_device_id s3cmci_driver_ids[] = {
1477{ 1480 {
1478 return s3cmci_probe(dev, 0); 1481 .name = "s3c2410-sdi",
1479} 1482 .driver_data = 0,
1483 }, {
1484 .name = "s3c2412-sdi",
1485 .driver_data = 1,
1486 }, {
1487 .name = "s3c2440-sdi",
1488 .driver_data = 1,
1489 },
1490 { }
1491};
1480 1492
1481static int __devinit s3cmci_2412_probe(struct platform_device *dev) 1493MODULE_DEVICE_TABLE(platform, s3cmci_driver_ids);
1482{
1483 return s3cmci_probe(dev, 1);
1484}
1485 1494
1486static int __devinit s3cmci_2440_probe(struct platform_device *dev)
1487{
1488 return s3cmci_probe(dev, 1);
1489}
1490 1495
1491#ifdef CONFIG_PM 1496#ifdef CONFIG_PM
1492 1497
@@ -1510,50 +1515,25 @@ static int s3cmci_resume(struct platform_device *dev)
1510#endif /* CONFIG_PM */ 1515#endif /* CONFIG_PM */
1511 1516
1512 1517
1513static struct platform_driver s3cmci_2410_driver = { 1518static struct platform_driver s3cmci_driver = {
1514 .driver.name = "s3c2410-sdi", 1519 .driver.name = "s3c-sdi",
1515 .driver.owner = THIS_MODULE,
1516 .probe = s3cmci_2410_probe,
1517 .remove = __devexit_p(s3cmci_remove),
1518 .shutdown = s3cmci_shutdown,
1519 .suspend = s3cmci_suspend,
1520 .resume = s3cmci_resume,
1521};
1522
1523static struct platform_driver s3cmci_2412_driver = {
1524 .driver.name = "s3c2412-sdi",
1525 .driver.owner = THIS_MODULE,
1526 .probe = s3cmci_2412_probe,
1527 .remove = __devexit_p(s3cmci_remove),
1528 .shutdown = s3cmci_shutdown,
1529 .suspend = s3cmci_suspend,
1530 .resume = s3cmci_resume,
1531};
1532
1533static struct platform_driver s3cmci_2440_driver = {
1534 .driver.name = "s3c2440-sdi",
1535 .driver.owner = THIS_MODULE, 1520 .driver.owner = THIS_MODULE,
1536 .probe = s3cmci_2440_probe, 1521 .id_table = s3cmci_driver_ids,
1522 .probe = s3cmci_probe,
1537 .remove = __devexit_p(s3cmci_remove), 1523 .remove = __devexit_p(s3cmci_remove),
1538 .shutdown = s3cmci_shutdown, 1524 .shutdown = s3cmci_shutdown,
1539 .suspend = s3cmci_suspend, 1525 .suspend = s3cmci_suspend,
1540 .resume = s3cmci_resume, 1526 .resume = s3cmci_resume,
1541}; 1527};
1542 1528
1543
1544static int __init s3cmci_init(void) 1529static int __init s3cmci_init(void)
1545{ 1530{
1546 platform_driver_register(&s3cmci_2410_driver); 1531 return platform_driver_register(&s3cmci_driver);
1547 platform_driver_register(&s3cmci_2412_driver);
1548 platform_driver_register(&s3cmci_2440_driver);
1549 return 0;
1550} 1532}
1551 1533
1552static void __exit s3cmci_exit(void) 1534static void __exit s3cmci_exit(void)
1553{ 1535{
1554 platform_driver_unregister(&s3cmci_2410_driver); 1536 platform_driver_unregister(&s3cmci_driver);
1555 platform_driver_unregister(&s3cmci_2412_driver);
1556 platform_driver_unregister(&s3cmci_2440_driver);
1557} 1537}
1558 1538
1559module_init(s3cmci_init); 1539module_init(s3cmci_init);
@@ -1562,6 +1542,3 @@ module_exit(s3cmci_exit);
1562MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver"); 1542MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
1563MODULE_LICENSE("GPL v2"); 1543MODULE_LICENSE("GPL v2");
1564MODULE_AUTHOR("Thomas Kleffel <tk@maintech.de>, Ben Dooks <ben-linux@fluff.org>"); 1544MODULE_AUTHOR("Thomas Kleffel <tk@maintech.de>, Ben Dooks <ben-linux@fluff.org>");
1565MODULE_ALIAS("platform:s3c2410-sdi");
1566MODULE_ALIAS("platform:s3c2412-sdi");
1567MODULE_ALIAS("platform:s3c2440-sdi");