* [PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support
@ 2026-08-28 4:29 Shashank Maurya
2026-08-28 12:13 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Shashank Maurya @ 2026-08-28 4:29 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: linux-kernel, venkata.valluru, Jessica Zhang, Shashank Maurya
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@oss.qualcomm.com>
---
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@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support
2026-08-28 4:29 [PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support Shashank Maurya
@ 2026-08-28 12:13 ` Mark Brown
2026-08-31 6:14 ` Shashank Maurya
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2026-08-28 12:13 UTC (permalink / raw)
To: Shashank Maurya
Cc: Liam Girdwood, linux-kernel, venkata.valluru, Jessica Zhang
[-- Attachment #1: Type: text/plain, Size: 566 bytes --]
On Fri, Aug 28, 2026 at 09:59:43AM +0530, Shashank Maurya wrote:
> 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.
Does the device work without power? A name like "Vcc" makes it sound
like this is the main supply for the device...
> ---
> drivers/regulator/rpi-panel-v2-regulator.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
There's no bindings update here.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support
2026-08-28 12:13 ` Mark Brown
@ 2026-08-31 6:14 ` Shashank Maurya
2026-09-02 15:48 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Shashank Maurya @ 2026-08-31 6:14 UTC (permalink / raw)
To: Mark Brown; +Cc: Liam Girdwood, linux-kernel, venkata.valluru, Jessica Zhang
On Fri, Aug 28, 2026 at 01:13:42PM +0100, Mark Brown wrote:
> On Fri, Aug 28, 2026 at 09:59:43AM +0530, Shashank Maurya wrote:
> > 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.
>
> Does the device work without power? A name like "Vcc" makes it sound
> like this is the main supply for the device...
No without VCC, regulator will not be up. So device will not work if
power rail is software controlled and not always high.
> > ---
> > drivers/regulator/rpi-panel-v2-regulator.c | 18 ++++++++++++++++++
> > 1 file changed, 18 insertions(+)
>
> There's no bindings update here.
We will add bindings in next revision of patch.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support
2026-08-31 6:14 ` Shashank Maurya
@ 2026-09-02 15:48 ` Mark Brown
2026-09-05 4:38 ` Shashank Maurya
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2026-09-02 15:48 UTC (permalink / raw)
To: Shashank Maurya
Cc: Liam Girdwood, linux-kernel, venkata.valluru, Jessica Zhang
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
On Mon, Aug 31, 2026 at 11:44:08AM +0530, Shashank Maurya wrote:
> On Fri, Aug 28, 2026 at 01:13:42PM +0100, Mark Brown wrote:
> > On Fri, Aug 28, 2026 at 09:59:43AM +0530, Shashank Maurya wrote:
> > > 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.
> > Does the device work without power? A name like "Vcc" makes it sound
> > like this is the main supply for the device...
> No without VCC, regulator will not be up. So device will not work if
> power rail is software controlled and not always high.
That doesn't sound very optional then.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support
2026-09-02 15:48 ` Mark Brown
@ 2026-09-05 4:38 ` Shashank Maurya
0 siblings, 0 replies; 5+ messages in thread
From: Shashank Maurya @ 2026-09-05 4:38 UTC (permalink / raw)
To: Mark Brown; +Cc: Liam Girdwood, linux-kernel, venkata.valluru, Jessica Zhang
On Wed, Sep 02, 2026 at 04:48:33PM +0100, Mark Brown wrote:
> On Mon, Aug 31, 2026 at 11:44:08AM +0530, Shashank Maurya wrote:
> > On Fri, Aug 28, 2026 at 01:13:42PM +0100, Mark Brown wrote:
> > > On Fri, Aug 28, 2026 at 09:59:43AM +0530, Shashank Maurya wrote:
>
> > > > 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.
>
> > > Does the device work without power? A name like "Vcc" makes it sound
> > > like this is the main supply for the device...
>
> > No without VCC, regulator will not be up. So device will not work if
> > power rail is software controlled and not always high.
>
> That doesn't sound very optional then.
Apologies I missed below discussion over the list.
>> Yes Mark, this isn't optional on qualcomm boards. But it might be optional
>> for boards where power up logic is hardware controlled or always high.
>That's not how regulators work - with regulators the driver is
>independent of the specific system it runs on, the machine constraints
>deal with any system specifics.
>Please don't take things off-list unless there is a really strong reason
>to do so. Sending things to the list ensures that everyone gets a
>chance to read and comment on things.
Going forward, I'll make vcc sipply compulsory then.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-05 4:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-28 4:29 [PATCH] regulator: rpi-panel-v2: Add optional vcc-supply support Shashank Maurya
2026-08-28 12:13 ` Mark Brown
2026-08-31 6:14 ` Shashank Maurya
2026-09-02 15:48 ` Mark Brown
2026-09-05 4:38 ` Shashank Maurya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®