All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-14 11:34 ` Marc Zyngier
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2010-11-14 11:34 UTC (permalink / raw)
  To: linux-omap; +Cc: Enric Balletbo i Serra, Tony Lindgren, linux-arm-kernel

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.

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
---
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(-)

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 5e035a5..b66d114 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -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
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-14 11:34 ` Marc Zyngier
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2010-11-14 11:34 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
---
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(-)

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 5e035a5..b66d114 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -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
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] Fix IGEPv2 second MMC channel power supply
  2010-11-14 11:34 ` Marc Zyngier
@ 2010-11-14 14:25   ` Sergei Shtylyov
  -1 siblings, 0 replies; 14+ messages in thread
From: Sergei Shtylyov @ 2010-11-14 14:25 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-omap, Enric Balletbo i Serra, Tony Lindgren, linux-arm-kernel

Hello.

On 14-11-2010 14:34, Marc Zyngier wrote:

> Commit 72f381ba056 removed an unused regulator entry, but left

    Linus has aksed to also specify the commit summary in parentheses.

> Signed-off-by: Marc Zyngier<maz@misterjones.org>
> Cc: Enric Balletbo i Serra<eballetbo@gmail.com>
> Cc: Tony Lindgren<tony@atomide.com>

WBR, Sergei

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-14 14:25   ` Sergei Shtylyov
  0 siblings, 0 replies; 14+ messages in thread
From: Sergei Shtylyov @ 2010-11-14 14:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 14-11-2010 14:34, Marc Zyngier wrote:

> Commit 72f381ba056 removed an unused regulator entry, but left

    Linus has aksed to also specify the commit summary in parentheses.

> Signed-off-by: Marc Zyngier<maz@misterjones.org>
> Cc: Enric Balletbo i Serra<eballetbo@gmail.com>
> Cc: Tony Lindgren<tony@atomide.com>

WBR, Sergei

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Fix IGEPv2 second MMC channel power supply
  2010-11-14 11:34 ` Marc Zyngier
@ 2010-11-14 15:14   ` Felipe Balbi
  -1 siblings, 0 replies; 14+ messages in thread
From: Felipe Balbi @ 2010-11-14 15:14 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-omap, linux-arm-kernel, Enric Balletbo i Serra, Tony Lindgren

Hi,

On Sun, 14 Nov 2010 11:34:12 +0000, Marc Zyngier <maz@misterjones.org>
wrote:
> @@ -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),

-- 
balbi

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-14 15:14   ` Felipe Balbi
  0 siblings, 0 replies; 14+ messages in thread
From: Felipe Balbi @ 2010-11-14 15:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, 14 Nov 2010 11:34:12 +0000, Marc Zyngier <maz@misterjones.org>
wrote:
> @@ -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),

-- 
balbi

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Fix IGEPv2 second MMC channel power supply
  2010-11-14 15:14   ` Felipe Balbi
@ 2010-11-14 18:11     ` Enric Balletbò i Serra
  -1 siblings, 0 replies; 14+ messages in thread
From: Enric Balletbò i Serra @ 2010-11-14 18:11 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Marc Zyngier, linux-omap, linux-arm-kernel, Tony Lindgren

2010/11/14 Felipe Balbi <me@felipebalbi.com>:
> Hi,
>
> On Sun, 14 Nov 2010 11:34:12 +0000, Marc Zyngier <maz@misterjones.org>
> wrote:
>> @@ -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),
>
> --
> 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
--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-14 18:11     ` Enric Balletbò i Serra
  0 siblings, 0 replies; 14+ messages in thread
From: Enric Balletbò i Serra @ 2010-11-14 18:11 UTC (permalink / raw)
  To: linux-arm-kernel

2010/11/14 Felipe Balbi <me@felipebalbi.com>:
> Hi,
>
> On Sun, 14 Nov 2010 11:34:12 +0000, Marc Zyngier <maz@misterjones.org>
> wrote:
>> @@ -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),
>
> --
> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Fix IGEPv2 second MMC channel power supply
  2010-11-14 18:11     ` Enric Balletbò i Serra
@ 2010-11-14 18:52       ` Marc Zyngier
  -1 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2010-11-14 18:52 UTC (permalink / raw)
  To: Enric Balletbò i Serra
  Cc: Felipe Balbi, linux-omap, linux-arm-kernel, Tony Lindgren

On Sun, 14 Nov 2010 19:11:46 +0100
Enric Balletbò i Serra <eballetbo@gmail.com> wrote:

> 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.
-- 
I'm the slime oozin' out from your TV set...
--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-14 18:52       ` Marc Zyngier
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2010-11-14 18:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 14 Nov 2010 19:11:46 +0100
Enric Balletb? i Serra <eballetbo@gmail.com> wrote:

> 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.
-- 
I'm the slime oozin' out from your TV set...

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Fix IGEPv2 second MMC channel power supply
  2010-11-14 18:52       ` Marc Zyngier
@ 2010-11-15  8:32         ` Enric Balletbò i Serra
  -1 siblings, 0 replies; 14+ messages in thread
From: Enric Balletbò i Serra @ 2010-11-15  8:32 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Felipe Balbi, linux-omap, linux-arm-kernel, Tony Lindgren

Hi,

2010/11/14 Marc Zyngier <maz@misterjones.org>:
> On Sun, 14 Nov 2010 19:11:46 +0100
> Enric Balletbò i Serra <eballetbo@gmail.com> wrote:
>
>> 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).

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
--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-15  8:32         ` Enric Balletbò i Serra
  0 siblings, 0 replies; 14+ messages in thread
From: Enric Balletbò i Serra @ 2010-11-15  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

2010/11/14 Marc Zyngier <maz@misterjones.org>:
> On Sun, 14 Nov 2010 19:11:46 +0100
> Enric Balletb? i Serra <eballetbo@gmail.com> wrote:
>
>> 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).

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Fix IGEPv2 second MMC channel power supply
  2010-11-15  8:32         ` Enric Balletbò i Serra
@ 2010-11-16  9:20           ` Marc Zyngier
  -1 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2010-11-16  9:20 UTC (permalink / raw)
  To: Enric Balletbò i Serra
  Cc: Felipe Balbi, linux-omap, linux-arm-kernel, Tony Lindgren

On Mon, 15 Nov 2010 09:32:22 +0100
Enric Balletbò i Serra <eballetbo@gmail.com> wrote:

Hi Enric,
> 
> 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.

> 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 ?

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.
-- 
I'm the slime oozin' out from your TV set...
--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] Fix IGEPv2 second MMC channel power supply
@ 2010-11-16  9:20           ` Marc Zyngier
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Zyngier @ 2010-11-16  9:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 15 Nov 2010 09:32:22 +0100
Enric Balletb? i Serra <eballetbo@gmail.com> wrote:

Hi Enric,
> 
> 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.

> 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 ?

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.
-- 
I'm the slime oozin' out from your TV set...

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-11-16  9:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-14 11:34 [PATCH] Fix IGEPv2 second MMC channel power supply Marc Zyngier
2010-11-14 11:34 ` Marc Zyngier
2010-11-14 14:25 ` Sergei Shtylyov
2010-11-14 14:25   ` Sergei Shtylyov
2010-11-14 15:14 ` Felipe Balbi
2010-11-14 15:14   ` Felipe Balbi
2010-11-14 18:11   ` Enric Balletbò i Serra
2010-11-14 18:11     ` Enric Balletbò i Serra
2010-11-14 18:52     ` Marc Zyngier
2010-11-14 18:52       ` Marc Zyngier
2010-11-15  8:32       ` Enric Balletbò i Serra
2010-11-15  8:32         ` Enric Balletbò i Serra
2010-11-16  9:20         ` Marc Zyngier
2010-11-16  9:20           ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.