Re: [PATCH v1 2/5] media: lm3560: Add IN supply support
From: Svyatoslav Ryhel
Date: Fri Apr 17 2026 - 08:38:54 EST
пт, 17 квіт. 2026 р. о 15:17 Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> пише:
>
> Hi Svyatoslav,
>
> On Fri, Apr 17, 2026 at 02:42:23PM +0300, Svyatoslav Ryhel wrote:
> > Add IN supply (2.5V - 5.5V) found in LM3560 to ensure its proper work.
> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
> > ---
> > drivers/media/i2c/lm3560.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c
> > index e6af61415821..a2674af6c9fb 100644
> > --- a/drivers/media/i2c/lm3560.c
> > +++ b/drivers/media/i2c/lm3560.c
> > @@ -16,6 +16,7 @@
> > #include <linux/slab.h>
> > #include <linux/mutex.h>
> > #include <linux/regmap.h>
> > +#include <linux/regulator/consumer.h>
> > #include <linux/videodev2.h>
> > #include <media/i2c/lm3560.h>
> > #include <media/v4l2-ctrls.h>
> > @@ -434,6 +435,11 @@ static int lm3560_probe(struct i2c_client *client)
> > return dev_err_probe(&client->dev, PTR_ERR(flash->hwen_gpio),
> > "failed to get hwen gpio\n");
> >
> > + rval = devm_regulator_get_enable(&client->dev, "vin");
>
> I'd also enable this via runtime PM.
>
> Sensor drivers such as imx219 serve as a good example here.
>
Would you mind if I squash adding hwen, vin and pm into single commit?
It would be tricky to separate them from PM addition. I will add
descriptions of what was changed.
> > + if (rval)
> > + return dev_err_probe(&client->dev, rval,
> > + "failed to enable regulator\n");
> > +
> > rval = lm3560_subdev_init(flash, LM3560_LED0, "lm3560-led0");
> > if (rval < 0)
> > return rval;
>
> --
> Kind regards,
>
> Sakari Ailus