diff mbox

[2.6.29-rc7-omap-git] Overo: MMC regulator configuration

Message ID 200903111158.29860.david-b@pacbell.net (mailing list archive)
State Superseded, archived
Headers show

Commit Message

David Brownell March 11, 2009, 6:58 p.m. UTC
From: David Brownell <dbrownell@users.sourceforge.net>

This patch hooks up the twl4030 MMC1 regulator on Overo,
as well as the MMC1 card detect signal.  The WLAN chip
connected to MMC2 on some board versions has a dedicated
regulator.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
Patches still needed for LDP/Zoom and Pandora...

 arch/arm/mach-omap2/board-overo.c |   55 ++++++++++++++++++++++++------------
 1 file changed, 37 insertions(+), 18 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Felipe Balbi March 11, 2009, 7:33 p.m. UTC | #1
On Wed, Mar 11, 2009 at 10:58:29AM -0800, David Brownell wrote:
> From: David Brownell <dbrownell@users.sourceforge.net>
> 
> This patch hooks up the twl4030 MMC1 regulator on Overo,
> as well as the MMC1 card detect signal.  The WLAN chip
> connected to MMC2 on some board versions has a dedicated
> regulator.
> 
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> ---
> Patches still needed for LDP/Zoom and Pandora...

with this patch I get:

regulator: Unable to get requested regulator: vmmc_aux
------------[ cut here ]------------
WARNING: at drivers/regulator/core.c:1216 regulator_disable+0x64/0x90()
unbalanced disables for supply mmci-omap-hs.0-vmmc
Modules linked in:
[<c0363198>] (dump_stack+0x0/0x14) from [<c004f0fc>] (warn_slowpath+0x6c/0x88)
[<c004f090>] (warn_slowpath+0x0/0x88) from [<c01b2694>] (regulator_disable+0x64/0x90)
 r3:cf9deae0 r2:c0425c79
 r7:cfa16e00 r6:cfa06c38 r5:cfa16e00 r4:fffffffb
[<c01b2630>] (regulator_disable+0x0/0x90) from [<c025ed6c>] (mmc_regulator_set_ocr+0xb0/0xcc)
 r7:cfa16e00 r6:00000001 r5:00000000 r4:00000000
[<c025ecbc>] (mmc_regulator_set_ocr+0x0/0xcc) from [<c003af08>] (twl_mmc1_set_power+0xc0/0xec)
 r7:cfa93538 r6:00000000 r5:00000000 r4:c04a5b58
[<c003ae48>] (twl_mmc1_set_power+0x0/0xec) from [<c0267b34>] (omap_mmc_set_ios+0x54/0x314)
 r7:cfa93538 r6:cfa935c0 r5:cfa93400 r4:cf9a93c0
[<c0267ae0>] (omap_mmc_set_ios+0x0/0x314) from [<c025e54c>] (mmc_power_off+0x90/0x9c)
 r7:00000000 r6:00000000 r5:cfa93400 r4:00000000
[<c025e4bc>] (mmc_power_off+0x0/0x9c) from [<c025ea98>] (mmc_start_host+0x14/0x24)
 r5:00000000 r4:cfa93400
[<c025ea84>] (mmc_start_host+0x0/0x24) from [<c025fcbc>] (mmc_add_host+0x64/0x70)
 r5:00000000 r4:cfa93400
[<c025fc58>] (mmc_add_host+0x0/0x70) from [<c0021cac>] (omap_mmc_probe+0x464/0x614)
 r5:cfa935c0 r4:cfa93470
[<c0021848>] (omap_mmc_probe+0x0/0x614) from [<c01d7b60>] (platform_drv_probe+0x20/0x24)
[<c01d7b40>] (platform_drv_probe+0x0/0x24) from [<c01d6d54>] (driver_probe_device+0xd4/0x180)
[<c01d6c80>] (driver_probe_device+0x0/0x180) from [<c01d6e68>] (__driver_attach+0x68/0x8c)
 r7:cfa15120 r6:c0499e34 r5:cfa06290 r4:cfa06208
[<c01d6e00>] (__driver_attach+0x0/0x8c) from [<c01d65f8>] (bus_for_each_dev+0x4c/0x80)
 r7:cfa15120 r6:c0499e34 r5:c01d6e00 r4:00000000
[<c01d65ac>] (bus_for_each_dev+0x0/0x80) from [<c01d6b98>] (driver_attach+0x20/0x28)
 r6:c0499e34 r5:00000000 r4:00000000
[<c01d6b78>] (driver_attach+0x0/0x28) from [<c01d5ed4>] (bus_add_driver+0xa4/0x20c)
[<c01d5e30>] (bus_add_driver+0x0/0x20c) from [<c01d708c>] (driver_register+0x98/0x120)
 r8:00000000 r7:c002182c r6:c0499e34 r5:00000000 r4:c0028a58
[<c01d6ff4>] (driver_register+0x0/0x120) from [<c01d8008>] (platform_driver_register+0x6c/0x88)
 r9:00000000 r8:00000000 r7:c002182c r6:00000000 r5:00000000
r4:c0028a58
[<c01d7f9c>] (platform_driver_register+0x0/0x88) from [<c0021840>] (omap_mmc_init+0x14/0x1c)
[<c002182c>] (omap_mmc_init+0x0/0x1c) from [<c002d2bc>] (__exception_text_end+0x5c/0x19c)
[<c002d260>] (__exception_text_end+0x0/0x19c) from [<c0008400>] (kernel_init+0x80/0xf4)
 r8:00000000 r7:00000000 r6:00000000 r5:00000000 r4:c0028a58
[<c0008380>] (kernel_init+0x0/0xf4) from [<c0051f50>] (do_exit+0x0/0x6a4)
 r4:00000000
---[ end trace e00c52255ce89b8f ]---
mmci-omap-hs mmci-omap-hs.1: Failed to get debounce clock
regulator: Unable to get requested regulator: vmmc

does this depend on any patch dave ? Using current omap HEAD.
Felipe Balbi March 11, 2009, 9 p.m. UTC | #2
On Wed, Mar 11, 2009 at 10:58:29AM -0800, David Brownell wrote:
> From: David Brownell <dbrownell@users.sourceforge.net>
> 
> This patch hooks up the twl4030 MMC1 regulator on Overo,
> as well as the MMC1 card detect signal.  The WLAN chip
> connected to MMC2 on some board versions has a dedicated
> regulator.
> 
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

Acked-by: Felipe Balbi <felipe.balbi@nokia.com>

> ---
> Patches still needed for LDP/Zoom and Pandora...
> 
>  arch/arm/mach-omap2/board-overo.c |   55 ++++++++++++++++++++++++------------
>  1 file changed, 37 insertions(+), 18 deletions(-)
> 
> --- a/arch/arm/mach-omap2/board-overo.c
> +++ b/arch/arm/mach-omap2/board-overo.c
> @@ -267,10 +267,45 @@ static struct omap_uart_config overo_uar
>  	.enabled_uarts	= ((1 << 0) | (1 << 1) | (1 << 2)),
>  };
>  
> +static struct twl4030_hsmmc_info mmc[] = {
> +	{
> +		.mmc		= 1,
> +		.wires		= 4,
> +		.gpio_cd	= -EINVAL,
> +		.gpio_wp	= -EINVAL,
> +	},
> +	{
> +		.mmc		= 2,
> +		.wires		= 4,
> +		.gpio_cd	= -EINVAL,
> +		.gpio_wp	= -EINVAL,
> +		.transceiver	= true,
> +		.ocr_mask	= 0x00100000,	/* 3.3V */
> +	},
> +	{}	/* Terminator */
> +};
> +
> +static struct regulator_consumer_supply overo_vmmc1_supply = {
> +	.supply			= "vmmc",
> +};
> +
> +static int overo_twl_gpio_setup(struct device *dev,
> +		unsigned gpio, unsigned ngpio)
> +{
> +	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
> +	mmc[0].gpio_cd = gpio + 0;
> +	twl4030_mmc_init(mmc);
> +
> +	overo_vmmc1_supply.dev = mmc[0].dev;
> +
> +	return 0;
> +}
> +
>  static struct twl4030_gpio_platform_data overo_gpio_data = {
>  	.gpio_base	= OMAP_MAX_GPIO_LINES,
>  	.irq_base	= TWL4030_GPIO_IRQ_BASE,
>  	.irq_end	= TWL4030_GPIO_IRQ_END,
> +	.setup		= overo_twl_gpio_setup,
>  };
>  
>  static struct twl4030_usb_data overo_usb_data = {
> @@ -287,6 +322,8 @@ static struct regulator_init_data overo_
>  					| REGULATOR_CHANGE_MODE
>  					| REGULATOR_CHANGE_STATUS,
>  	},
> +	.num_consumer_supplies	= 1,
> +	.consumer_supplies	= &overo_vmmc1_supply,
>  };
>  
>  /* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
> @@ -343,23 +380,6 @@ static struct platform_device *overo_dev
>  	&overo_lcd_device,
>  };
>  
> -static struct twl4030_hsmmc_info mmc[] __initdata = {
> -	{
> -		.mmc		= 1,
> -		.wires		= 4,
> -		.gpio_cd	= -EINVAL,
> -		.gpio_wp	= -EINVAL,
> -	},
> -	{
> -		.mmc		= 2,
> -		.wires		= 4,
> -		.gpio_cd	= -EINVAL,
> -		.gpio_wp	= -EINVAL,
> -		.transceiver	= true,
> -	},
> -	{}	/* Terminator */
> -};
> -
>  static void __init overo_init(void)
>  {
>  	overo_i2c_init();
> @@ -367,7 +387,6 @@ static void __init overo_init(void)
>  	omap_board_config = overo_config;
>  	omap_board_config_size = ARRAY_SIZE(overo_config);
>  	omap_serial_init();
> -	twl4030_mmc_init(mmc);
>  	usb_musb_init();
>  	usb_ehci_init();
>  	overo_flash_init();
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -267,10 +267,45 @@  static struct omap_uart_config overo_uar
 	.enabled_uarts	= ((1 << 0) | (1 << 1) | (1 << 2)),
 };
 
+static struct twl4030_hsmmc_info mmc[] = {
+	{
+		.mmc		= 1,
+		.wires		= 4,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= -EINVAL,
+	},
+	{
+		.mmc		= 2,
+		.wires		= 4,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= -EINVAL,
+		.transceiver	= true,
+		.ocr_mask	= 0x00100000,	/* 3.3V */
+	},
+	{}	/* Terminator */
+};
+
+static struct regulator_consumer_supply overo_vmmc1_supply = {
+	.supply			= "vmmc",
+};
+
+static int overo_twl_gpio_setup(struct device *dev,
+		unsigned gpio, unsigned ngpio)
+{
+	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
+	mmc[0].gpio_cd = gpio + 0;
+	twl4030_mmc_init(mmc);
+
+	overo_vmmc1_supply.dev = mmc[0].dev;
+
+	return 0;
+}
+
 static struct twl4030_gpio_platform_data overo_gpio_data = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES,
 	.irq_base	= TWL4030_GPIO_IRQ_BASE,
 	.irq_end	= TWL4030_GPIO_IRQ_END,
+	.setup		= overo_twl_gpio_setup,
 };
 
 static struct twl4030_usb_data overo_usb_data = {
@@ -287,6 +322,8 @@  static struct regulator_init_data overo_
 					| REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
+	.num_consumer_supplies	= 1,
+	.consumer_supplies	= &overo_vmmc1_supply,
 };
 
 /* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
@@ -343,23 +380,6 @@  static struct platform_device *overo_dev
 	&overo_lcd_device,
 };
 
-static struct twl4030_hsmmc_info mmc[] __initdata = {
-	{
-		.mmc		= 1,
-		.wires		= 4,
-		.gpio_cd	= -EINVAL,
-		.gpio_wp	= -EINVAL,
-	},
-	{
-		.mmc		= 2,
-		.wires		= 4,
-		.gpio_cd	= -EINVAL,
-		.gpio_wp	= -EINVAL,
-		.transceiver	= true,
-	},
-	{}	/* Terminator */
-};
-
 static void __init overo_init(void)
 {
 	overo_i2c_init();
@@ -367,7 +387,6 @@  static void __init overo_init(void)
 	omap_board_config = overo_config;
 	omap_board_config_size = ARRAY_SIZE(overo_config);
 	omap_serial_init();
-	twl4030_mmc_init(mmc);
 	usb_musb_init();
 	usb_ehci_init();
 	overo_flash_init();