* [PATCH] regulator: twl: Convert twl4030ldo_ops to get_voltage_sel
@ 2013-02-16 2:09 Axel Lin
2013-03-01 8:04 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2013-02-16 2:09 UTC (permalink / raw)
To: Mark Brown; +Cc: Tero Kristo, Aaro Koskinen, Liam Girdwood, linux-kernel
This fixes an inconsistent behavior between list_voltage() and get_voltage()
because current implementation of get_voltage() does not check the case
IS_UNSUP() is true.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/twl-regulator.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 683d314..d62604c0 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -465,24 +465,23 @@ twl4030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
selector);
}
-static int twl4030ldo_get_voltage(struct regulator_dev *rdev)
+static int twl4030ldo_get_voltage_sel(struct regulator_dev *rdev)
{
struct twlreg_info *info = rdev_get_drvdata(rdev);
- int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER,
- VREG_VOLTAGE);
+ int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE);
if (vsel < 0)
return vsel;
vsel &= info->table_len - 1;
- return LDO_MV(info->table[vsel]) * 1000;
+ return vsel;
}
static struct regulator_ops twl4030ldo_ops = {
.list_voltage = twl4030ldo_list_voltage,
.set_voltage_sel = twl4030ldo_set_voltage_sel,
- .get_voltage = twl4030ldo_get_voltage,
+ .get_voltage_sel = twl4030ldo_get_voltage_sel,
.enable = twl4030reg_enable,
.disable = twl4030reg_disable,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: twl: Convert twl4030ldo_ops to get_voltage_sel
2013-02-16 2:09 [PATCH] regulator: twl: Convert twl4030ldo_ops to get_voltage_sel Axel Lin
@ 2013-03-01 8:04 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-03-01 8:04 UTC (permalink / raw)
To: Axel Lin; +Cc: Tero Kristo, Aaro Koskinen, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 251 bytes --]
On Sat, Feb 16, 2013 at 10:09:54AM +0800, Axel Lin wrote:
> This fixes an inconsistent behavior between list_voltage() and get_voltage()
> because current implementation of get_voltage() does not check the case
> IS_UNSUP() is true.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-01 8:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-16 2:09 [PATCH] regulator: twl: Convert twl4030ldo_ops to get_voltage_sel Axel Lin
2013-03-01 8:04 ` 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).