aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap3touchbook.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-02-20 12:43:29 -0500
committerTony Lindgren <tony@atomide.com>2012-02-20 13:00:39 -0500
commit3b972bf06c22f5abfa6586a8baf50321cd825965 (patch)
tree666fd47675069dae78337f648670a550c4f9f85b /arch/arm/mach-omap2/board-omap3touchbook.c
parent993e4fbd7822cdf874fcf9f1b054a323d67ccf97 (diff)
ARM: OMAP2+: Split omap2_hsmmc_init() to properly support I2C GPIO pins
Otherwise omap_device_build() and omap_mux related functions can't be marked as __init when twl is build as a module. If a board is using GPIO pins or regulators configured by an external chip, such as TWL PMIC on I2C bus, the board must mark those MMC controllers as deferred. Additionally both omap_hsmmc_init() and omap_hsmmc_late_init() must be called by the board. For MMC controllers using internal GPIO pins for card detect and regulators the slots don't need to be marked deferred. In this case calling omap_hsmmc_init() is sufficient. Only mark the MMC slots using gpio_cd or gpio_wd as deferred as noted by Igor Grinberg <grinberg@compulab.co.il>. Note that this patch does not change the behaviour for board-4430sdp.c board-omap4panda.c. These boards wrongly rely on the omap_hsmmc.c init function callback to configure the PMIC GPIO interrupt lines on external chip. If the PMIC interrupt lines are not configured during init, they will fail. Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3touchbook.c')
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index a0b851aafcca..ba9c118862e6 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -100,6 +100,7 @@ static struct omap2_hsmmc_info mmc[] = {
100 .mmc = 1, 100 .mmc = 1,
101 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 101 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
102 .gpio_wp = 29, 102 .gpio_wp = 29,
103 .deferred = true,
103 }, 104 },
104 {} /* Terminator */ 105 {} /* Terminator */
105}; 106};
@@ -125,7 +126,7 @@ static int touchbook_twl_gpio_setup(struct device *dev,
125 } 126 }
126 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 127 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
127 mmc[0].gpio_cd = gpio + 0; 128 mmc[0].gpio_cd = gpio + 0;
128 omap2_hsmmc_init(mmc); 129 omap_hsmmc_late_init(mmc);
129 130
130 /* REVISIT: need ehci-omap hooks for external VBUS 131 /* REVISIT: need ehci-omap hooks for external VBUS
131 * power switch and overcurrent detect 132 * power switch and overcurrent detect
@@ -351,6 +352,7 @@ static void __init omap3_touchbook_init(void)
351 352
352 pm_power_off = omap3_touchbook_poweroff; 353 pm_power_off = omap3_touchbook_poweroff;
353 354
355 omap_hsmmc_init(mmc);
354 omap3_touchbook_i2c_init(); 356 omap3_touchbook_i2c_init();
355 platform_add_devices(omap3_touchbook_devices, 357 platform_add_devices(omap3_touchbook_devices,
356 ARRAY_SIZE(omap3_touchbook_devices)); 358 ARRAY_SIZE(omap3_touchbook_devices));