* [PATCH 2.6.30] regulator: Fix default constraints for fixed voltage regulators
@ 2009-04-28 10:09 Mark Brown
2009-04-28 13:23 ` Liam Girdwood
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2009-04-28 10:09 UTC (permalink / raw)
To: Liam Girdwood; +Cc: linux-kernel, David Brownell, Mark Brown
Default voltage constraints were being provided for fixed voltage
regulator where board constraints were not provided but these constraints
used INT_MIN as the default minimum voltage which is not a valid value
since it is less than zero. Use 1uV instead.
Also set the default values we set in the constraints themselves since
otherwise the max_uV constraint we determine will not be stored in the
actual constraint strucutre and will therefore not be used.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/regulator/core.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 01f7702..dccf94d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -703,10 +703,13 @@ static int set_machine_constraints(struct regulator_dev *rdev,
int cmin = constraints->min_uV;
int cmax = constraints->max_uV;
- /* it's safe to autoconfigure fixed-voltage supplies */
+ /* it's safe to autoconfigure fixed-voltage supplies
+ and the constraints are used by list_voltage. */
if (count == 1 && !cmin) {
- cmin = INT_MIN;
+ cmin = 1;
cmax = INT_MAX;
+ constraints->min_uV = cmin;
+ constraints->max_uV = cmax;
}
/* voltage constraints are optional */
--
1.6.2.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.30] regulator: Fix default constraints for fixed voltage regulators
2009-04-28 10:09 [PATCH 2.6.30] regulator: Fix default constraints for fixed voltage regulators Mark Brown
@ 2009-04-28 13:23 ` Liam Girdwood
0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2009-04-28 13:23 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, David Brownell
On Tue, 2009-04-28 at 11:09 +0100, Mark Brown wrote:
> Default voltage constraints were being provided for fixed voltage
> regulator where board constraints were not provided but these constraints
> used INT_MIN as the default minimum voltage which is not a valid value
> since it is less than zero. Use 1uV instead.
>
> Also set the default values we set in the constraints themselves since
> otherwise the max_uV constraint we determine will not be stored in the
> actual constraint strucutre and will therefore not be used.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> drivers/regulator/core.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
Applied.
Thanks
Liam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-28 13:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-28 10:09 [PATCH 2.6.30] regulator: Fix default constraints for fixed voltage regulators Mark Brown
2009-04-28 13:23 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®