aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-03-23 21:23:47 -0400
committerTony Lindgren <tony@atomide.com>2009-03-23 21:51:22 -0400
commit01971f65ff88e3ebe2b6ae42b95d68e26b83718d (patch)
treef56acfdf414de33b48d487669e438f0b6568a516 /arch/arm
parent0329c3773e59aa7e50dc3760a27fb4e098773d0f (diff)
ARM: OMAP3: mmc-twl4030 init passes device nodes back, v2
When setting up HSMMC devices, 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>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c10
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.h1
-rw-r--r--arch/arm/plat-omap/devices.c3
-rw-r--r--arch/arm/plat-omap/include/mach/mmc.h2
4 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index df1539e2cd07..c67078db07be 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -17,6 +17,7 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/i2c/twl4030.h> 19#include <linux/i2c/twl4030.h>
20#include <linux/regulator/machine.h>
20 21
21#include <mach/hardware.h> 22#include <mach/hardware.h>
22#include <mach/control.h> 23#include <mach/control.h>
@@ -437,6 +438,15 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
437 } 438 }
438 439
439 omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); 440 omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC);
441
442 /* pass the device nodes back to board setup code */
443 for (c = controllers; c->mmc; c++) {
444 struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1];
445
446 if (!c->mmc || c->mmc > nr_hsmmc)
447 continue;
448 c->dev = mmc->dev;
449 }
440} 450}
441 451
442#endif 452#endif
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 380dde7bcfe3..21d35727f921 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -13,6 +13,7 @@ struct twl4030_hsmmc_info {
13 bool ext_clock; /* use external pin for input clock */ 13 bool ext_clock; /* use external pin for input clock */
14 int gpio_cd; /* or -EINVAL */ 14 int gpio_cd; /* or -EINVAL */
15 int gpio_wp; /* or -EINVAL */ 15 int gpio_wp; /* or -EINVAL */
16 struct device *dev; /* returned: pointer to mmc adapter */
16}; 17};
17 18
18#if defined(CONFIG_TWL4030_CORE) && \ 19#if defined(CONFIG_TWL4030_CORE) && \
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 208dbb121f47..87fb7ff41794 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -228,6 +228,9 @@ int __init omap_mmc_add(const char *name, int id, unsigned long base,
228 ret = platform_device_add(pdev); 228 ret = platform_device_add(pdev);
229 if (ret) 229 if (ret)
230 goto fail; 230 goto fail;
231
232 /* return device handle to board setup code */
233 data->dev = &pdev->dev;
231 return 0; 234 return 0;
232 235
233fail: 236fail:
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h
index 73a9e15031b1..4435bd434e17 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/mach/mmc.h
@@ -37,6 +37,8 @@
37#define OMAP_MMC_MAX_SLOTS 2 37#define OMAP_MMC_MAX_SLOTS 2
38 38
39struct omap_mmc_platform_data { 39struct omap_mmc_platform_data {
40 /* back-link to device */
41 struct device *dev;
40 42
41 /* number of slots per controller */ 43 /* number of slots per controller */
42 unsigned nr_slots:2; 44 unsigned nr_slots:2;