From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v2 5/5] media: i2c: lm3560: Add support for PM features
Date: Tue, 21 Apr 2026 22:59:33 +0300 [thread overview]
Message-ID: <aefXJebe2F4Z193F@kekkonen.localdomain> (raw)
In-Reply-To: <CAPVz0n1sNoJv=JcAZdv3srRY0vecrRO0spnqg58-VLnYdkfPSw@mail.gmail.com>
Hi Svyatoslav,
On Tue, Apr 21, 2026 at 08:32:16PM +0300, Svyatoslav Ryhel wrote:
> вт, 21 квіт. 2026 р. о 19:44 Sakari Ailus <sakari.ailus@linux.intel.com> пише:
> >
> > Hi Shyvatoslav,
> >
> > On Sun, Apr 19, 2026 at 12:34:12PM +0300, Svyatoslav Ryhel wrote:
> > > @@ -403,6 +423,60 @@ static int lm3560_init_device(struct lm3560_flash *flash)
> > > return rval;
> > > }
> > >
> > > +static void lm3560_power_off(struct lm3560_flash *flash)
> > > +{
> > > + gpiod_set_value_cansleep(flash->hwen_gpio, 0);
> > > + regulator_disable(flash->vin_supply);
> > > +}
> > > +
> > > +static int lm3560_power_on(struct lm3560_flash *flash)
> > > +{
> > > + int rval;
> > > +
> > > + rval = regulator_enable(flash->vin_supply);
> > > + if (rval < 0) {
> > > + dev_err(flash->dev, "failed to enable vin power supply\n");
> > > + return rval;
> > > + }
> > > +
> > > + gpiod_set_value_cansleep(flash->hwen_gpio, 1);
> > > +
> > > + rval = lm3560_init_device(flash);
> > > + if (rval < 0) {
> > > + lm3560_power_off(flash);
> > > + return rval;
> > > + }
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static int __maybe_unused lm3560_pm_runtime_resume(struct device *dev)
> > > +{
> > > + struct lm3560_flash *flash = dev_get_drvdata(dev);
> > > +
> > > + return lm3560_power_on(flash);
> > > +}
> > > +
> > > +static int __maybe_unused lm3560_pm_runtime_suspend(struct device *dev)
> >
> > Could you change lm3560_power_o{n,ff}() take struct device pointer as the
> > argument?
> >
>
> What benefit it will bring? Unless you propose to use on/off functions
> in pm directly, I don't see any benefit in this change.
You get rid of two redundant wrappers.
>
> > > +{
> > > + struct lm3560_flash *flash = dev_get_drvdata(dev);
> > > +
> > > + lm3560_power_off(flash);
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static void lm3560_subdev_cleanup(struct lm3560_flash *flash)
> > > +{
> > > + unsigned int i;
> > > +
> > > + for (i = LM3560_LED0; i < LM3560_LED_MAX; i++) {
> >
> > You could define i here.
> >
>
> You mean:
> for (unsigned int i = LM3560_LED0; i < LM3560_LED_MAX; i++)?
>
> If yes, I would like to keep it as is, it looks cleaner to me, and
> this part was transferred from remove as is.
Works for me.
--
Regards,
Sakari Ailus
prev parent reply other threads:[~2026-04-21 19:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-19 9:34 [PATCH v2 0/5] media: lm3560: convert to use OF bindings Svyatoslav Ryhel
2026-04-19 9:34 ` [PATCH v2 1/5] dt-bindings: leds: Document TI LM3560 Synchronous Boost Flash Driver Svyatoslav Ryhel
2026-04-20 16:20 ` Conor Dooley
2026-04-20 16:35 ` Svyatoslav Ryhel
2026-04-20 16:38 ` Sakari Ailus
2026-04-19 9:34 ` [PATCH v2 2/5] media: i2c: lm3560: Fix v4l2 subdev registration Svyatoslav Ryhel
2026-04-19 9:34 ` [PATCH v2 3/5] media: i2c: lm3560: Optimize mutex lock usage Svyatoslav Ryhel
2026-04-19 9:34 ` [PATCH v2 4/5] media: i2c: lm3560: Convert to use OF bindings Svyatoslav Ryhel
2026-04-19 9:34 ` [PATCH v2 5/5] media: i2c: lm3560: Add support for PM features Svyatoslav Ryhel
2026-04-21 16:44 ` Sakari Ailus
2026-04-21 17:32 ` Svyatoslav Ryhel
2026-04-21 19:59 ` Sakari Ailus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aefXJebe2F4Z193F@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pavel@kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox