Skip to contentSkip to conversation

Fix IGEPv2 second MMC channel power supply

PATCH New Marc Zyngier 4 participants 7 messages Nov 14, 2010 – Nov 16, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix IGEPv2 second MMC channel power supply

Commit 72f381ba056 removed an unused regulator entry, but left the second MMC channel (used by the Libertas WLAN mudule) without link to power regulator. This causes the SDIO module to fail being detected.

This patch adds a second supply to the existing MMC1 regulator, and let MMC2 hang off it. With that patch, the second channel is properly detected.

Tested on an IGEPv2 Rev-B.

Cc Enric Balletbo i Serra <[email protected]>
Cc Tony Lindgren <[email protected]>

---
Note that this doesn't fix WLAN itself on 2.6.37-rc1...

 arch/arm/mach-omap2/board-igep0020.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/board-igep0020.c +7 -5
index 5e035a5..b66d114 100644
@@ -257,8 +257,9 @@ static inline void __init igep2_init_smsc911x(void) { }
 static struct omap_board_config_kernel igep2_config[] __initdata = {
 };
 
-static struct regulator_consumer_supply igep2_vmmc1_supply = {
-	.supply		= "vmmc",
+static struct regulator_consumer_supply igep2_vmmc1_supplies[] = {
+	[0] = { .supply		= "vmmc", },
+	[1] = { .supply		= "vmmc", },
 };
 
 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
@@ -272,8 +273,8 @@ static struct regulator_init_data igep2_vmmc1 = {
 					| REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
-	.num_consumer_supplies  = 1,
-	.consumer_supplies      = &igep2_vmmc1_supply,
+	.num_consumer_supplies  = 2,
+	.consumer_supplies      = igep2_vmmc1_supplies,
 };
 
 static struct omap2_hsmmc_info mmc[] = {
@@ -376,7 +377,8 @@ static int igep2_twl_gpio_setup(struct device *dev,
 	 * link regulators to MMC adapters ... we "know" the
 	 * regulators will be set up only *after* we return.
 	 */
-	igep2_vmmc1_supply.dev = mmc[0].dev;
+	igep2_vmmc1_supplies[0].dev = mmc[0].dev;
+	igep2_vmmc1_supplies[1].dev = mmc[1].dev;
 
 	/*
 	 * REVISIT: need ehci-omap hooks for external VBUS
Signature · 1 line
1.7.3.2
#2 lore raw

PATCH 1/1 Fix IGEPv2 second MMC channel power supply

In reply to Marc Zyngier

Hi,

arch/arm/mach-omap2/board-igep0020.c static struct regulator_init_data igep2_vmmc1 = { · line 276

Quoted 7 lines · Marc Zyngier
arch/arm/mach-omap2/board-igep0020.c +1 -2
@@ -272,8 +273,8 @@ static struct regulator_init_data igep2_vmmc1 = {
 					| REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
-	.num_consumer_supplies  = 1,
-	.consumer_supplies      = &igep2_vmmc1_supply,
+	.num_consumer_supplies  = 2,

use ARRAY_SIZE(igep2_vmmc1_supplies),

Signature · 1 line
balbi
#3 lore raw

PATCH 1/1 Fix IGEPv2 second MMC channel power supply

2010/11/14 Felipe Balbi <[email protected]>:

Quoted 14 lines

Hi,

Quoted 7 lines · Marc Zyngier
(quoted diff) +0 -0
@@ -272,8 +273,8 @@ static struct regulator_init_data igep2_vmmc1 = {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | REGULATOR_CHANGE_MODE ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | REGULATOR_CHANGE_STATUS, ? ? ? },
- ? ? .num_consumer_supplies ?= 1,
- ? ? .consumer_supplies ? ? ?= &igep2_vmmc1_supply,
+ ? ? .num_consumer_supplies ?= 2,

use ARRAY_SIZE(igep2_vmmc1_supplies),

Quoted 3 lines

--
balbi

Why we need to define an unexistent regulator in board file ? This should not be done enabling the CONFIG_DUMMY_REGULATOR in your kernel configuration ?

Cheers,
Enric

#4 lore raw

PATCH 1/1 Fix IGEPv2 second MMC channel power supply

Quoted 3 lines · On Sun, 14 Nov 2010 19:11:46 +0100 Enric Balletb? i Serra…

Why we need to define an unexistent regulator in board file ? This should not be done enabling the CONFIG_DUMMY_REGULATOR in your kernel configuration ?

I'm not adding another regulator, but instead simply exposing the fact (or rather my guess) that the same regulator (vmmc1) is powering the two MMC channels. Not having access to the board schematics, I can't tell if that reflects the reality or not.

But using CONFIG_DUMMY_REGULATOR seems the wrong idea to me, as it's just papering over the issue. We should be exposing what's really on the board (a fixed regulator if that's the case).

	M.
Signature · 1 line
I'm the slime oozin' out from your TV set...
#5 lore raw

PATCH 1/1 Fix IGEPv2 second MMC channel power supply

Hi,

2010/11/14 Marc Zyngier <[email protected]>:

Quoted 7 lines
Quoted 3 lines · On Sun, 14 Nov 2010 19:11:46 +0100 Enric Balletb? i Serra…

Why we need to define an unexistent regulator in board file ? This should not be done enabling the CONFIG_DUMMY_REGULATOR in your kernel configuration ??

Quoted 8 lines

I'm not adding another regulator, but instead simply exposing the fact (or rather my guess) that the same regulator (vmmc1) is powering the two MMC channels. Not having access to the board schematics, I can't tell if that reflects the reality or not.

But using CONFIG_DUMMY_REGULATOR seems the wrong idea to me, as it's just papering over the issue. We should be exposing what's really on the board (a fixed regulator if that's the case).

So the DUMMY_REGULATOR is only a workaround when a regulator is not defined and shouldn't be used ? Sorry if this is a stupid question but regulator interface is not too clear for me.

The reality is this :

------- --------

| 3V3 |   | 1V8 |
 -------    --------
    |          |
 -----------------
|   WIFI/BT  |
 -----------------
        | ( MMC2  at 1V8 )

----------------
| OMAP |
---------------

3V3 is a fixed regulator
1V8 is a fixed regulator (VIO from TWL4030)

So, which you think is the right solution ?

Cheers,
Enric

#6 lore raw

PATCH 1/1 Fix IGEPv2 second MMC channel power supply

On Mon, 15 Nov 2010 09:32:22 +0100
Enric Balletb? i Serra <[email protected]> wrote:

Hi Enric,

Quoted 4 lines

So the DUMMY_REGULATOR is only a workaround when a regulator is not defined and shouldn't be used ? Sorry if this is a stupid question but regulator interface is not too clear for me.

My understanding is that DUMMY_REGULATOR kicks in when the regulator setup is incomplete, and when it's better to fix things behind the user's back rather than leaving him with a broken device.

Quoted 10 lines

The reality is this :

------- --------

| 3V3 |   | 1V8 |
 -------    --------
    |          |
 -----------------
|   WIFI/BT  |
 -----------------
        | ( MMC2  at 1V8 )
Quoted 8 lines

----------------
| OMAP |
---------------

3V3 is a fixed regulator
1V8 is a fixed regulator (VIO from TWL4030)

So, which you think is the right solution ?

I think we should provide a fixed regulator to the device, wired to the .vio field of twl4030_platform_data. I'll submit a patch later today, once I get a chance to test it on my board.

Cheers,

	M.
Signature · 1 line
I'm the slime oozin' out from your TV set...