[PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support

From: Shashank Maurya

Date: Fri Aug 28 2026 - 00:30:00 EST


The Raspberry Pi Panel V2 regulator driver may rely on an external
power rail being provided through the device tree. Add support for an
optional "vcc" regulator and enable it during probe before accessing
the panel controller.

This ensures the panel controller is powered before I2C communication
is attempted while maintaining backward compatibility with existing
platforms.

Signed-off-by: Shashank Maurya <shashank.maurya@xxxxxxxxxxxxxxxx>
---
drivers/regulator/rpi-panel-v2-regulator.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/drivers/regulator/rpi-panel-v2-regulator.c b/drivers/regulator/rpi-panel-v2-regulator.c
index 30b78aa75ee3..4e84f05f6811 100644
--- a/drivers/regulator/rpi-panel-v2-regulator.c
+++ b/drivers/regulator/rpi-panel-v2-regulator.c
@@ -11,6 +11,7 @@
#include <linux/module.h>
#include <linux/pwm.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>

/* I2C registers of the microcontroller. */
#define REG_ID 0x01
@@ -66,10 +67,27 @@ static int rpi_panel_v2_i2c_probe(struct i2c_client *i2c)
.parent = &i2c->dev,
.reg_set_base = REG_POWERON,
};
+ struct regulator *vcc;
struct regmap *regmap;
struct pwm_chip *pc;
int ret;

+ vcc = devm_regulator_get_optional(&i2c->dev, "vcc");
+ if (IS_ERR(vcc)) {
+ ret = PTR_ERR(vcc);
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ /* vcc-supply is optional, proceed without it */
+ vcc = NULL;
+ }
+
+ if (vcc) {
+ ret = regulator_enable(vcc);
+ if (ret)
+ return dev_err_probe(&i2c->dev, ret,
+ "Failed to enable vcc supply\n");
+ }
+
pc = devm_pwmchip_alloc(&i2c->dev, 1, 0);
if (IS_ERR(pc))
return PTR_ERR(pc);

---
base-commit: bd2a0c2d8c49ffb7acfcb0c1177af355ea417caf
change-id: 20260828-rpi_reg-3f9db1057567

Best regards,
--
Shashank Maurya <shashank.maurya@xxxxxxxxxxxxxxxx>