linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp
@ 2011-02-03 12:45 Rajendra Nayak
  2011-02-03 12:45 ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Rajendra Nayak
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rajendra Nayak @ 2011-02-03 12:45 UTC (permalink / raw)
  To: linux-arm-kernel

This is a short series to fix some, and clean the
existing regulator consumer supply mappings for
the OMAP3430sdp board.

The series is boot tested on the 3430sdp board
and applies on 2.6.38-rc3.

Changes in v2:
Define regulator_consumer_supply as array's
and use ARRAY_SIZE macro to define
num_consumer_supplies

Rajendra Nayak (2):
  omap3sdp: Fix regulator mapping for ads7846 TS controller
  omap3sdp: clean regulator supply mapping in board file

 arch/arm/mach-omap2/board-3430sdp.c |   78 +++++++++++++++++------------------
 1 files changed, 38 insertions(+), 40 deletions(-)

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

* [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller
  2011-02-03 12:45 [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp Rajendra Nayak
@ 2011-02-03 12:45 ` Rajendra Nayak
  2011-02-03 12:45   ` [PATCH v2 2/2] omap3sdp: clean regulator supply mapping in board file Rajendra Nayak
  2011-02-03 12:54   ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Felipe Balbi
  2011-02-16 12:19 ` [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp Rajendra Nayak
  2011-02-17 23:49 ` Tony Lindgren
  2 siblings, 2 replies; 7+ messages in thread
From: Rajendra Nayak @ 2011-02-03 12:45 UTC (permalink / raw)
  To: linux-arm-kernel

On the OMAP3430SDP board, the ads7846 touchscreen controller
is powered by VAUX3 regulator (supplying 2.8v).
Fix this mapping in the board file, and hence prevent
the ads7846 driver init to fail with the below error..

ads7846 spi1.0: unable to get regulator: -19

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/board-3430sdp.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index d4e41ef..8e18f21 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -427,6 +427,11 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = {
 	.irq_line	= 1,
 };
 
+/* ads7846 on SPI */
+static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
+	REGULATOR_SUPPLY("vcc", "spi1.0"),
+};
+
 /*
  * Apply all the fixed voltages since most versions of U-Boot
  * don't bother with that initialization.
@@ -469,6 +474,8 @@ static struct regulator_init_data sdp3430_vaux3 = {
 		.valid_ops_mask		= REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
+	.num_consumer_supplies		= ARRAY_SIZE(sdp3430_vaux3_supplies),
+	.consumer_supplies		= sdp3430_vaux3_supplies,
 };
 
 /* VAUX4 for OMAP VDD_CSI2 (camera) */
-- 
1.7.0.4

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

* [PATCH v2 2/2] omap3sdp: clean regulator supply mapping in board file
  2011-02-03 12:45 ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Rajendra Nayak
@ 2011-02-03 12:45   ` Rajendra Nayak
  2011-02-03 12:54     ` Felipe Balbi
  2011-02-03 12:54   ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Felipe Balbi
  1 sibling, 1 reply; 7+ messages in thread
From: Rajendra Nayak @ 2011-02-03 12:45 UTC (permalink / raw)
  To: linux-arm-kernel

clean the regulator supply mapping data in the 3430sdp
board file (which is spread all over) by moving all
of them together.
Also use the REGULATOR_SUPPLY macro and remove instances
of mapping dev pointers at run time.
Additonally define all regulator_consumer_supply as
array's and use ARRAY_SIZE macro to define
num_consumer_supplies.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/board-3430sdp.c |   71 +++++++++++++++-------------------
 1 files changed, 31 insertions(+), 40 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 8e18f21..7ffac52 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -315,11 +315,6 @@ static struct platform_device sdp3430_dss_device = {
 	},
 };
 
-static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
-	.supply		= "vdda_dac",
-	.dev		= &sdp3430_dss_device.dev,
-};
-
 static struct platform_device *sdp3430_devices[] __initdata = {
 	&sdp3430_dss_device,
 };
@@ -370,18 +365,6 @@ static struct omap2_hsmmc_info mmc[] = {
 	{}	/* Terminator */
 };
 
-static struct regulator_consumer_supply sdp3430_vmmc1_supply = {
-	.supply			= "vmmc",
-};
-
-static struct regulator_consumer_supply sdp3430_vsim_supply = {
-	.supply			= "vmmc_aux",
-};
-
-static struct regulator_consumer_supply sdp3430_vmmc2_supply = {
-	.supply			= "vmmc",
-};
-
 static int sdp3430_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
@@ -392,13 +375,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev,
 	mmc[1].gpio_cd = gpio + 1;
 	omap2_hsmmc_init(mmc);
 
-	/* link regulators to MMC adapters ... we "know" the
-	 * regulators will be set up only *after* we return.
-	 */
-	sdp3430_vmmc1_supply.dev = mmc[0].dev;
-	sdp3430_vsim_supply.dev = mmc[0].dev;
-	sdp3430_vmmc2_supply.dev = mmc[1].dev;
-
 	/* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
 	gpio_request(gpio + 7, "sub_lcd_en_bkl");
 	gpio_direction_output(gpio + 7, 0);
@@ -427,11 +403,34 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = {
 	.irq_line	= 1,
 };
 
+/* regulator consumer mappings */
+
 /* ads7846 on SPI */
 static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
 	REGULATOR_SUPPLY("vcc", "spi1.0"),
 };
 
+static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
+	REGULATOR_SUPPLY("vdda_dac", "omapdss"),
+};
+
+/* VPLL2 for digital video outputs */
+static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
+	REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
+};
+
+static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
+	REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"),
+};
+
+static struct regulator_consumer_supply sdp3430_vsim_supplies[] = {
+	REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.0"),
+};
+
+static struct regulator_consumer_supply sdp3430_vmmc2_supplies[] = {
+	REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"),
+};
+
 /*
  * Apply all the fixed voltages since most versions of U-Boot
  * don't bother with that initialization.
@@ -502,8 +501,8 @@ static struct regulator_init_data sdp3430_vmmc1 = {
 					| REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
-	.num_consumer_supplies	= 1,
-	.consumer_supplies	= &sdp3430_vmmc1_supply,
+	.num_consumer_supplies	= ARRAY_SIZE(sdp3430_vmmc1_supplies),
+	.consumer_supplies	= sdp3430_vmmc1_supplies,
 };
 
 /* VMMC2 for MMC2 card */
@@ -517,8 +516,8 @@ static struct regulator_init_data sdp3430_vmmc2 = {
 		.valid_ops_mask		= REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
-	.num_consumer_supplies	= 1,
-	.consumer_supplies	= &sdp3430_vmmc2_supply,
+	.num_consumer_supplies	= ARRAY_SIZE(sdp3430_vmmc2_supplies),
+	.consumer_supplies	= sdp3430_vmmc2_supplies,
 };
 
 /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
@@ -532,8 +531,8 @@ static struct regulator_init_data sdp3430_vsim = {
 					| REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
-	.num_consumer_supplies	= 1,
-	.consumer_supplies	= &sdp3430_vsim_supply,
+	.num_consumer_supplies	= ARRAY_SIZE(sdp3430_vsim_supplies),
+	.consumer_supplies	= sdp3430_vsim_supplies,
 };
 
 /* VDAC for DSS driving S-Video */
@@ -547,16 +546,8 @@ static struct regulator_init_data sdp3430_vdac = {
 		.valid_ops_mask		= REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
-	.num_consumer_supplies	= 1,
-	.consumer_supplies	= &sdp3430_vdda_dac_supply,
-};
-
-/* VPLL2 for digital video outputs */
-static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
-	{
-		.supply		= "vdds_dsi",
-		.dev		= &sdp3430_dss_device.dev,
-	}
+	.num_consumer_supplies	= ARRAY_SIZE(sdp3430_vdda_dac_supplies),
+	.consumer_supplies	= sdp3430_vdda_dac_supplies,
 };
 
 static struct regulator_init_data sdp3430_vpll2 = {
-- 
1.7.0.4

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

* [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller
  2011-02-03 12:45 ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Rajendra Nayak
  2011-02-03 12:45   ` [PATCH v2 2/2] omap3sdp: clean regulator supply mapping in board file Rajendra Nayak
@ 2011-02-03 12:54   ` Felipe Balbi
  1 sibling, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-02-03 12:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 03, 2011 at 06:15:21PM +0530, Rajendra Nayak wrote:
> On the OMAP3430SDP board, the ads7846 touchscreen controller
> is powered by VAUX3 regulator (supplying 2.8v).
> Fix this mapping in the board file, and hence prevent
> the ads7846 driver init to fail with the below error..
> 
> ads7846 spi1.0: unable to get regulator: -19
> 
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>

Reviewed-by: Felipe Balbi <balbi@ti.com>

> ---
>  arch/arm/mach-omap2/board-3430sdp.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
> index d4e41ef..8e18f21 100644
> --- a/arch/arm/mach-omap2/board-3430sdp.c
> +++ b/arch/arm/mach-omap2/board-3430sdp.c
> @@ -427,6 +427,11 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = {
>  	.irq_line	= 1,
>  };
>  
> +/* ads7846 on SPI */
> +static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
> +	REGULATOR_SUPPLY("vcc", "spi1.0"),
> +};
> +
>  /*
>   * Apply all the fixed voltages since most versions of U-Boot
>   * don't bother with that initialization.
> @@ -469,6 +474,8 @@ static struct regulator_init_data sdp3430_vaux3 = {
>  		.valid_ops_mask		= REGULATOR_CHANGE_MODE
>  					| REGULATOR_CHANGE_STATUS,
>  	},
> +	.num_consumer_supplies		= ARRAY_SIZE(sdp3430_vaux3_supplies),
> +	.consumer_supplies		= sdp3430_vaux3_supplies,
>  };
>  
>  /* VAUX4 for OMAP VDD_CSI2 (camera) */
> -- 
> 1.7.0.4

-- 
balbi

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

* [PATCH v2 2/2] omap3sdp: clean regulator supply mapping in board file
  2011-02-03 12:45   ` [PATCH v2 2/2] omap3sdp: clean regulator supply mapping in board file Rajendra Nayak
@ 2011-02-03 12:54     ` Felipe Balbi
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-02-03 12:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 03, 2011 at 06:15:22PM +0530, Rajendra Nayak wrote:
> clean the regulator supply mapping data in the 3430sdp
> board file (which is spread all over) by moving all
> of them together.
> Also use the REGULATOR_SUPPLY macro and remove instances
> of mapping dev pointers at run time.
> Additonally define all regulator_consumer_supply as
> array's and use ARRAY_SIZE macro to define
> num_consumer_supplies.
> 
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>

Reviewed-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

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

* [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp
  2011-02-03 12:45 [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp Rajendra Nayak
  2011-02-03 12:45 ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Rajendra Nayak
@ 2011-02-16 12:19 ` Rajendra Nayak
  2011-02-17 23:49 ` Tony Lindgren
  2 siblings, 0 replies; 7+ messages in thread
From: Rajendra Nayak @ 2011-02-16 12:19 UTC (permalink / raw)
  To: linux-arm-kernel

Tony,

> -----Original Message-----
> From: Rajendra Nayak [mailto:rnayak at ti.com]
> Sent: Thursday, February 03, 2011 6:15 PM
> To: linux-omap at vger.kernel.org
> Cc: tony at atomide.com; linux-arm-kernel at lists.infradead.org;
balbi at ti.com; Rajendra Nayak
> Subject: [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp
>
> This is a short series to fix some, and clean the
> existing regulator consumer supply mappings for
> the OMAP3430sdp board.
>
> The series is boot tested on the 3430sdp board
> and applies on 2.6.38-rc3.

Any plans to pull these 3430sdp board file cleanup/fixes?

Regards,
Rajendra

>
> Changes in v2:
> Define regulator_consumer_supply as array's
> and use ARRAY_SIZE macro to define
> num_consumer_supplies
>
> Rajendra Nayak (2):
>   omap3sdp: Fix regulator mapping for ads7846 TS controller
>   omap3sdp: clean regulator supply mapping in board file
>
>  arch/arm/mach-omap2/board-3430sdp.c |   78
+++++++++++++++++------------------
>  1 files changed, 38 insertions(+), 40 deletions(-)

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

* [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp
  2011-02-03 12:45 [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp Rajendra Nayak
  2011-02-03 12:45 ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Rajendra Nayak
  2011-02-16 12:19 ` [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp Rajendra Nayak
@ 2011-02-17 23:49 ` Tony Lindgren
  2 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2011-02-17 23:49 UTC (permalink / raw)
  To: linux-arm-kernel

* Rajendra Nayak <rnayak@ti.com> [110203 04:44]:
> This is a short series to fix some, and clean the
> existing regulator consumer supply mappings for
> the OMAP3430sdp board.
> 
> The series is boot tested on the 3430sdp board
> and applies on 2.6.38-rc3.

Adding these to devel-board for the upcoming merge window.

Tony

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

end of thread, other threads:[~2011-02-17 23:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-03 12:45 [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp Rajendra Nayak
2011-02-03 12:45 ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Rajendra Nayak
2011-02-03 12:45   ` [PATCH v2 2/2] omap3sdp: clean regulator supply mapping in board file Rajendra Nayak
2011-02-03 12:54     ` Felipe Balbi
2011-02-03 12:54   ` [PATCH v2 1/2] omap3sdp: Fix regulator mapping for ads7846 TS controller Felipe Balbi
2011-02-16 12:19 ` [PATCH v2 0/2] Fix/Clean regulator consumer mapping for 3430sdp Rajendra Nayak
2011-02-17 23:49 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).