From fbb4c52ccdcb4a612d2b7f800aa57090eeee16d7 Mon Sep 17 00:00:00 2001 From: Guodong Xu Date: Fri, 6 Feb 2026 10:32:03 +0800 Subject: regulator: spacemit-p1: Update supply names Update supply names to match the P1 PMIC's actual hardware pinout where each buck has an individual VIN pin (vin1-vin6) and LDO groups have dedicated input pins (aldoin, dldoin1, dldoin2). This is an ABI change from the original "vin" and "buck5" supplies. The P1/PMIC regulator has no consumers in the DTS tree yet. For the two K1 boards in-tree (BPI-F3 and Jupiter), power settings come from boot firmware, so a probe failure has minimal impact. Signed-off-by: Guodong Xu Link: https://developer.spacemit.com/documentation?token=T1Btw2BdiiSlSXkAdibcoMetnag [1] Reviewed-by: Alex Elder Link: https://patch.msgid.link/20260206-spacemit-p1-v4-2-8f695d93811e@riscstar.com Signed-off-by: Mark Brown --- drivers/regulator/spacemit-p1.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'drivers/regulator') 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) -- cgit v1.2.3 From 0556bb42a84ee391a2145ddba86756f9747bc27f Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 16 Feb 2026 09:58:05 +0100 Subject: regulator: pf0900: Make regu_irqs variable static const File-scope 'regu_irqs' is not used outside of this unit and is not modified anywhere, so make it static const to silence sparse warning: pf0900-regulator.c:774:29: warning: symbol 'regu_irqs' was not declared. Should it be static? Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260216085804.69102-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Mark Brown --- drivers/regulator/pf0900-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator') 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), -- cgit v1.2.3 From d90c0f78379454d51a428e312ac6db573060185c Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Mon, 23 Feb 2026 08:38:52 +0200 Subject: regulator: cpcap-regulator: add support for Mot regulators Add support for regulator set used in Motorola Mot board, used as a base for Atrix 4G and Droid X2 smartphones. Signed-off-by: Svyatoslav Ryhel Link: https://patch.msgid.link/20260223063858.12208-4-clamor95@gmail.com Signed-off-by: Mark Brown --- drivers/regulator/cpcap-regulator.c | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) (limited to 'drivers/regulator') 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, @@ -486,6 +587,10 @@ static const struct of_device_id cpcap_regulator_id_table[] = { .compatible = "motorola,mapphone-cpcap-regulator", .data = omap4_regulators, }, + { + .compatible = "motorola,mot-cpcap-regulator", + .data = mot_regulators, + }, { .compatible = "motorola,xoom-cpcap-regulator", .data = xoom_regulators, -- cgit v1.2.3 From e84141846decb77d2826e553318a608b256804e5 Mon Sep 17 00:00:00 2001 From: Franz Schnyder Date: Mon, 2 Mar 2026 17:53:56 +0100 Subject: regulator: pf9453: Allow shared IRQ The PF9453 datasheet specifies the IRQ_B pin as an open drain output with level-low behavior. This makes it capable to share the interrupt line. To allow shared interrupts, the driver must handle the case if the interrupt has been triggered by another device. Set IRQF_SHARED to be able to share the interrupt line. If the interrupt has not been triggered by the PMIC, return IRQ_NONE. Signed-off-by: Franz Schnyder Link: https://patch.msgid.link/20260302165357.1797803-3-fra.schnyder@gmail.com Signed-off-by: Mark Brown --- drivers/regulator/pf9453-regulator.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/regulator') 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); -- cgit v1.2.3 From aa3d0c93a333182e887426366a4f3e5f06ee0d83 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 5 Mar 2026 18:46:23 +0000 Subject: regulator: max20411: show failure on register It is easy to use %pe to print a error-pointer so add this to the dev_err() if the devm_regulator_register() fails. Signed-off-by: Ben Dooks Link: https://patch.msgid.link/20260305184623.2603269-1-ben.dooks@codethink.co.uk Signed-off-by: Mark Brown --- drivers/regulator/max20411-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator') 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); } -- cgit v1.2.3 From e80c626ae06ed9c502ebda4a7e0b390af9ccf6b0 Mon Sep 17 00:00:00 2001 From: Felix Gu Date: Thu, 12 Mar 2026 22:30:31 +0800 Subject: regulator: pf1550: Remove redundant regmap assignment The config.regmap is already correctly initialized using dev_get_regmap() on the parent device. Remove the redundant second assignment that was overwriting it with pf1550->regmap. Signed-off-by: Felix Gu Reviewed-by: Frank Li Link: https://patch.msgid.link/20260312-1550-v1-1-5a84b886ccfe@gmail.com Signed-off-by: Mark Brown --- drivers/regulator/pf1550-regulator.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/regulator') 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; -- cgit v1.2.3 From cf4812898b58228d9705a9426e8351360b25c5a4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 10 Mar 2026 17:41:59 -0700 Subject: regulator: da9063: kzalloc + kcalloc to kzalloc Reduce main allocation to a single kzalloc call by using a flexible array member. Allows using __counted_by for extra runtime analysis. Signed-off-by: Rosen Penev Link: https://patch.msgid.link/20260311004159.32374-1-rosenp@gmail.com Signed-off-by: Mark Brown --- drivers/regulator/da9063-regulator.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'drivers/regulator') 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; -- cgit v1.2.3 From 9d4189e68ebad418eed964185d5563a71c67756d Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Tue, 17 Mar 2026 11:22:11 -0400 Subject: regulator: fixed: remove unused reboot.h include The include was added in commit ecb6f1f45614 ("regulator: fixed: add support for under-voltage IRQ") but it was never used. Signed-off-by: Hugo Villeneuve Link: https://patch.msgid.link/20260317152215.3473489-1-hugo@hugovil.com Signed-off-by: Mark Brown --- drivers/regulator/fixed.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/regulator') diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 254c0a8a4555..3b2fddc1c8a3 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 58068932402c7f5bf26489e01ae8e8bb89802d1e Mon Sep 17 00:00:00 2001 From: Robby Cai Date: Fri, 13 Mar 2026 21:31:02 +0800 Subject: regulator: fp9931: Fix handling of mandatory "vin" supply The FP9931 requires a mandatory "vin" power supply to operate. Replace devm_regulator_get_optional() with devm_regulator_get() to enforce this mandatory dependency. Fixes: 12d821bd13d42 ("regulator: Add FP9931/JD9930 driver") Signed-off-by: Robby Cai Link: https://patch.msgid.link/20260313133102.2749890-3-robby.cai@nxp.com Signed-off-by: Mark Brown --- drivers/regulator/fp9931.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator') 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"); -- cgit v1.2.3 From 09a1361db3abfcb76d936aa76820c37e0ee36c04 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Mon, 23 Mar 2026 10:03:35 -0400 Subject: regulator: core: fix typo in comments Replace another->other so that the sentence makes sense. Signed-off-by: Hugo Villeneuve Link: https://patch.msgid.link/20260323140340.105362-1-hugo@hugovil.com Signed-off-by: Mark Brown --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator') 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 -- cgit v1.2.3 From 9150d79c7a8b3287f1dc0108205f067a9249964d Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Mon, 23 Mar 2026 10:02:00 -0400 Subject: regulator: fixed: remove unused macro The macro was added in commit ecb6f1f45614 ("regulator: fixed: add support for under-voltage IRQ") but it was never used. Signed-off-by: Hugo Villeneuve Link: https://patch.msgid.link/20260323140206.104908-1-hugo@hugovil.com Signed-off-by: Mark Brown --- drivers/regulator/fixed.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/regulator') diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 3b2fddc1c8a3..417d282dd4ed 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -29,9 +29,6 @@ #include #include -/* 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; -- cgit v1.2.3 From 411eb30f13823c37cd20d7c0fb7d5c8bdb1d844d Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 20 Mar 2026 16:31:33 +0800 Subject: regulator: cros-ec: Add regulator supply Even a regulator remotely controlled by the EC will have a power supply input. Add the supply property name from the device tree binding to the regulator description. Signed-off-by: Chen-Yu Tsai Link: https://patch.msgid.link/20260320083135.2455444-3-wenst@chromium.org Signed-off-by: Mark Brown --- drivers/regulator/cros-ec-regulator.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/regulator') 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) -- cgit v1.2.3 From 6c2505e185b09e506542956f473631cc09afc403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Svensson?= Date: Fri, 20 Mar 2026 08:33:25 +0100 Subject: regulator: da9121: Allow caching BUCK registers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some BUCK registers may change without software writes when GPIO pins are configured for functions DVC/RELOAD/EN. If the board does not use these pin-controlled features, caching is possible. Caching BUCK registers removes unnecessary I2C reads when performing register updates. For example, updating regulator mode can result in two I2C reads, one from the regulator core regulator_set_mode() and one from the DA9121 driver, where da9121_buck_set_mode() uses regmap_update_bits() (read/modify/write). Check for the optional DT property dlg,no-gpio-control. When present, select the regmap configuration that does not mark the BUCK1 register block (DA9121_REG_BUCK_BUCK1_0..DA9121_REG_BUCK_BUCK1_6) as volatile, so that regmap can cache BUCK1 registers and avoid unnecessary I2C reads. The property dlg,no-gpio-control is required to ensure that BUCK1 registers can be cached, as the absence of relevant GPIO DT properties does not imply that the RELOAD/DVC/EN GPIO functions are unused. These functions are provided by DA91xx GPIO pins and may be controlled by external hardware without corresponding GPIO DT properties. The dlg,no-gpio-control property explicitly indicates that none of these GPIO functions are used. The dlg,no-gpio-control property is mutually exclusive with enable-gpios, regardless of whether the referenced GPIO is connected to a GPIO pin or the IC_EN pin, since pulling IC_EN low powers down the regulator and registers are reinitialized at startup, leaving cached values stale. Co-developed-by: Waqar Hameed Signed-off-by: Waqar Hameed Signed-off-by: AndrĂ© Svensson Link: https://patch.msgid.link/20260320-no-gpio-control-v2-2-dbc938e462cb@axis.com Signed-off-by: Mark Brown --- drivers/regulator/da9121-regulator.c | 43 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'drivers/regulator') 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; -- cgit v1.2.3 From 5a623ef758d0a8384da548bb3f026e623544b2cf Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Mon, 30 Mar 2026 16:14:13 +0200 Subject: regulator: devres: Use enum regulator_get_type in internal functions The enum regulator_get_type has been available since 2017, so use that enum instead of an "untyped" int in the three functions where "get_type" is used. No functional change intended. Suggested-by: Griffin Kroah-Hartman Signed-off-by: Luca Weiss Link: https://patch.msgid.link/20260330-regulator-devres-type-v1-1-d2c244576845@fairphone.com Signed-off-by: Mark Brown --- drivers/regulator/devres.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/regulator') 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; -- cgit v1.2.3 From 292d64fb98a267450113b696f1ffcc24548cc2fe Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Thu, 26 Mar 2026 16:10:49 +0800 Subject: regulator: mt6315: Add regulator supplies The MT6315 family of PMICs has 4 buck regulators. Each regulator has a separate supply. Add these supplies to the driver. Signed-off-by: Chen-Yu Tsai Link: https://patch.msgid.link/20260326081050.1115201-3-wenst@chromium.org Signed-off-by: Mark Brown --- drivers/regulator/mt6315-regulator.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/regulator') 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 = { -- cgit v1.2.3 From 7ea07bc030d8d6395524dec22ff3267441a28c0d Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 8 Apr 2026 09:30:49 +0200 Subject: regulator: bq257xx: fix OF node reference imbalance The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: 981dd162b635 ("regulator: bq257xx: Add bq257xx boost regulator driver") Cc: stable@vger.kernel.org # 6.18 Cc: Chris Morgan Reviewed-by: Douglas Anderson Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260408073055.5183-2-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/bq257xx-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/regulator') diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c index dab8f1ab4450..711dbe045383 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -142,8 +142,7 @@ static int bq257xx_regulator_probe(struct platform_device *pdev) 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) -- cgit v1.2.3 From 65290b24d8a5f0b8cd065201e653db824c4a4da6 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 8 Apr 2026 09:30:50 +0200 Subject: regulator: rk808: fix OF node reference imbalance The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: 647e57351f8e ("regulator: rk808: reduce 'struct rk808' usage") Cc: stable@vger.kernel.org # 6.2 Reviewed-by: Sebastian Reichel Reviewed-by: Douglas Anderson Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260408073055.5183-3-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/rk808-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/regulator') 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) -- cgit v1.2.3 From 2edaf5f7ada0ab5c9ec1f0836bd19779a8d85262 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 8 Apr 2026 09:30:51 +0200 Subject: regulator: max77650: fix OF node reference imbalance The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: bcc61f1c44fd ("regulator: max77650: add regulator support") Cc: stable@vger.kernel.org # 5.1 Reviewed-by: Bartosz Golaszewski Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260408073055.5183-4-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/max77650-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator') 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); -- cgit v1.2.3 From 2f38e96c273e15f5e9f5d1fc2c0cbba703751602 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 8 Apr 2026 09:30:52 +0200 Subject: regulator: mt6357: fix OF node reference imbalance The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: dafc7cde23dc ("regulator: add mt6357 regulator") Cc: stable@vger.kernel.org # 6.2 Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260408073055.5183-5-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/mt6357-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator') 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; -- cgit v1.2.3 From ebe694d67f159899b063eee61bacda4cb825ed7b Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 8 Apr 2026 09:30:53 +0200 Subject: regulator: s2dos05: fix OF node reference imbalance The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: bb2441402392 ("regulator: add s2dos05 regulator support") Cc: stable@vger.kernel.org # 6.18 Cc: Dzmitry Sankouski Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260408073055.5183-6-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/s2dos05-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator') 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; -- cgit v1.2.3 From 0d15ce31375ccef4162f960b34547a821b7619d2 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 8 Apr 2026 09:30:54 +0200 Subject: regulator: act8945a: fix OF node reference imbalance The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: 38c09961048b ("regulator: act8945a: add regulator driver for ACT8945A") Cc: stable@vger.kernel.org # 4.6 Cc: Wenyou Yang Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260408073055.5183-7-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/act8945a-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/regulator') 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], -- cgit v1.2.3 From 8498100ee1d00422b8c5b161b3e332278b92a59a Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 8 Apr 2026 09:30:55 +0200 Subject: regulator: bd9571mwv: fix OF node reference imbalance The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: e85c5a153fe2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver") Cc: stable@vger.kernel.org # 4.12 Cc: Marek Vasut Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260408073055.5183-8-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/bd9571mwv-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/regulator') 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; -- cgit v1.2.3 From aef4d87f2c1fdb87e55ea2cbe3ea47b01b256f57 Mon Sep 17 00:00:00 2001 From: Alexey Charkov Date: Tue, 31 Mar 2026 19:43:39 +0400 Subject: regulator: bq257xx: Remove reference to the parent MFD's dev Drop the ->bq field from the platform data of the bq257xx regulator driver, which was only used to get the regmap of the parent MFD device, and use the regmap from the regulator_dev instead, slimming down the code a bit. Acked-by: Mark Brown Tested-by: Chris Morgan Signed-off-by: Alexey Charkov Link: https://patch.msgid.link/20260331-bq25792-v6-2-0278fba33eb9@flipper.net Signed-off-by: Mark Brown --- drivers/regulator/bq257xx-regulator.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/regulator') diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c index 711dbe045383..fcc2cfd1454b 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -15,7 +15,6 @@ #include 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)); } @@ -137,7 +136,6 @@ 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 = {}; @@ -148,7 +146,6 @@ static int bq257xx_regulator_probe(struct platform_device *pdev) if (!pdata) return -ENOMEM; - pdata->bq = bq; pdata->desc = bq25703_vbus_desc; platform_set_drvdata(pdev, pdata); -- cgit v1.2.3 From de76a763805d0051242b3862823b34d894ec81f9 Mon Sep 17 00:00:00 2001 From: Alexey Charkov Date: Tue, 31 Mar 2026 19:43:41 +0400 Subject: regulator: bq257xx: Make OTG enable GPIO really optional The bindings describe the OTG enable GPIO as optional, but the driver gets upset if it's not provided in the device tree. Make the driver accept the absence of the GPIO, and just use register writes to handle OTG mode in that case, skipping the error message for -ENOENT. Acked-by: Mark Brown Tested-by: Chris Morgan Signed-off-by: Alexey Charkov Link: https://patch.msgid.link/20260331-bq25792-v6-4-0278fba33eb9@flipper.net Signed-off-by: Mark Brown --- drivers/regulator/bq257xx-regulator.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/regulator') diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c index fcc2cfd1454b..09c466052c04 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -127,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; -- cgit v1.2.3 From 606c780b8843731c78c0f6fa0a1c3b99456ca263 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 7 Apr 2026 14:14:05 +0200 Subject: regulator: max77620: drop redundant OF node initialisation The platform device OF node is set unconditionally since commit 6f55c5dd1118 ("regulator: max77620: Use device_set_of_node_from_dev()") so drop the earlier redundant conditional initialisation. Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260407121405.2663004-1-johan@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/max77620-regulator.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/regulator') 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: -- cgit v1.2.3