diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-04-16 00:32:12 +0300 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-04-16 00:32:12 +0300 |
| commit | 44f7a3795395b54bf674002803e3e80c6312e210 (patch) | |
| tree | 19a8ffe9e3a9c01cb01e5007bfa77a172ab46533 /drivers | |
| parent | 8e258317dd01261331670877beafa3157bd61478 (diff) | |
| parent | 606c780b8843731c78c0f6fa0a1c3b99456ca263 (diff) | |
| download | linux-44f7a3795395b54bf674002803e3e80c6312e210.tar.xz | |
Merge tag 'regulator-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
"This has been a very quiet update for the regulator API, the bulk of
the diffstat is DT binding conversions and the most promient series in
the changelog is Johan Hovold cleaning up some leaks of OF nodes. For
some reason we have had several different people sending improvements
to better describe the parent supplies for existing regulators, these
look to be independent efforts.
The only new hardware support is for some Motorola custom varints of
cpcap"
* tag 'regulator-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (35 commits)
regulator: max77620: drop redundant OF node initialisation
regulator: bq257xx: Make OTG enable GPIO really optional
regulator: bq257xx: Remove reference to the parent MFD's dev
regulator: bd9571mwv: fix OF node reference imbalance
regulator: act8945a: fix OF node reference imbalance
regulator: s2dos05: fix OF node reference imbalance
regulator: mt6357: fix OF node reference imbalance
regulator: max77650: fix OF node reference imbalance
regulator: rk808: fix OF node reference imbalance
regulator: bq257xx: fix OF node reference imbalance
regulator: dt-bindings: qcom,qca6390-pmu: Document WCN6755 PMU
regulator: dt-bindings: regulator-max77620: convert to DT schema
regulator: mt6315: Add regulator supplies
regulator: dt-bindings: mt6315: Add regulator supplies
regulator: devres: Use enum regulator_get_type in internal functions
regulator: dt-bindings: mps,mp8859: convert to DT schema
regulator: da9121: Allow caching BUCK registers
regulator: dt-bindings: dlg,da9121: Add dlg,no-gpio-control
regulator: cros-ec: Add regulator supply
regulator: dt-bindings: cros-ec: Add regulator supply
...
Diffstat (limited to 'drivers')
22 files changed, 194 insertions, 61 deletions
diff --git a/drivers/regulator/act8945a-regulator.c b/drivers/regulator/act8945a-regulator.c index 24cbdd833863..5bbe2bce740e 100644 --- a/drivers/regulator/act8945a-regulator.c +++ b/drivers/regulator/act8945a-regulator.c @@ -302,8 +302,9 @@ static int act8945a_pmic_probe(struct platform_device *pdev) num_regulators = ARRAY_SIZE(act8945a_regulators); } + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); + config.dev = &pdev->dev; - config.dev->of_node = pdev->dev.parent->of_node; config.driver_data = act8945a; for (i = 0; i < num_regulators; i++) { rdev = devm_regulator_register(&pdev->dev, ®ulators[i], diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c index 209beabb5c37..f4de24a281b1 100644 --- a/drivers/regulator/bd9571mwv-regulator.c +++ b/drivers/regulator/bd9571mwv-regulator.c @@ -287,8 +287,9 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bdreg); + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); + config.dev = &pdev->dev; - config.dev->of_node = pdev->dev.parent->of_node; config.driver_data = bdreg; config.regmap = bdreg->regmap; diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c index dab8f1ab4450..09c466052c04 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -15,7 +15,6 @@ #include <linux/regulator/of_regulator.h> struct bq257xx_reg_data { - struct bq257xx_device *bq; struct regulator_dev *bq257xx_reg; struct gpio_desc *otg_en_gpio; struct regulator_desc desc; @@ -23,11 +22,11 @@ struct bq257xx_reg_data { static int bq25703_vbus_get_cur_limit(struct regulator_dev *rdev) { - struct bq257xx_reg_data *pdata = rdev_get_drvdata(rdev); + struct regmap *regmap = rdev_get_regmap(rdev); int ret; unsigned int reg; - ret = regmap_read(pdata->bq->regmap, BQ25703_OTG_CURRENT, ®); + ret = regmap_read(regmap, BQ25703_OTG_CURRENT, ®); if (ret) return ret; return FIELD_GET(BQ25703_OTG_CUR_MASK, reg) * BQ25703_OTG_CUR_STEP_UA; @@ -40,7 +39,7 @@ static int bq25703_vbus_get_cur_limit(struct regulator_dev *rdev) static int bq25703_vbus_set_cur_limit(struct regulator_dev *rdev, int min_uA, int max_uA) { - struct bq257xx_reg_data *pdata = rdev_get_drvdata(rdev); + struct regmap *regmap = rdev_get_regmap(rdev); unsigned int reg; if ((min_uA > BQ25703_OTG_CUR_MAX_UA) || (max_uA < 0)) @@ -52,7 +51,7 @@ static int bq25703_vbus_set_cur_limit(struct regulator_dev *rdev, if ((reg * BQ25703_OTG_CUR_STEP_UA) < min_uA) return -EINVAL; - return regmap_write(pdata->bq->regmap, BQ25703_OTG_CURRENT, + return regmap_write(regmap, BQ25703_OTG_CURRENT, FIELD_PREP(BQ25703_OTG_CUR_MASK, reg)); } @@ -128,6 +127,12 @@ static void bq257xx_reg_dt_parse_gpio(struct platform_device *pdev) of_node_put(subchild); if (IS_ERR(pdata->otg_en_gpio)) { + if (PTR_ERR(pdata->otg_en_gpio) == -ENOENT) { + /* No GPIO, will only use register writes for OTG */ + pdata->otg_en_gpio = NULL; + return; + } + dev_err(&pdev->dev, "Error getting enable gpio: %ld\n", PTR_ERR(pdata->otg_en_gpio)); return; @@ -137,19 +142,16 @@ static void bq257xx_reg_dt_parse_gpio(struct platform_device *pdev) static int bq257xx_regulator_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct bq257xx_device *bq = dev_get_drvdata(pdev->dev.parent); struct bq257xx_reg_data *pdata; struct device_node *np = dev->of_node; struct regulator_config cfg = {}; - pdev->dev.of_node = pdev->dev.parent->of_node; - pdev->dev.of_node_reused = true; + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); pdata = devm_kzalloc(&pdev->dev, sizeof(struct bq257xx_reg_data), GFP_KERNEL); if (!pdata) return -ENOMEM; - pdata->bq = bq; pdata->desc = bq25703_vbus_desc; platform_set_drvdata(pdev, pdata); diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 2286bdf6edcb..dc5d67767336 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1550,7 +1550,7 @@ static int set_machine_constraints(struct regulator_dev *rdev, * Existing logic does not warn if over_current_protection is given as * a constraint but driver does not support that. I think we should * warn about this type of issues as it is possible someone changes - * PMIC on board to another type - and the another PMIC's driver does + * PMIC on board to another type - and the other PMIC's driver does * not support setting protection. Board composer may happily believe * the DT limits are respected - especially if the new PMIC HW also * supports protection but the driver does not. I won't change the logic diff --git a/drivers/regulator/cpcap-regulator.c b/drivers/regulator/cpcap-regulator.c index 6958d154442b..63f5c90ddf50 100644 --- a/drivers/regulator/cpcap-regulator.c +++ b/drivers/regulator/cpcap-regulator.c @@ -261,6 +261,30 @@ static const struct regulator_ops cpcap_regulator_ops = { }; static const unsigned int unknown_val_tbl[] = { 0, }; +static const unsigned int sw_mot_val_tbl[] = { 600000, 612500, 625000, + 637500, 650000, 662500, + 675000, 687500, 700000, + 712500, 725000, 737500, + 750000, 762500, 775000, + 787500, 800000, 812500, + 825000, 837500, 850000, + 862500, 875000, 887500, + 900000, 912500, 925000, + 937500, 950000, 962500, + 975000, 987500, 1000000, + 1012500, 1025000, 1037500, + 1050000, 1062500, 1075000, + 1087500, 1100000, 1112500, + 1125000, 1137500, 1150000, + 1162500, 1175000, 1187500, + 1200000, 1212500, 1225000, + 1237500, 1250000, 1262500, + 1275000, 1287500, 1300000, + 1312500, 1325000, 1337500, + 1350000, 1362500, 1375000, + 1387500, 1400000, 1412500, + 1425000, 1437500, 1450000, + 1462500, 1475000, }; static const unsigned int sw2_sw4_val_tbl[] = { 612500, 625000, 637500, 650000, 662500, 675000, 687500, 700000, 712500, @@ -284,6 +308,7 @@ static const unsigned int sw2_sw4_val_tbl[] = { 612500, 625000, 637500, 1362500, 1375000, 1387500, 1400000, 1412500, 1425000, 1437500, 1450000, 1462500, }; +static const unsigned int sw3_val_tbl[] = { 1350000, 1800000, 1850000, 1875000, }; static const unsigned int sw5_val_tbl[] = { 0, 5050000, }; static const unsigned int vcam_val_tbl[] = { 2600000, 2700000, 2800000, 2900000, }; @@ -402,6 +427,82 @@ static const struct cpcap_regulator omap4_regulators[] = { { /* sentinel */ }, }; +static const struct cpcap_regulator mot_regulators[] = { + CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2, + CPCAP_BIT_SW1_SEL, sw_mot_val_tbl, + 0x6f00, 0x7f, 0x6800, 0, 0), + CPCAP_REG(SW2, CPCAP_REG_S2C1, CPCAP_REG_ASSIGN2, + CPCAP_BIT_SW2_SEL, sw_mot_val_tbl, + 0x6f00, 0x7f, 0x4804, 0, 0), + CPCAP_REG(SW3, CPCAP_REG_S3C, CPCAP_REG_ASSIGN2, + CPCAP_BIT_SW3_SEL, sw3_val_tbl, + 0x578, 0x3, 0x043c, 0, 0), + CPCAP_REG(SW4, CPCAP_REG_S4C1, CPCAP_REG_ASSIGN2, + CPCAP_BIT_SW4_SEL, sw_mot_val_tbl, + 0x6f00, 0x7f, 0x4909, 0, 0), + CPCAP_REG(SW5, CPCAP_REG_S5C, CPCAP_REG_ASSIGN2, + CPCAP_BIT_SW5_SEL, sw5_val_tbl, + 0x28, 0, 0x20, 0, 0), + CPCAP_REG(SW6, CPCAP_REG_S6C, CPCAP_REG_ASSIGN2, + CPCAP_BIT_SW6_SEL, unknown_val_tbl, + 0, 0, 0, 0, 0), + CPCAP_REG(VCAM, CPCAP_REG_VCAMC, CPCAP_REG_ASSIGN2, + CPCAP_BIT_VCAM_SEL, vcam_val_tbl, + 0x87, 0x30, 0x7, 0, 420), + CPCAP_REG(VCSI, CPCAP_REG_VCSIC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VCSI_SEL, vcsi_val_tbl, + 0x47, 0x10, 0x7, 0, 350), + CPCAP_REG(VDAC, CPCAP_REG_VDACC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VDAC_SEL, vdac_val_tbl, + 0x87, 0x30, 0x0, 0, 420), + CPCAP_REG(VDIG, CPCAP_REG_VDIGC, CPCAP_REG_ASSIGN2, + CPCAP_BIT_VDIG_SEL, vdig_val_tbl, + 0x87, 0x30, 0x0, 0, 420), + CPCAP_REG(VFUSE, CPCAP_REG_VFUSEC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VFUSE_SEL, vfuse_val_tbl, + 0xa0, 0xf, 0x0, 0, 420), + CPCAP_REG(VHVIO, CPCAP_REG_VHVIOC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VHVIO_SEL, vhvio_val_tbl, + 0x17, 0, 0x2, 0, 0), + CPCAP_REG(VSDIO, CPCAP_REG_VSDIOC, CPCAP_REG_ASSIGN2, + CPCAP_BIT_VSDIO_SEL, vsdio_val_tbl, + 0x87, 0x38, 0x2, 0, 420), + CPCAP_REG(VPLL, CPCAP_REG_VPLLC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VPLL_SEL, vpll_val_tbl, + 0x47, 0x18, 0x1, 0, 420), + CPCAP_REG(VRF1, CPCAP_REG_VRF1C, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VRF1_SEL, vrf1_val_tbl, + 0xac, 0x2, 0, 0, 10), + CPCAP_REG(VRF2, CPCAP_REG_VRF2C, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VRF2_SEL, vrf2_val_tbl, + 0x23, 0x8, 0, 0, 10), + CPCAP_REG(VRFREF, CPCAP_REG_VRFREFC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VRFREF_SEL, vrfref_val_tbl, + 0x23, 0x8, 0, 0, 420), + CPCAP_REG(VWLAN1, CPCAP_REG_VWLAN1C, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VWLAN1_SEL, vwlan1_val_tbl, + 0x47, 0x10, 0x5, 0, 420), + CPCAP_REG(VWLAN2, CPCAP_REG_VWLAN2C, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VWLAN2_SEL, vwlan2_val_tbl, + 0x20c, 0xc0, 0xd, 0, 420), + CPCAP_REG(VSIM, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3, + 0xffff, vsim_val_tbl, + 0x23, 0x8, 0, 0, 420), + CPCAP_REG(VSIMCARD, CPCAP_REG_VSIMC, CPCAP_REG_ASSIGN3, + 0xffff, vsimcard_val_tbl, + 0x1e80, 0x8, 0x1e00, 0, 420), + CPCAP_REG(VVIB, CPCAP_REG_VVIBC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VVIB_SEL, vvib_val_tbl, + 0x1, 0xc, 0x1, 0, 500), + CPCAP_REG(VUSB, CPCAP_REG_VUSBC, CPCAP_REG_ASSIGN3, + CPCAP_BIT_VUSB_SEL, vusb_val_tbl, + 0x11c, 0x40, 0xc, 0, 0), + CPCAP_REG(VAUDIO, CPCAP_REG_VAUDIOC, CPCAP_REG_ASSIGN4, + CPCAP_BIT_VAUDIO_SEL, vaudio_val_tbl, + 0x16, 0x1, 0x5, 0, 0), + { /* sentinel */ } +}; + static const struct cpcap_regulator xoom_regulators[] = { CPCAP_REG(SW1, CPCAP_REG_S1C1, CPCAP_REG_ASSIGN2, CPCAP_BIT_SW1_SEL, unknown_val_tbl, @@ -487,6 +588,10 @@ static const struct of_device_id cpcap_regulator_id_table[] = { .data = omap4_regulators, }, { + .compatible = "motorola,mot-cpcap-regulator", + .data = mot_regulators, + }, + { .compatible = "motorola,xoom-cpcap-regulator", .data = xoom_regulators, }, diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c index fb0767b33a36..aec275fe1f44 100644 --- a/drivers/regulator/cros-ec-regulator.c +++ b/drivers/regulator/cros-ec-regulator.c @@ -183,6 +183,7 @@ static int cros_ec_regulator_probe(struct platform_device *pdev) desc->owner = THIS_MODULE; desc->type = REGULATOR_VOLTAGE; desc->ops = &cros_ec_regulator_voltage_ops; + desc->supply_name = "vin"; ret = cros_ec_regulator_init_info(dev, drvdata); if (ret < 0) diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index 9d369cc45d41..bf34ea440d77 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c @@ -67,7 +67,7 @@ struct da9063_regulator_data { struct da9063_regulators_pdata { unsigned int n_regulators; - struct da9063_regulator_data *regulator_data; + struct da9063_regulator_data regulator_data[] __counted_by(n_regulators); }; /* Regulator capabilities and registers description */ @@ -857,15 +857,10 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt( return ERR_PTR(-EINVAL); } - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + pdata = devm_kzalloc(&pdev->dev, struct_size(pdata, regulator_data, num), GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); - pdata->regulator_data = devm_kcalloc(&pdev->dev, - num, sizeof(*pdata->regulator_data), - GFP_KERNEL); - if (!pdata->regulator_data) - return ERR_PTR(-ENOMEM); pdata->n_regulators = num; n = 0; diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c index ef161eb0ca27..2b150bb4d471 100644 --- a/drivers/regulator/da9121-regulator.c +++ b/drivers/regulator/da9121-regulator.c @@ -400,8 +400,14 @@ static int da9121_of_parse_cb(struct device_node *np, GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE, "da9121-enable"); - if (!IS_ERR(ena_gpiod)) + if (!IS_ERR(ena_gpiod)) { + if (of_property_read_bool(chip->dev->of_node, "dlg,no-gpio-control")) { + gpiod_put(ena_gpiod); + dev_err(chip->dev, "dlg,no-gpio-control conflicts with enable-gpios\n"); + return -EINVAL; + } config->ena_gpiod = ena_gpiod; + } if (variant_parameters[chip->variant_id].num_bucks == 2) { uint32_t ripple_cancel; @@ -864,6 +870,21 @@ static const struct regmap_access_table da9121_volatile_table = { .n_yes_ranges = ARRAY_SIZE(da9121_volatile_ranges), }; +/* + * When GPIO functions DVC/RELOAD/EN are not used, the registers in the range + * DA9121_REG_BUCK_BUCK1_0 to DA9121_REG_BUCK_BUCK1_6 need not be volatile + * because register writes to these registers can only be performed via I2C. + */ +static const struct regmap_range da9121_volatile_ranges_no_gpio_ctrl[] = { + regmap_reg_range(DA9121_REG_SYS_STATUS_0, DA9121_REG_SYS_EVENT_2), + regmap_reg_range(DA9121_REG_SYS_GPIO0_0, DA9121_REG_SYS_GPIO2_1), +}; + +static const struct regmap_access_table da9121_volatile_table_no_gpio_ctrl = { + .yes_ranges = da9121_volatile_ranges_no_gpio_ctrl, + .n_yes_ranges = ARRAY_SIZE(da9121_volatile_ranges_no_gpio_ctrl), +}; + /* DA9121 regmap config for 1 channel variants */ static const struct regmap_config da9121_1ch_regmap_config = { .reg_bits = 8, @@ -994,10 +1015,18 @@ static int da9121_assign_chip_model(struct i2c_client *i2c, struct da9121 *chip) { const struct regmap_config *regmap; + struct regmap_config regmap_config_1ch = da9121_1ch_regmap_config; + struct regmap_config regmap_config_2ch = da9121_2ch_regmap_config; + int ret = 0; chip->dev = &i2c->dev; + if (of_property_read_bool(i2c->dev.of_node, "dlg,no-gpio-control")) { + regmap_config_1ch.volatile_table = &da9121_volatile_table_no_gpio_ctrl; + regmap_config_2ch.volatile_table = &da9121_volatile_table_no_gpio_ctrl; + } + /* Use configured subtype to select the regulator descriptor index and * register map, common to both consumer and automotive grade variants */ @@ -1005,29 +1034,29 @@ static int da9121_assign_chip_model(struct i2c_client *i2c, case DA9121_SUBTYPE_DA9121: case DA9121_SUBTYPE_DA9130: chip->variant_id = DA9121_TYPE_DA9121_DA9130; - regmap = &da9121_1ch_regmap_config; + regmap = ®map_config_1ch; break; case DA9121_SUBTYPE_DA9217: chip->variant_id = DA9121_TYPE_DA9217; - regmap = &da9121_1ch_regmap_config; + regmap = ®map_config_1ch; break; case DA9121_SUBTYPE_DA9122: case DA9121_SUBTYPE_DA9131: chip->variant_id = DA9121_TYPE_DA9122_DA9131; - regmap = &da9121_2ch_regmap_config; + regmap = ®map_config_2ch; break; case DA9121_SUBTYPE_DA9220: case DA9121_SUBTYPE_DA9132: chip->variant_id = DA9121_TYPE_DA9220_DA9132; - regmap = &da9121_2ch_regmap_config; + regmap = ®map_config_2ch; break; case DA9121_SUBTYPE_DA9141: chip->variant_id = DA9121_TYPE_DA9141; - regmap = &da9121_1ch_regmap_config; + regmap = ®map_config_1ch; break; case DA9121_SUBTYPE_DA9142: chip->variant_id = DA9121_TYPE_DA9142; - regmap = &da9121_2ch_regmap_config; + regmap = ®map_config_2ch; break; default: return -EINVAL; diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c index 2cf03042fddf..615deba5d22c 100644 --- a/drivers/regulator/devres.c +++ b/drivers/regulator/devres.c @@ -20,7 +20,7 @@ static void devm_regulator_release(struct device *dev, void *res) } static struct regulator *_devm_regulator_get(struct device *dev, const char *id, - int get_type) + enum regulator_get_type get_type) { struct regulator **ptr, *regulator; @@ -78,7 +78,7 @@ static void regulator_action_disable(void *d) } static int _devm_regulator_get_enable(struct device *dev, const char *id, - int get_type) + enum regulator_get_type get_type) { struct regulator *r; int ret; @@ -751,7 +751,7 @@ EXPORT_SYMBOL_GPL(devm_regulator_irq_helper); #if IS_ENABLED(CONFIG_OF) static struct regulator *_devm_of_regulator_get(struct device *dev, struct device_node *node, - const char *id, int get_type) + const char *id, enum regulator_get_type get_type) { struct regulator **ptr, *regulator; diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 254c0a8a4555..417d282dd4ed 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -20,7 +20,6 @@ #include <linux/platform_device.h> #include <linux/pm_domain.h> #include <linux/pm_opp.h> -#include <linux/reboot.h> #include <linux/regulator/driver.h> #include <linux/regulator/fixed.h> #include <linux/gpio/consumer.h> @@ -30,9 +29,6 @@ #include <linux/regulator/machine.h> #include <linux/clk.h> -/* Default time in millisecond to wait for emergency shutdown */ -#define FV_DEF_EMERG_SHUTDWN_TMO 10 - struct fixed_voltage_data { struct regulator_desc desc; struct regulator_dev *dev; diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c index abea3b69d8a0..002b41f53eff 100644 --- a/drivers/regulator/fp9931.c +++ b/drivers/regulator/fp9931.c @@ -446,7 +446,7 @@ static int fp9931_probe(struct i2c_client *client) return dev_err_probe(&client->dev, PTR_ERR(data->regmap), "failed to allocate regmap!\n"); - data->vin_reg = devm_regulator_get_optional(&client->dev, "vin"); + data->vin_reg = devm_regulator_get(&client->dev, "vin"); if (IS_ERR(data->vin_reg)) return dev_err_probe(&client->dev, PTR_ERR(data->vin_reg), "failed to get vin regulator\n"); diff --git a/drivers/regulator/max20411-regulator.c b/drivers/regulator/max20411-regulator.c index 02d7009ea0e6..6c0ebb970e90 100644 --- a/drivers/regulator/max20411-regulator.c +++ b/drivers/regulator/max20411-regulator.c @@ -133,7 +133,7 @@ static int max20411_probe(struct i2c_client *client) max20411->rdev = devm_regulator_register(max20411->dev, &max20411->desc, &cfg); if (IS_ERR(max20411->rdev)) - dev_err(max20411->dev, "Failed to register regulator\n"); + dev_err(max20411->dev, "Failed to register regulator: %pe\n", max20411->rdev); return PTR_ERR_OR_ZERO(max20411->rdev); } diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c index 7bc87d8e9f68..57c54472ec5b 100644 --- a/drivers/regulator/max77620-regulator.c +++ b/drivers/regulator/max77620-regulator.c @@ -793,8 +793,6 @@ static int max77620_regulator_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pmic); pmic->dev = dev; pmic->rmap = max77620_chip->rmap; - if (!dev->of_node) - dev->of_node = pdev->dev.parent->of_node; switch (max77620_chip->chip_id) { case MAX77620: diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max77650-regulator.c index a809264c77fc..11b04a13f889 100644 --- a/drivers/regulator/max77650-regulator.c +++ b/drivers/regulator/max77650-regulator.c @@ -337,7 +337,7 @@ static int max77650_regulator_probe(struct platform_device *pdev) parent = dev->parent; if (!dev->of_node) - dev->of_node = parent->of_node; + device_set_of_node_from_dev(dev, parent); rdescs = devm_kcalloc(dev, MAX77650_REGULATOR_NUM_REGULATORS, sizeof(*rdescs), GFP_KERNEL); diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt6315-regulator.c index d3f93aae0fc5..231e64fb0596 100644 --- a/drivers/regulator/mt6315-regulator.c +++ b/drivers/regulator/mt6315-regulator.c @@ -31,10 +31,11 @@ struct mt6315_chip { struct regmap *regmap; }; -#define MT_BUCK(_name, _bid, _vsel) \ +#define MT_BUCK(_name, _bid, _supply, _vsel) \ [_bid] = { \ .desc = { \ .name = _name, \ + .supply_name = _supply, \ .of_match = of_match_ptr(_name), \ .regulators_node = "regulators", \ .ops = &mt6315_volt_range_ops, \ @@ -190,10 +191,10 @@ static const struct regulator_ops mt6315_volt_range_ops = { }; static const struct mt6315_regulator_info mt6315_regulators[MT6315_VBUCK_MAX] = { - MT_BUCK("vbuck1", MT6315_VBUCK1, MT6315_BUCK_TOP_ELR0), - MT_BUCK("vbuck2", MT6315_VBUCK2, MT6315_BUCK_TOP_ELR2), - MT_BUCK("vbuck3", MT6315_VBUCK3, MT6315_BUCK_TOP_ELR4), - MT_BUCK("vbuck4", MT6315_VBUCK4, MT6315_BUCK_TOP_ELR6), + MT_BUCK("vbuck1", MT6315_VBUCK1, "pvdd1", MT6315_BUCK_TOP_ELR0), + MT_BUCK("vbuck2", MT6315_VBUCK2, "pvdd2", MT6315_BUCK_TOP_ELR2), + MT_BUCK("vbuck3", MT6315_VBUCK3, "pvdd3", MT6315_BUCK_TOP_ELR4), + MT_BUCK("vbuck4", MT6315_VBUCK4, "pvdd4", MT6315_BUCK_TOP_ELR6), }; static const struct regmap_config mt6315_regmap_config = { diff --git a/drivers/regulator/mt6357-regulator.c b/drivers/regulator/mt6357-regulator.c index 1eb69c7a6acb..09feb454ab6b 100644 --- a/drivers/regulator/mt6357-regulator.c +++ b/drivers/regulator/mt6357-regulator.c @@ -410,7 +410,7 @@ static int mt6357_regulator_probe(struct platform_device *pdev) struct regulator_dev *rdev; int i; - pdev->dev.of_node = pdev->dev.parent->of_node; + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); for (i = 0; i < MT6357_MAX_REGULATOR; i++) { config.dev = &pdev->dev; diff --git a/drivers/regulator/pf0900-regulator.c b/drivers/regulator/pf0900-regulator.c index b5effee32917..5c44d2dbcab4 100644 --- a/drivers/regulator/pf0900-regulator.c +++ b/drivers/regulator/pf0900-regulator.c @@ -771,7 +771,7 @@ static const struct pf0900_regulator_desc pf0900_regulators[] = { }, }; -struct pf0900_regulator_irq regu_irqs[] = { +static const struct pf0900_regulator_irq regu_irqs[] = { PF0900_REGU_IRQ(PF0900_REG_SW_ILIM_INT, PF0900_SW, REGULATOR_ERROR_OVER_CURRENT_WARN), PF0900_REGU_IRQ(PF0900_REG_LDO_ILIM_INT, PF0900_LDO, REGULATOR_ERROR_OVER_CURRENT_WARN), PF0900_REGU_IRQ(PF0900_REG_SW_UV_INT, PF0900_SW, REGULATOR_ERROR_UNDER_VOLTAGE_WARN), diff --git a/drivers/regulator/pf1550-regulator.c b/drivers/regulator/pf1550-regulator.c index 037b8ec94066..1d1726528460 100644 --- a/drivers/regulator/pf1550-regulator.c +++ b/drivers/regulator/pf1550-regulator.c @@ -360,7 +360,6 @@ static int pf1550_regulator_probe(struct platform_device *pdev) "failed to get parent regmap\n"); config.dev = pf1550->dev; - config.regmap = pf1550->regmap; info->dev = &pdev->dev; info->pf1550 = pf1550; diff --git a/drivers/regulator/pf9453-regulator.c b/drivers/regulator/pf9453-regulator.c index eed3055d1c1c..07cbcd312653 100644 --- a/drivers/regulator/pf9453-regulator.c +++ b/drivers/regulator/pf9453-regulator.c @@ -732,6 +732,9 @@ static irqreturn_t pf9453_irq_handler(int irq, void *data) return IRQ_NONE; } + if (!status) + return IRQ_NONE; + if (status & IRQ_RSTB) dev_warn(pf9453->dev, "IRQ_RSTB interrupt.\n"); @@ -809,7 +812,7 @@ static int pf9453_i2c_probe(struct i2c_client *i2c) } ret = devm_request_threaded_irq(pf9453->dev, pf9453->irq, NULL, pf9453_irq_handler, - IRQF_ONESHOT, + (IRQF_ONESHOT | IRQF_SHARED), "pf9453-irq", pf9453); if (ret) return dev_err_probe(pf9453->dev, ret, "Failed to request IRQ: %d\n", pf9453->irq); diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index e66408f23bb6..1e956153427e 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -2114,8 +2114,7 @@ static int rk808_regulator_probe(struct platform_device *pdev) struct regmap *regmap; int ret, i, nregulators; - pdev->dev.of_node = pdev->dev.parent->of_node; - pdev->dev.of_node_reused = true; + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); regmap = dev_get_regmap(pdev->dev.parent, NULL); if (!regmap) diff --git a/drivers/regulator/s2dos05-regulator.c b/drivers/regulator/s2dos05-regulator.c index 1463585c4565..a1c394ddbaff 100644 --- a/drivers/regulator/s2dos05-regulator.c +++ b/drivers/regulator/s2dos05-regulator.c @@ -126,7 +126,7 @@ static int s2dos05_pmic_probe(struct platform_device *pdev) s2dos05->regmap = iodev->regmap_pmic; s2dos05->dev = dev; if (!dev->of_node) - dev->of_node = dev->parent->of_node; + device_set_of_node_from_dev(dev, dev->parent); config.dev = dev; config.driver_data = s2dos05; diff --git a/drivers/regulator/spacemit-p1.c b/drivers/regulator/spacemit-p1.c index 2b585ba01a93..57e6e00a73fa 100644 --- a/drivers/regulator/spacemit-p1.c +++ b/drivers/regulator/spacemit-p1.c @@ -87,13 +87,16 @@ static const struct linear_range p1_ldo_ranges[] = { } #define P1_BUCK_DESC(_n) \ - P1_REG_DESC(BUCK, buck, _n, "vin", 0x47, BUCK_MASK, 255, p1_buck_ranges) + P1_REG_DESC(BUCK, buck, _n, "vin" #_n, 0x47, BUCK_MASK, 255, p1_buck_ranges) #define P1_ALDO_DESC(_n) \ - P1_REG_DESC(ALDO, aldo, _n, "vin", 0x5b, LDO_MASK, 128, p1_ldo_ranges) + P1_REG_DESC(ALDO, aldo, _n, "aldoin", 0x5b, LDO_MASK, 128, p1_ldo_ranges) -#define P1_DLDO_DESC(_n) \ - P1_REG_DESC(DLDO, dldo, _n, "buck5", 0x67, LDO_MASK, 128, p1_ldo_ranges) +#define P1_DLDO1_DESC(_n) \ + P1_REG_DESC(DLDO, dldo, _n, "dldoin1", 0x67, LDO_MASK, 128, p1_ldo_ranges) + +#define P1_DLDO2_DESC(_n) \ + P1_REG_DESC(DLDO, dldo, _n, "dldoin2", 0x67, LDO_MASK, 128, p1_ldo_ranges) static const struct regulator_desc p1_regulator_desc[] = { P1_BUCK_DESC(1), @@ -108,13 +111,13 @@ static const struct regulator_desc p1_regulator_desc[] = { P1_ALDO_DESC(3), P1_ALDO_DESC(4), - P1_DLDO_DESC(1), - P1_DLDO_DESC(2), - P1_DLDO_DESC(3), - P1_DLDO_DESC(4), - P1_DLDO_DESC(5), - P1_DLDO_DESC(6), - P1_DLDO_DESC(7), + P1_DLDO1_DESC(1), + P1_DLDO1_DESC(2), + P1_DLDO1_DESC(3), + P1_DLDO1_DESC(4), + P1_DLDO2_DESC(5), + P1_DLDO2_DESC(6), + P1_DLDO2_DESC(7), }; static int p1_regulator_probe(struct platform_device *pdev) |
