2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-02 02:34:05 +08:00

regulator: bd718x7: Stop using parent data

The ROHM PMIC regulator drivers only need the regmap pointer from
the parent device. Regmap can be obtained via dev_get_regmap()
so do not require parent to populate driver data for that.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/20210107122355.GA35080@localhost.localdomain
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Matti Vaittinen 2021-01-07 14:23:55 +02:00 committed by Mark Brown
parent f45c522cf8
commit 907dfdc945
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1554,7 +1554,7 @@ err_out:
static int bd718xx_probe(struct platform_device *pdev) static int bd718xx_probe(struct platform_device *pdev)
{ {
struct bd718xx *mfd; struct regmap *regmap;
struct regulator_config config = { 0 }; struct regulator_config config = { 0 };
int i, j, err, omit_enable; int i, j, err, omit_enable;
bool use_snvs; bool use_snvs;
@ -1563,11 +1563,10 @@ static int bd718xx_probe(struct platform_device *pdev)
enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data;
const struct regulator_ops **swops, **hwops; const struct regulator_ops **swops, **hwops;
mfd = dev_get_drvdata(pdev->dev.parent); regmap = dev_get_regmap(pdev->dev.parent, NULL);
if (!mfd) { if (!regmap) {
dev_err(&pdev->dev, "No MFD driver data\n"); dev_err(&pdev->dev, "No MFD driver data\n");
err = -EINVAL; return -EINVAL;
goto err;
} }
switch (chip) { switch (chip) {
@ -1590,7 +1589,7 @@ static int bd718xx_probe(struct platform_device *pdev)
} }
/* Register LOCK release */ /* Register LOCK release */
err = regmap_update_bits(mfd->chip.regmap, BD718XX_REG_REGLOCK, err = regmap_update_bits(regmap, BD718XX_REG_REGLOCK,
(REGLOCK_PWRSEQ | REGLOCK_VREG), 0); (REGLOCK_PWRSEQ | REGLOCK_VREG), 0);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to unlock PMIC (%d)\n", err); dev_err(&pdev->dev, "Failed to unlock PMIC (%d)\n", err);
@ -1609,8 +1608,7 @@ static int bd718xx_probe(struct platform_device *pdev)
* bit allowing HW defaults for power rails to be used * bit allowing HW defaults for power rails to be used
*/ */
if (!use_snvs) { if (!use_snvs) {
err = regmap_update_bits(mfd->chip.regmap, err = regmap_update_bits(regmap, BD718XX_REG_TRANS_COND1,
BD718XX_REG_TRANS_COND1,
BD718XX_ON_REQ_POWEROFF_MASK | BD718XX_ON_REQ_POWEROFF_MASK |
BD718XX_SWRESET_POWEROFF_MASK | BD718XX_SWRESET_POWEROFF_MASK |
BD718XX_WDOG_POWEROFF_MASK | BD718XX_WDOG_POWEROFF_MASK |
@ -1626,7 +1624,7 @@ static int bd718xx_probe(struct platform_device *pdev)
} }
config.dev = pdev->dev.parent; config.dev = pdev->dev.parent;
config.regmap = mfd->chip.regmap; config.regmap = regmap;
/* /*
* There are cases when we want to leave the enable-control for * There are cases when we want to leave the enable-control for
* the HW state machine and use this driver only for voltage control. * the HW state machine and use this driver only for voltage control.
@ -1685,7 +1683,7 @@ static int bd718xx_probe(struct platform_device *pdev)
if (!no_enable_control && (!use_snvs || if (!no_enable_control && (!use_snvs ||
!rdev->constraints->always_on || !rdev->constraints->always_on ||
!rdev->constraints->boot_on)) { !rdev->constraints->boot_on)) {
err = regmap_update_bits(mfd->chip.regmap, r->init.reg, err = regmap_update_bits(regmap, r->init.reg,
r->init.mask, r->init.val); r->init.mask, r->init.val);
if (err) { if (err) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
@ -1695,7 +1693,7 @@ static int bd718xx_probe(struct platform_device *pdev)
} }
} }
for (j = 0; j < r->additional_init_amnt; j++) { for (j = 0; j < r->additional_init_amnt; j++) {
err = regmap_update_bits(mfd->chip.regmap, err = regmap_update_bits(regmap,
r->additional_inits[j].reg, r->additional_inits[j].reg,
r->additional_inits[j].mask, r->additional_inits[j].mask,
r->additional_inits[j].val); r->additional_inits[j].val);