diff options
-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, | |||
236 | return -EINVAL; | 236 | return -EINVAL; |
237 | } | 237 | } |
238 | 238 | ||
239 | if (pdata->enable_pwm_dvfs) { | ||
240 | if ((pdata->base_voltage_uV < TPS51632_MIN_VOLATGE) || | ||
241 | (pdata->base_voltage_uV > TPS51632_MAX_VOLATGE)) { | ||
242 | dev_err(&client->dev, "Invalid base_voltage_uV setting\n"); | ||
243 | return -EINVAL; | ||
244 | } | ||
245 | |||
246 | if ((pdata->max_voltage_uV) && | ||
247 | ((pdata->max_voltage_uV < TPS51632_MIN_VOLATGE) || | ||
248 | (pdata->max_voltage_uV > TPS51632_MAX_VOLATGE))) { | ||
249 | dev_err(&client->dev, "Invalid max_voltage_uV setting\n"); | ||
250 | return -EINVAL; | ||
251 | } | ||
252 | } | ||
253 | |||
239 | tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); | 254 | tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); |
240 | if (!tps) { | 255 | if (!tps) { |
241 | dev_err(&client->dev, "Memory allocation failed\n"); | 256 | dev_err(&client->dev, "Memory allocation failed\n"); |