aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps51632-regulator.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-10 12:43:24 +0900
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-10 12:43:24 +0900
commitf8c85fe186029b142be5e5f365089875b2d2d64c (patch)
treefcff116b0ba149f9a5d632f4becad5263dff270a /drivers/regulator/tps51632-regulator.c
parentMerge remote-tracking branch 'regulator/topic/tol' into regulator-next (diff)
parentregulator: tps51632: Ensure [base|max]_voltage_uV pdata settings are valid (diff)
downloadlinux-dev-f8c85fe186029b142be5e5f365089875b2d2d64c.tar.xz
linux-dev-f8c85fe186029b142be5e5f365089875b2d2d64c.zip
Merge remote-tracking branch 'regulator/topic/tps516312' into regulator-next
Diffstat (limited to 'drivers/regulator/tps51632-regulator.c')
-rw-r--r--drivers/regulator/tps51632-regulator.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c
index 523b1e5e0b4c..ab21133e6784 100644
--- a/drivers/regulator/tps51632-regulator.c
+++ b/drivers/regulator/tps51632-regulator.c
@@ -236,6 +236,21 @@ static int tps51632_probe(struct i2c_client *client,
return -EINVAL;
}
+ if (pdata->enable_pwm_dvfs) {
+ if ((pdata->base_voltage_uV < TPS51632_MIN_VOLATGE) ||
+ (pdata->base_voltage_uV > TPS51632_MAX_VOLATGE)) {
+ dev_err(&client->dev, "Invalid base_voltage_uV setting\n");
+ return -EINVAL;
+ }
+
+ if ((pdata->max_voltage_uV) &&
+ ((pdata->max_voltage_uV < TPS51632_MIN_VOLATGE) ||
+ (pdata->max_voltage_uV > TPS51632_MAX_VOLATGE))) {
+ dev_err(&client->dev, "Invalid max_voltage_uV setting\n");
+ return -EINVAL;
+ }
+ }
+
tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
if (!tps) {
dev_err(&client->dev, "Memory allocation failed\n");