]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
hsmmc init passes device nodes back
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 20 Jan 2009 10:52:02 +0000 (02:52 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 4 Feb 2009 19:22:09 +0000 (11:22 -0800)
When setting up HSMMC devices, pass pass the device nodes back so
board code can linking them to their power supply regulators.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/mmc-twl4030.c
arch/arm/mach-omap2/mmc-twl4030.h
arch/arm/plat-omap/devices.c
arch/arm/plat-omap/include/mach/mmc.h

index b45135e6688a3c627c9215e834ed870eee7c579f..182c7a3332dc4f967362015f2592d7f210ed00ca 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/regulator/machine.h>
 
 #include <mach/hardware.h>
 #include <mach/control.h>
@@ -436,6 +437,15 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
        }
 
        omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC);
+
+       /* pass the device nodes back to board setup code */
+       for (c = controllers; c->mmc; c++) {
+               struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1];
+
+               if (!c->mmc || c->mmc > nr_hsmmc)
+                       continue;
+               c->dev = mmc->dev;
+       }
 }
 
 #endif
index 380dde7bcfe34e5e860c50d3a461fecfd0147bd1..21d35727f921d66157b27194dc53bb5129505b7d 100644 (file)
@@ -13,6 +13,7 @@ struct twl4030_hsmmc_info {
        bool    ext_clock;      /* use external pin for input clock */
        int     gpio_cd;        /* or -EINVAL */
        int     gpio_wp;        /* or -EINVAL */
+       struct device *dev;     /* returned: pointer to mmc adapter */
 };
 
 #if    defined(CONFIG_TWL4030_CORE) && \
index 2c3c72f499ecfaf655350d10e99fcbc7842ebe70..dd836e2dbf8c89c20717810a56fb9c7b9ee56794 100644 (file)
@@ -232,6 +232,9 @@ int __init omap_mmc_add(int id, unsigned long base, unsigned long size,
        ret = platform_device_add(pdev);
        if (ret)
                goto fail;
+
+       /* return device handle to board setup code */
+       data->dev = &pdev->dev;
        return 0;
 
 fail:
index 031250f028050b4e95bb805194ba36484b6e4229..dae1920e1126dfe3c47a62d267764c4bc94daf16 100644 (file)
@@ -37,6 +37,8 @@
 #define OMAP_MMC_MAX_SLOTS     2
 
 struct omap_mmc_platform_data {
+       /* back-link to device */
+       struct device *dev;
 
        /* number of slots per controller */
        unsigned nr_slots:2;