aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/omap.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-11-26 18:50:33 -0500
committerTony Lindgren <tony@atomide.com>2013-11-26 18:51:16 -0500
commit9cb238c00ba5c1ddfff2c2ed6aa66c15b962e4c3 (patch)
tree56cb66dc99bbb43df472bcd4a3f5ca824308ab09 /drivers/mmc/host/omap.c
parent31ee9181eb92cc727876ec5a2144a1b3cbdf5bb1 (diff)
mmc: omap: Fix I2C dependency and make driver usable with device tree
Some features can be configured by the companion I2C chips, which may not be available at the probe time. Fix the issue by returning -EPROBE_DEFER when the MMC controller slots are not configured. While at it, let's also add minimal device tree support so omap24xx platforms can use this driver without legacy mode since we claim to support device tree for mach-omap2 based systems. Although adding the minimal device tree support is not strictly a fix, it does remove one of the last blockers for dropping a bunch of legacy platform data for mach-omap2. Cc: linux-mmc@vger.kernel.org Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/mmc/host/omap.c')
-rw-r--r--drivers/mmc/host/omap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 22995873f554..98b6b6ef7e5c 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -22,6 +22,7 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/timer.h> 24#include <linux/timer.h>
25#include <linux/of.h>
25#include <linux/omap-dma.h> 26#include <linux/omap-dma.h>
26#include <linux/mmc/host.h> 27#include <linux/mmc/host.h>
27#include <linux/mmc/card.h> 28#include <linux/mmc/card.h>
@@ -1329,7 +1330,7 @@ static int mmc_omap_probe(struct platform_device *pdev)
1329 } 1330 }
1330 if (pdata->nr_slots == 0) { 1331 if (pdata->nr_slots == 0) {
1331 dev_err(&pdev->dev, "no slots\n"); 1332 dev_err(&pdev->dev, "no slots\n");
1332 return -ENXIO; 1333 return -EPROBE_DEFER;
1333 } 1334 }
1334 1335
1335 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1336 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1502,12 +1503,20 @@ static int mmc_omap_remove(struct platform_device *pdev)
1502 return 0; 1503 return 0;
1503} 1504}
1504 1505
1506#if IS_BUILTIN(CONFIG_OF)
1507static const struct of_device_id mmc_omap_match[] = {
1508 { .compatible = "ti,omap2420-mmc", },
1509 { },
1510};
1511#endif
1512
1505static struct platform_driver mmc_omap_driver = { 1513static struct platform_driver mmc_omap_driver = {
1506 .probe = mmc_omap_probe, 1514 .probe = mmc_omap_probe,
1507 .remove = mmc_omap_remove, 1515 .remove = mmc_omap_remove,
1508 .driver = { 1516 .driver = {
1509 .name = DRIVER_NAME, 1517 .name = DRIVER_NAME,
1510 .owner = THIS_MODULE, 1518 .owner = THIS_MODULE,
1519 .of_match_table = of_match_ptr(mmc_omap_match),
1511 }, 1520 },
1512}; 1521};
1513 1522