* [PATCH] regulator: max1586 - improve the logic of choosing selector
@ 2010-08-18 3:37 Axel Lin
2010-08-18 8:42 ` Mark Brown
2010-08-18 18:04 ` Robert Jarzmik
0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2010-08-18 3:37 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Robert Jarzmik
A little bit improvement in the logic of choosing selector.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/max1586.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c
index 8867c27..559cfa2 100644
--- a/drivers/regulator/max1586.c
+++ b/drivers/regulator/max1586.c
@@ -121,14 +121,14 @@ static int max1586_v6_set(struct regulator_dev *rdev, int min_uV, int max_uV)
if (max_uV < MAX1586_V6_MIN_UV || max_uV > MAX1586_V6_MAX_UV)
return -EINVAL;
- if (min_uV >= 3000000)
- selector = 3;
- if (min_uV < 3000000)
- selector = 2;
- if (min_uV < 2500000)
- selector = 1;
if (min_uV < 1800000)
selector = 0;
+ else if (min_uV < 2500000)
+ selector = 1;
+ else if (min_uV < 3000000)
+ selector = 2;
+ else if (min_uV >= 3000000)
+ selector = 3;
if (max1586_v6_calc_voltage(selector) > max_uV)
return -EINVAL;
--
1.7.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: max1586 - improve the logic of choosing selector
2010-08-18 3:37 [PATCH] regulator: max1586 - improve the logic of choosing selector Axel Lin
@ 2010-08-18 8:42 ` Mark Brown
2010-08-18 13:29 ` Liam Girdwood
2010-08-18 18:04 ` Robert Jarzmik
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-08-18 8:42 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood, Robert Jarzmik
On Wed, Aug 18, 2010 at 11:37:21AM +0800, Axel Lin wrote:
> A little bit improvement in the logic of choosing selector.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: max1586 - improve the logic of choosing selector
2010-08-18 8:42 ` Mark Brown
@ 2010-08-18 13:29 ` Liam Girdwood
0 siblings, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2010-08-18 13:29 UTC (permalink / raw)
To: Mark Brown; +Cc: Axel Lin, linux-kernel, Robert Jarzmik
On Wed, 2010-08-18 at 09:42 +0100, Mark Brown wrote:
> On Wed, Aug 18, 2010 at 11:37:21AM +0800, Axel Lin wrote:
> > A little bit improvement in the logic of choosing selector.
> >
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> 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] 4+ messages in thread
* Re: [PATCH] regulator: max1586 - improve the logic of choosing selector
2010-08-18 3:37 [PATCH] regulator: max1586 - improve the logic of choosing selector Axel Lin
2010-08-18 8:42 ` Mark Brown
@ 2010-08-18 18:04 ` Robert Jarzmik
1 sibling, 0 replies; 4+ messages in thread
From: Robert Jarzmik @ 2010-08-18 18:04 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood, Mark Brown
Axel Lin <axel.lin@gmail.com> writes:
> A little bit improvement in the logic of choosing selector.
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cheers.
--
Robert
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-18 18:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-18 3:37 [PATCH] regulator: max1586 - improve the logic of choosing selector Axel Lin
2010-08-18 8:42 ` Mark Brown
2010-08-18 13:29 ` Liam Girdwood
2010-08-18 18:04 ` Robert Jarzmik
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).