public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: twl-regulator: fix n_voltages for twl6030 variable LDOs
@ 2011-05-27 19:25 Colin Cross
  2011-05-28 17:56 ` Mark Brown
  2011-05-30 12:51 ` Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Cross @ 2011-05-27 19:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Colin Cross, Liam Girdwood, Mark Brown

The n_voltages initializer for the TWL6030_ADJUSTABLE_LDO macro is
off by one, causing the the highest supported voltage to be
unreachable.  Setting the machine constraints to only allow the
highest voltage causes errors:

machine_constraints_voltage: VAUX3_6030: unsupportable voltage constraints
twl_reg twl_reg.39: can't register VAUX3_6030, -22
twl_reg: probe of twl_reg.39 failed with error -22

This patch fixes the off by one error.  Tested by setting
VAUX3_6030 to 3.3V.

Signed-off-by: Colin Cross <ccross@android.com>
---
 drivers/regulator/twl-regulator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 6a29285..afd9c7e 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -520,7 +520,7 @@ static struct regulator_ops twl6030_fixed_resource = {
 	.desc = { \
 		.name = #label, \
 		.id = TWL6030_REG_##label, \
-		.n_voltages = (max_mVolts - min_mVolts)/100, \
+		.n_voltages = (max_mVolts - min_mVolts)/100 + 1, \
 		.ops = &twl6030ldo_ops, \
 		.type = REGULATOR_VOLTAGE, \
 		.owner = THIS_MODULE, \
-- 
1.7.4.1


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

* Re: [PATCH] regulator: twl-regulator: fix n_voltages for twl6030 variable LDOs
  2011-05-27 19:25 [PATCH] regulator: twl-regulator: fix n_voltages for twl6030 variable LDOs Colin Cross
@ 2011-05-28 17:56 ` Mark Brown
  2011-05-30 12:51 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-05-28 17:56 UTC (permalink / raw)
  To: Colin Cross; +Cc: linux-kernel, Liam Girdwood

On Fri, May 27, 2011 at 12:25:27PM -0700, Colin Cross wrote:
> The n_voltages initializer for the TWL6030_ADJUSTABLE_LDO macro is
> off by one, causing the the highest supported voltage to be
> unreachable.  Setting the machine constraints to only allow the
> highest voltage causes errors:

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

* Re: [PATCH] regulator: twl-regulator: fix n_voltages for twl6030 variable LDOs
  2011-05-27 19:25 [PATCH] regulator: twl-regulator: fix n_voltages for twl6030 variable LDOs Colin Cross
  2011-05-28 17:56 ` Mark Brown
@ 2011-05-30 12:51 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-05-30 12:51 UTC (permalink / raw)
  To: Colin Cross; +Cc: linux-kernel, Mark Brown

On Fri, 2011-05-27 at 12:25 -0700, Colin Cross wrote:
> The n_voltages initializer for the TWL6030_ADJUSTABLE_LDO macro is
> off by one, causing the the highest supported voltage to be
> unreachable.  Setting the machine constraints to only allow the
> highest voltage causes errors:
> 
> machine_constraints_voltage: VAUX3_6030: unsupportable voltage constraints
> twl_reg twl_reg.39: can't register VAUX3_6030, -22
> twl_reg: probe of twl_reg.39 failed with error -22
> 
> This patch fixes the off by one error.  Tested by setting
> VAUX3_6030 to 3.3V.
> 
> Signed-off-by: Colin Cross <ccross@android.com>
> ---
>  drivers/regulator/twl-regulator.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
> index 6a29285..afd9c7e 100644
> --- a/drivers/regulator/twl-regulator.c
> +++ b/drivers/regulator/twl-regulator.c
> @@ -520,7 +520,7 @@ static struct regulator_ops twl6030_fixed_resource = {
>  	.desc = { \
>  		.name = #label, \
>  		.id = TWL6030_REG_##label, \
> -		.n_voltages = (max_mVolts - min_mVolts)/100, \
> +		.n_voltages = (max_mVolts - min_mVolts)/100 + 1, \
>  		.ops = &twl6030ldo_ops, \
>  		.type = REGULATOR_VOLTAGE, \
>  		.owner = THIS_MODULE, \

Applied.

Thanks

Liam


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

end of thread, other threads:[~2011-05-30 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 19:25 [PATCH] regulator: twl-regulator: fix n_voltages for twl6030 variable LDOs Colin Cross
2011-05-28 17:56 ` Mark Brown
2011-05-30 12:51 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox