linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] pxa/z2: Add regulator support
@ 2010-06-07  3:59 Marek Vasut
  2010-06-07 11:39 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2010-06-07  3:59 UTC (permalink / raw)
  To: linux-arm-kernel

Register TPS65023 regulator as found in Z2. The Z2 actually contains a TPS65021,
but this chip is apparently compatible.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/z2.c |   71 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index 967e8cb..cceffeb 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -27,6 +27,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 #include <linux/delay.h>
+#include <linux/regulator/machine.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -610,6 +611,75 @@ static inline void z2_spi_init(void) {}
 #endif
 
 /******************************************************************************
+ * Core power regulator
+ ******************************************************************************/
+#if defined(CONFIG_REGULATOR_TPS65023) || \
+	defined(CONFIG_REGULATOR_TPS65023_MODULE)
+static struct regulator_consumer_supply z2_tps65021_consumers[] = {
+	{
+		.supply	= "vcc_core",
+	}
+};
+
+static struct regulator_init_data z2_tps65021_info[] = {
+	{
+		.constraints = {
+			.name		= "vcc_core range",
+			.min_uV		= 800000,
+			.max_uV		= 1600000,
+			.always_on	= 1,
+			.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE,
+		},
+		.consumer_supplies	= z2_tps65021_consumers,
+		.num_consumer_supplies	= ARRAY_SIZE(z2_tps65021_consumers),
+	}, {
+		.constraints = {
+			.name		= "DCDC2",
+			.min_uV		= 3300000,
+			.max_uV		= 3300000,
+			.always_on	= 1,
+		},
+	}, {
+		.constraints = {
+			.name		= "DCDC3",
+			.min_uV		= 1800000,
+			.max_uV		= 1800000,
+			.always_on	= 1,
+		},
+	}, {
+		.constraints = {
+			.name		= "LDO1",
+			.min_uV		= 1000000,
+			.max_uV		= 3150000,
+			.always_on	= 1,
+		},
+	}, {
+		.constraints = {
+			.name		= "LDO2",
+			.min_uV		= 1050000,
+			.max_uV		= 3300000,
+			.always_on	= 1,
+		},
+	}
+};
+
+static struct i2c_board_info __initdata z2_pi2c_board_info[] = {
+	{
+		I2C_BOARD_INFO("tps65023", 0x48),
+		.platform_data	= &z2_tps65021_info,
+	},
+};
+
+static void __init z2_pmic_init(void)
+{
+	pxa27x_set_i2c_power_info(NULL);
+	i2c_register_board_info(1, ARRAY_AND_SIZE(z2_pi2c_board_info));
+}
+#else
+static inline void z2_pmic_init(void) {}
+#endif
+
+/******************************************************************************
  * Machine init
  ******************************************************************************/
 static void __init z2_init(void)
@@ -629,6 +699,7 @@ static void __init z2_init(void)
 	z2_pwm_init();
 	z2_leds_init();
 	z2_keys_init();
+	z2_pmic_init();
 }
 
 MACHINE_START(ZIPIT2, "Zipit Z2")
-- 
1.7.1

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

* [PATCH v2] pxa/z2: Add regulator support
  2010-06-07  3:59 [PATCH v2] pxa/z2: Add regulator support Marek Vasut
@ 2010-06-07 11:39 ` Mark Brown
  2010-06-07 14:56   ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-06-07 11:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 07, 2010 at 05:59:03AM +0200, Marek Vasut wrote:

> +	}, {
> +		.constraints = {
> +			.name		= "LDO1",
> +			.min_uV		= 1000000,
> +			.max_uV		= 3150000,
> +			.always_on	= 1,
> +		},
> +	}, {
> +		.constraints = {
> +			.name		= "LDO2",
> +			.min_uV		= 1050000,
> +			.max_uV		= 3300000,
> +			.always_on	= 1,
> +		},
> +	}

Are you *sure* that the voltages for these regulators can be varied this
much (especailly given that there are no consumers set up)?

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

* [PATCH v2] pxa/z2: Add regulator support
  2010-06-07 11:39 ` Mark Brown
@ 2010-06-07 14:56   ` Marek Vasut
  2010-06-07 15:35     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2010-06-07 14:56 UTC (permalink / raw)
  To: linux-arm-kernel

Dne Po 7. ?ervna 2010 13:39:10 Mark Brown napsal(a):
> On Mon, Jun 07, 2010 at 05:59:03AM +0200, Marek Vasut wrote:
> > +	}, {
> > +		.constraints = {
> > +			.name		= "LDO1",
> > +			.min_uV		= 1000000,
> > +			.max_uV		= 3150000,
> > +			.always_on	= 1,
> > +		},
> > +	}, {
> > +		.constraints = {
> > +			.name		= "LDO2",
> > +			.min_uV		= 1050000,
> > +			.max_uV		= 3300000,
> > +			.always_on	= 1,
> > +		},
> > +	}
> 
> Are you *sure* that the voltages for these regulators can be varied this
> much (especailly given that there are no consumers set up)?

These are not connected so I believe it doesn't matter. Though I'm still 
slightly unfamiliar with the regulator API. Here I should have CCed you, sorry.

Is this the correct way or is there some other way to just shut these off ?

Cheers

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

* [PATCH v2] pxa/z2: Add regulator support
  2010-06-07 14:56   ` Marek Vasut
@ 2010-06-07 15:35     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2010-06-07 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 07, 2010 at 04:56:33PM +0200, Marek Vasut wrote:
> Dne Po 7. ?ervna 2010 13:39:10 Mark Brown napsal(a):

> > Are you *sure* that the voltages for these regulators can be varied this
> > much (especailly given that there are no consumers set up)?

> These are not connected so I believe it doesn't matter. Though I'm still 
> slightly unfamiliar with the regulator API. Here I should have CCed you, sorry.
> 
> Is this the correct way or is there some other way to just shut these off ?

Call regulator_has_full_constraints() in your machine driver, they'll be
shut off at the end of boot when nothing is using them.

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

end of thread, other threads:[~2010-06-07 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-07  3:59 [PATCH v2] pxa/z2: Add regulator support Marek Vasut
2010-06-07 11:39 ` Mark Brown
2010-06-07 14:56   ` Marek Vasut
2010-06-07 15:35     ` Mark Brown

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