.set_ramp_delay = tps51632_dcdc_set_ramp_delay,
};
-static int __devinit tps51632_init_dcdc(struct tps51632_chip *tps,
+static int tps51632_init_dcdc(struct tps51632_chip *tps,
struct tps51632_regulator_platform_data *pdata)
{
int ret;
.cache_type = REGCACHE_RBTREE,
};
-static int __devinit tps51632_probe(struct i2c_client *client,
+static int tps51632_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct tps51632_regulator_platform_data *pdata;
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");
return 0;
}
-static int __devexit tps51632_remove(struct i2c_client *client)
+static int tps51632_remove(struct i2c_client *client)
{
struct tps51632_chip *tps = i2c_get_clientdata(client);
.owner = THIS_MODULE,
},
.probe = tps51632_probe,
- .remove = __devexit_p(tps51632_remove),
+ .remove = tps51632_remove,
.id_table = tps51632_id,
};