aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap3beagle.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-omap3beagle.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-omap3beagle.c')
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 7ffcd2839e7b..78bfcd5d5a78 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -253,6 +253,7 @@ static struct omap2_hsmmc_info mmc[] = {
253 .mmc = 1, 253 .mmc = 1,
254 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 254 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
255 .gpio_wp = -EINVAL, 255 .gpio_wp = -EINVAL,
256 .deferred = true,
256 }, 257 },
257 {} /* Terminator */ 258 {} /* Terminator */
258}; 259};
@@ -277,7 +278,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
277 mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; 278 mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp;
278 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 279 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
279 mmc[0].gpio_cd = gpio + 0; 280 mmc[0].gpio_cd = gpio + 0;
280 omap2_hsmmc_init(mmc); 281 omap_hsmmc_late_init(mmc);
281 282
282 /* 283 /*
283 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active 284 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
@@ -521,6 +522,7 @@ static void __init omap3_beagle_init(void)
521{ 522{
522 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 523 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
523 omap3_beagle_init_rev(); 524 omap3_beagle_init_rev();
525 omap_hsmmc_init(mmc);
524 omap3_beagle_i2c_init(); 526 omap3_beagle_i2c_init();
525 527
526 gpio_buttons[0].gpio = beagle_config.usr_button_gpio; 528 gpio_buttons[0].gpio = beagle_config.usr_button_gpio;