[PATCH v2 09/11] regulator: wm831x: remove legacy DVS platform data

From: Dmitry Torokhov

Date: Thu Jul 09 2026 - 00:54:46 EST


Now that the only board file in mainline using wm831x buckv DVS has been
converted to use software properties, we can remove the unused legacy
DVS fields from 'struct wm831x_buckv_pdata'. Also remove the fallback
logic from the regulator driver, making DVS support purely
property-based when software nodes are used.

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/regulator/wm831x-dcdc.c | 22 ++++++++++------------
include/linux/mfd/wm831x/pdata.h | 3 ---
2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index ce43c51c0170..05f49b2f5bad 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -336,15 +336,10 @@ static void wm831x_buckv_dvs_init(struct platform_device *pdev,
int dvs_control_src;
u32 val;

- if (!pdata)
+ if (!pdata || !pdata->swnode)
return;

- if (pdata->swnode) {
- struct fwnode_handle *fwnode = software_node_fwnode(pdata->swnode);
-
- if (fwnode)
- device_set_node(&pdev->dev, fwnode);
- }
+ device_set_node(&pdev->dev, software_node_fwnode(pdata->swnode));

/* gpiolib won't let us read the GPIO status so pick the higher
* of the two existing voltages so we take it as platform data.
@@ -352,7 +347,7 @@ static void wm831x_buckv_dvs_init(struct platform_device *pdev,
if (device_property_read_u32(&pdev->dev, "wlf,dvs-init-state", &val) == 0)
dcdc->dvs_gpio_state = val;
else
- dcdc->dvs_gpio_state = pdata->dvs_init_state;
+ dcdc->dvs_gpio_state = 0;

dcdc->dvs_gpiod = devm_gpiod_get(&pdev->dev, "dvs",
dcdc->dvs_gpio_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
@@ -362,10 +357,13 @@ static void wm831x_buckv_dvs_init(struct platform_device *pdev,
return;
}

- if (device_property_read_u32(&pdev->dev, "wlf,dvs-control-src", &val) == 0)
- dvs_control_src = val;
- else
- dvs_control_src = pdata->dvs_control_src;
+ ret = device_property_read_u32(&pdev->dev, "wlf,dvs-control-src", &val);
+ if (ret) {
+ dev_err(wm831x->dev, "Failed to read DVS control source for %s: %d\n",
+ dcdc->name, ret);
+ return;
+ }
+ dvs_control_src = val;

switch (dvs_control_src) {
case 1:
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index d73a04c82ca1..c48333552f5a 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -48,9 +48,6 @@ struct wm831x_battery_pdata {
* I2C or SPI buses.
*/
struct wm831x_buckv_pdata {
- int dvs_control_src; /** Hardware DVS source to use (1 or 2) */
- int dvs_init_state; /** DVS state to expect on startup */
- int dvs_state_gpio; /** CPU GPIO to use for monitoring status */
const struct software_node *swnode; /** Software node for properties */
};


--
2.55.0.795.g602f6c329a-goog