lkml.org 
[lkml]   [2012]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] regulator: Complain if a voltage range is specified but can't be used
Date
It doesn't make much sense to specify a range of voltages consumers can
use if they haven't been given permission to change the voltage. Log if
this happens, probably the user forgot to specify CHANGE_VOLTAGE.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/regulator/core.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 68acc2f..5ba25c0 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -805,6 +805,11 @@ static void print_constraints(struct regulator_dev *rdev)
count += sprintf(buf + count, "standby");

rdev_info(rdev, "%s\n", buf);
+
+ if ((constraints->min_uV != constraints->max_uV) &&
+ !(constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE))
+ rdev_warn(rdev,
+ "Voltage range but no REGULATOR_CHANGE_VOLTAGE\n");
}

static int machine_constraints_voltage(struct regulator_dev *rdev,
--
1.7.9.rc1


\
 
 \ /
  Last update: 2012-02-09 14:45    [W:0.031 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site