public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: tps6586x: fix millivolt return values and SM2 table
@ 2010-07-30 19:58 Mike Rapoport
  2010-07-30 20:20 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Rapoport @ 2010-07-30 19:58 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Mark Brown, linux-kernel, Gary King

From: Gary King <gking@nvidia.com>

Hi Liam,
Below are bugfixes for the tps6586x spotted by Gary King.
Please add this patch to your regulator tree.
---

list_voltage and get_voltage are expected to return values in
microvolts, not millivolts

also, the SM2 regulator runs at a higher voltage (3-4.55V) than
the other regulators; add a new table for this regulator

Signed-off-by: Gary King <gking@nvidia.com>
Acked-by: Mike Rapoport <mike@compulab.co.il>
---
 drivers/regulator/tps6586x-regulator.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index 76cc41e..3c2eee8 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -80,7 +80,7 @@ static int tps6586x_ldo_list_voltage(struct regulator_dev *rdev,
 {
 	struct tps6586x_regulator *info = rdev_get_drvdata(rdev);
 
-	return info->voltages[selector];
+	return info->voltages[selector] * 1000;
 }
 
 
@@ -137,7 +137,7 @@ static int tps6586x_ldo_get_voltage(struct regulator_dev *rdev)
 	if (val > ri->desc.n_voltages)
 		BUG();
 
-	return ri->voltages[val];
+	return ri->voltages[val] * 1000;
 }
 
 static int tps6586x_dvm_set_voltage(struct regulator_dev *rdev,
@@ -217,6 +217,13 @@ static int tps6586x_ldo4_voltages[] = {
 	2300, 2325, 2350, 2375, 2400, 2425, 2450, 2475,
 };
 
+static int tps6586x_sm2_voltages[] = {
+	3000, 3050, 3100, 3150, 3200, 3250, 3300, 3350,
+	3400, 3450, 3500, 3550, 3600, 3650, 3700, 3750,
+	3800, 3850, 3900, 3950, 4000, 4050, 4100, 4150,
+	4200, 4250, 4300, 4350, 4400, 4450, 4500, 4550,
+};
+
 static int tps6586x_dvm_voltages[] = {
 	 725,  750,  775,  800,  825,  850,  875,  900,
 	 925,  950,  975, 1000, 1025, 1050, 1075, 1100,
@@ -265,7 +272,7 @@ static struct tps6586x_regulator tps6586x_regulator[] = {
 	TPS6586X_LDO(LDO_9, ldo, SUPPLYV6, 3, 3, ENE, 7, ENE, 7),
 	TPS6586X_LDO(LDO_RTC, ldo, SUPPLYV4, 3, 3, ENE, 7, ENE, 7),
 	TPS6586X_LDO(LDO_1, dvm, SUPPLYV1, 0, 5, ENC, 1, END, 1),
-	TPS6586X_LDO(SM_2, dvm, SUPPLYV2, 0, 5, ENC, 1, END, 1),
+	TPS6586X_LDO(SM_2, sm2, SUPPLYV2, 0, 5, ENC, 1, END, 1),
 
 	TPS6586X_DVM(LDO_2, dvm, LDO2BV1, 0, 5, ENA, 3, ENB, 3, VCC2, 6),
 	TPS6586X_DVM(LDO_4, ldo4, LDO4V1, 0, 5, ENC, 3, END, 3, VCC1, 6),
-- 
1.7.0.4


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

* Re: [PATCH] regulator: tps6586x: fix millivolt return values and SM2 table
  2010-07-30 19:58 [PATCH] regulator: tps6586x: fix millivolt return values and SM2 table Mike Rapoport
@ 2010-07-30 20:20 ` Mark Brown
  2010-08-02 10:09   ` Liam Girdwood
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2010-07-30 20:20 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: Liam Girdwood, linux-kernel, Gary King

On Fri, Jul 30, 2010 at 10:58:58PM +0300, Mike Rapoport wrote:
> From: Gary King <gking@nvidia.com>
> 
> Hi Liam,
> Below are bugfixes for the tps6586x spotted by Gary King.
> Please add this patch to your regulator tree.

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

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

* Re: [PATCH] regulator: tps6586x: fix millivolt return values and SM2 table
  2010-07-30 20:20 ` Mark Brown
@ 2010-08-02 10:09   ` Liam Girdwood
  0 siblings, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2010-08-02 10:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: Mike Rapoport, linux-kernel, Gary King

On Fri, 2010-07-30 at 13:20 -0700, Mark Brown wrote:
> On Fri, Jul 30, 2010 at 10:58:58PM +0300, Mike Rapoport wrote:
> > From: Gary King <gking@nvidia.com>
> > 
> > Hi Liam,
> > Below are bugfixes for the tps6586x spotted by Gary King.
> > Please add this patch to your regulator tree.
> 
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> --

Applied.

Thanks.

Liam
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk


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

end of thread, other threads:[~2010-08-02 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 19:58 [PATCH] regulator: tps6586x: fix millivolt return values and SM2 table Mike Rapoport
2010-07-30 20:20 ` Mark Brown
2010-08-02 10:09   ` Liam Girdwood

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