mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
regulator: pass additional of_node to regulator_register()
With device tree support for regulators, its needed that the regulator_dev->dev device has the right of_node attached. To be able to do this add an additional parameter to the regulator_register() api, wherein the dt-adapted driver can then pass this additional info onto the regulator core. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
committed by
Mark Brown
parent
cef49102c1
commit
2c043bcbf2
@@ -427,7 +427,7 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
|
||||
|
||||
/* replace driver_data with info */
|
||||
info->regulator = regulator_register(&info->desc, &pdev->dev,
|
||||
pdata, info);
|
||||
pdata, info, NULL);
|
||||
if (IS_ERR(info->regulator)) {
|
||||
dev_err(&pdev->dev, "failed to register regulator %s\n",
|
||||
info->desc.name);
|
||||
|
||||
@@ -188,7 +188,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
|
||||
ri->pdev = pdev;
|
||||
|
||||
rdev = regulator_register(&ri->desc, &pdev->dev,
|
||||
pdev->dev.platform_data, ri);
|
||||
pdev->dev.platform_data, ri, NULL);
|
||||
if (IS_ERR(rdev)) {
|
||||
dev_err(&pdev->dev, "Failed to register regulator %s\n",
|
||||
ri->desc.name);
|
||||
|
||||
@@ -634,7 +634,7 @@ static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
|
||||
rdev = regulator_register(&ab3100_regulator_desc[i],
|
||||
&pdev->dev,
|
||||
&plfdata->reg_constraints[i],
|
||||
reg);
|
||||
reg, NULL);
|
||||
|
||||
if (IS_ERR(rdev)) {
|
||||
err = PTR_ERR(rdev);
|
||||
|
||||
@@ -822,7 +822,7 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
|
||||
|
||||
/* register regulator with framework */
|
||||
info->regulator = regulator_register(&info->desc, &pdev->dev,
|
||||
&pdata->regulator[i], info);
|
||||
&pdata->regulator[i], info, NULL);
|
||||
if (IS_ERR(info->regulator)) {
|
||||
err = PTR_ERR(info->regulator);
|
||||
dev_err(&pdev->dev, "failed to register regulator %s\n",
|
||||
|
||||
@@ -233,7 +233,7 @@ static int __devinit ad5398_probe(struct i2c_client *client,
|
||||
chip->current_mask = (chip->current_level - 1) << chip->current_offset;
|
||||
|
||||
chip->rdev = regulator_register(&ad5398_reg, &client->dev,
|
||||
init_data, chip);
|
||||
init_data, chip, NULL);
|
||||
if (IS_ERR(chip->rdev)) {
|
||||
ret = PTR_ERR(chip->rdev);
|
||||
dev_err(&client->dev, "failed to register %s %s\n",
|
||||
|
||||
@@ -107,7 +107,7 @@ static int __init bq24022_probe(struct platform_device *pdev)
|
||||
ret = gpio_direction_output(pdata->gpio_nce, 1);
|
||||
|
||||
bq24022 = regulator_register(&bq24022_desc, &pdev->dev,
|
||||
pdata->init_data, pdata);
|
||||
pdata->init_data, pdata, NULL);
|
||||
if (IS_ERR(bq24022)) {
|
||||
dev_dbg(&pdev->dev, "couldn't register regulator\n");
|
||||
ret = PTR_ERR(bq24022);
|
||||
|
||||
@@ -2637,7 +2637,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
|
||||
*/
|
||||
struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
|
||||
struct device *dev, const struct regulator_init_data *init_data,
|
||||
void *driver_data)
|
||||
void *driver_data, struct device_node *of_node)
|
||||
{
|
||||
static atomic_t regulator_no = ATOMIC_INIT(0);
|
||||
struct regulator_dev *rdev;
|
||||
@@ -2696,6 +2696,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
|
||||
|
||||
/* register with sysfs */
|
||||
rdev->dev.class = ®ulator_class;
|
||||
rdev->dev.of_node = of_node;
|
||||
rdev->dev.parent = dev;
|
||||
dev_set_name(&rdev->dev, "regulator.%d",
|
||||
atomic_inc_return(®ulator_no) - 1);
|
||||
|
||||
@@ -537,7 +537,7 @@ static int __devinit da903x_regulator_probe(struct platform_device *pdev)
|
||||
ri->desc.ops = &da9030_regulator_ldo1_15_ops;
|
||||
|
||||
rdev = regulator_register(&ri->desc, &pdev->dev,
|
||||
pdev->dev.platform_data, ri);
|
||||
pdev->dev.platform_data, ri, NULL);
|
||||
if (IS_ERR(rdev)) {
|
||||
dev_err(&pdev->dev, "failed to register regulator %s\n",
|
||||
ri->desc.name);
|
||||
|
||||
@@ -486,7 +486,7 @@ static int __devinit db8500_regulator_probe(struct platform_device *pdev)
|
||||
|
||||
/* register with the regulator framework */
|
||||
info->rdev = regulator_register(&info->desc, &pdev->dev,
|
||||
init_data, info);
|
||||
init_data, info, NULL);
|
||||
if (IS_ERR(info->rdev)) {
|
||||
err = PTR_ERR(info->rdev);
|
||||
dev_err(&pdev->dev, "failed to register %s: err %i\n",
|
||||
|
||||
@@ -42,7 +42,7 @@ static int __devinit dummy_regulator_probe(struct platform_device *pdev)
|
||||
int ret;
|
||||
|
||||
dummy_regulator_rdev = regulator_register(&dummy_desc, NULL,
|
||||
&dummy_initdata, NULL);
|
||||
&dummy_initdata, NULL, NULL);
|
||||
if (IS_ERR(dummy_regulator_rdev)) {
|
||||
ret = PTR_ERR(dummy_regulator_rdev);
|
||||
pr_err("Failed to register regulator: %d\n", ret);
|
||||
|
||||
@@ -234,7 +234,7 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
drvdata->dev = regulator_register(&drvdata->desc, &pdev->dev,
|
||||
config->init_data, drvdata);
|
||||
config->init_data, drvdata, NULL);
|
||||
if (IS_ERR(drvdata->dev)) {
|
||||
ret = PTR_ERR(drvdata->dev);
|
||||
dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);
|
||||
|
||||
@@ -170,7 +170,7 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c,
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
pmic->rdev[i] = regulator_register(&isl_rd[i], &i2c->dev,
|
||||
init_data, pmic);
|
||||
init_data, pmic, NULL);
|
||||
if (IS_ERR(pmic->rdev[i])) {
|
||||
dev_err(&i2c->dev, "failed to register %s\n", id->name);
|
||||
err = PTR_ERR(pmic->rdev[i]);
|
||||
|
||||
@@ -451,7 +451,7 @@ static int __devinit setup_regulators(struct lp3971 *lp3971,
|
||||
for (i = 0; i < pdata->num_regulators; i++) {
|
||||
struct lp3971_regulator_subdev *reg = &pdata->regulators[i];
|
||||
lp3971->rdev[i] = regulator_register(®ulators[reg->id],
|
||||
lp3971->dev, reg->initdata, lp3971);
|
||||
lp3971->dev, reg->initdata, lp3971, NULL);
|
||||
|
||||
if (IS_ERR(lp3971->rdev[i])) {
|
||||
err = PTR_ERR(lp3971->rdev[i]);
|
||||
|
||||
@@ -555,7 +555,7 @@ static int __devinit setup_regulators(struct lp3972 *lp3972,
|
||||
for (i = 0; i < pdata->num_regulators; i++) {
|
||||
struct lp3972_regulator_subdev *reg = &pdata->regulators[i];
|
||||
lp3972->rdev[i] = regulator_register(®ulators[reg->id],
|
||||
lp3972->dev, reg->initdata, lp3972);
|
||||
lp3972->dev, reg->initdata, lp3972, NULL);
|
||||
|
||||
if (IS_ERR(lp3972->rdev[i])) {
|
||||
err = PTR_ERR(lp3972->rdev[i]);
|
||||
|
||||
@@ -214,7 +214,7 @@ static int __devinit max1586_pmic_probe(struct i2c_client *client,
|
||||
}
|
||||
rdev[i] = regulator_register(&max1586_reg[id], &client->dev,
|
||||
pdata->subdevs[i].platform_data,
|
||||
max1586);
|
||||
max1586, NULL);
|
||||
if (IS_ERR(rdev[i])) {
|
||||
ret = PTR_ERR(rdev[i]);
|
||||
dev_err(&client->dev, "failed to register %s\n",
|
||||
|
||||
@@ -347,7 +347,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client,
|
||||
}
|
||||
|
||||
info->regulator = regulator_register(&dcdc_desc, &client->dev,
|
||||
pdata->regulator, info);
|
||||
pdata->regulator, info, NULL);
|
||||
if (IS_ERR(info->regulator)) {
|
||||
dev_err(info->dev, "failed to register regulator %s\n",
|
||||
dcdc_desc.name);
|
||||
|
||||
@@ -449,7 +449,7 @@ static int __devinit max8660_probe(struct i2c_client *client,
|
||||
|
||||
rdev[i] = regulator_register(&max8660_reg[id], &client->dev,
|
||||
pdata->subdevs[i].platform_data,
|
||||
max8660);
|
||||
max8660, NULL);
|
||||
if (IS_ERR(rdev[i])) {
|
||||
ret = PTR_ERR(rdev[i]);
|
||||
dev_err(&client->dev, "failed to register %s\n",
|
||||
|
||||
@@ -266,7 +266,7 @@ static int __devinit max8925_regulator_probe(struct platform_device *pdev)
|
||||
ri->chip = chip;
|
||||
|
||||
rdev = regulator_register(&ri->desc, &pdev->dev,
|
||||
pdata->regulator[pdev->id], ri);
|
||||
pdata->regulator[pdev->id], ri, NULL);
|
||||
if (IS_ERR(rdev)) {
|
||||
dev_err(&pdev->dev, "failed to register regulator %s\n",
|
||||
ri->desc.name);
|
||||
|
||||
@@ -208,7 +208,7 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
|
||||
max8952->pdata = pdata;
|
||||
|
||||
max8952->rdev = regulator_register(®ulator, max8952->dev,
|
||||
&pdata->reg_data, max8952);
|
||||
&pdata->reg_data, max8952, NULL);
|
||||
|
||||
if (IS_ERR(max8952->rdev)) {
|
||||
ret = PTR_ERR(max8952->rdev);
|
||||
|
||||
@@ -1146,7 +1146,7 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
|
||||
regulators[id].n_voltages = 16;
|
||||
|
||||
rdev[i] = regulator_register(®ulators[id], max8997->dev,
|
||||
pdata->regulators[i].initdata, max8997);
|
||||
pdata->regulators[i].initdata, max8997, NULL);
|
||||
if (IS_ERR(rdev[i])) {
|
||||
ret = PTR_ERR(rdev[i]);
|
||||
dev_err(max8997->dev, "regulator init failed for %d\n",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user