diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 12:43:24 +0900 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 12:43:24 +0900 |
commit | f8c85fe186029b142be5e5f365089875b2d2d64c (patch) | |
tree | fcff116b0ba149f9a5d632f4becad5263dff270a /drivers/regulator/tps51632-regulator.c | |
parent | f4244c68fff39b28235c862d7533c825390e9020 (diff) | |
parent | dbc705183a41f8ae209673fbc555d9923b0ebb7f (diff) | |
download | blackbird-op-linux-f8c85fe186029b142be5e5f365089875b2d2d64c.tar.gz blackbird-op-linux-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.c | 15 |
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"); |