public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Kaustabh Chakraborty <kauschluss@disroot.org>
Cc: "Pavel Machek" <pavel@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"MyungJoo Ham" <myungjoo.ham@samsung.com>,
	"Chanwoo Choi" <cw00.choi@samsung.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"André Draszik" <andre.draszik@linaro.org>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Nam Tran" <trannamatk@gmail.com>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org, linux-rtc@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH v3 09/13] leds: flash: add support for Samsung S2M series PMIC flash LED device
Date: Wed, 25 Mar 2026 14:58:45 +0000	[thread overview]
Message-ID: <20260325145845.GC1141718@google.com> (raw)
In-Reply-To: <DH1XVOS6IIOE.HGIH6JQRHNAM@disroot.org>

On Sat, 14 Mar 2026, Kaustabh Chakraborty wrote:

> On 2026-03-10 11:38 +00:00, Lee Jones wrote:
> > On Wed, 25 Feb 2026, Kaustabh Chakraborty wrote:
> >
> >> Add support for flash LEDs found in certain Samsung S2M series PMICs.
> >> The device has two channels for LEDs, typically for the back and front
> >> cameras in mobile devices. Both channels can be independently
> >> controlled, and can be operated in torch or flash modes.
> >> 
> >> The driver includes initial support for the S2MU005 PMIC flash LEDs.
> >> 
> >> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
> >> ---
> >>  drivers/leds/flash/Kconfig          |  12 +
> >>  drivers/leds/flash/Makefile         |   1 +
> >>  drivers/leds/flash/leds-s2m-flash.c | 429 ++++++++++++++++++++++++++++++++++++
> >>  3 files changed, 442 insertions(+)
> >> 
> >> diff --git a/drivers/leds/flash/Kconfig b/drivers/leds/flash/Kconfig
> >> index 5e08102a67841..be62e05277429 100644
> >> --- a/drivers/leds/flash/Kconfig
> >> +++ b/drivers/leds/flash/Kconfig
> >> @@ -114,6 +114,18 @@ config LEDS_RT8515
> >>  	  To compile this driver as a module, choose M here: the module
> >>  	  will be called leds-rt8515.
> >>  
> >> +config LEDS_S2M_FLASH
> >> +	tristate "Samsung S2M series PMICs flash/torch LED support"
> >> +	depends on LEDS_CLASS
> >> +	depends on MFD_SEC_CORE
> >> +	depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS
> >> +	select REGMAP_IRQ
> >> +	help
> >> +	  This option enables support for the flash/torch LEDs found in
> >> +	  certain Samsung S2M series PMICs, such as the S2MU005. It has
> >> +	  a LED channel dedicated for every physical LED. The LEDs can
> >> +	  be controlled in flash and torch modes.
> >> +
> >>  config LEDS_SGM3140
> >>  	tristate "LED support for the SGM3140"
> >>  	depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS
> >> diff --git a/drivers/leds/flash/Makefile b/drivers/leds/flash/Makefile
> >> index 712fb737a428e..44e6c1b4beb37 100644
> >> --- a/drivers/leds/flash/Makefile
> >> +++ b/drivers/leds/flash/Makefile
> >> @@ -10,6 +10,7 @@ obj-$(CONFIG_LEDS_MAX77693)	+= leds-max77693.o
> >>  obj-$(CONFIG_LEDS_QCOM_FLASH)	+= leds-qcom-flash.o
> >>  obj-$(CONFIG_LEDS_RT4505)	+= leds-rt4505.o
> >>  obj-$(CONFIG_LEDS_RT8515)	+= leds-rt8515.o
> >> +obj-$(CONFIG_LEDS_S2M_FLASH)	+= leds-s2m-flash.o
> >>  obj-$(CONFIG_LEDS_SGM3140)	+= leds-sgm3140.o
> >>  obj-$(CONFIG_LEDS_SY7802)	+= leds-sy7802.o
> >>  obj-$(CONFIG_LEDS_TPS6131X)	+= leds-tps6131x.o

[...]

> >> +static int s2mu005_fled_torch_brightness_set(struct led_classdev *cdev,
> >> +					     enum led_brightness value)
> >> +{
> >> +	struct s2m_fled *priv = to_led_priv(to_cdev_flash(cdev));
> >> +	struct regmap *regmap = priv->regmap;
> >> +	int ret;
> >> +
> >> +	mutex_lock(&priv->lock);
> >> +
> >> +	if (value == LED_OFF) {
> >
> > These defines are deprecated.
> >
> > From include/linux/leds.h:
> >
> > /* This is obsolete/useless. We now support variable maximum brightness. */
> > enum led_brightness {
> >         LED_OFF         = 0,
> >         LED_ON          = 1,
> >         LED_HALF        = 127,
> >         LED_FULL        = 255,
> > };
> >
> 
> Let me know what am I supposed to use then. The
> brightness_set_blocking() function is defined as such:
> 
> 	int (*brightness_set_blocking)(struct led_classdev *led_cdev,
> 				       enum led_brightness brightness);
> 
> Which has enum led_brightness as one of its params.
> 
> Do I just ignore the 'obsolete' param for now and replace ` == LED_OFF`
> with a logical NOT?

I'm pretty sure most places just treat this as a u8 these days.

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2026-03-25 14:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 19:15 [PATCH v3 00/13] Support for Samsung S2MU005 PMIC and its sub-devices Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 01/13] dt-bindings: leds: document Samsung S2M series PMIC flash LED device Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 02/13] dt-bindings: leds: document Samsung S2M series PMIC RGB " Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 03/13] dt-bindings: extcon: document Samsung S2M series PMIC extcon device Kaustabh Chakraborty
2026-02-27 15:11   ` Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 04/13] dt-bindings: power: supply: document Samsung S2M series PMIC charger device Kaustabh Chakraborty
2026-02-25 10:44   ` Krzysztof Kozlowski
2026-02-27 14:26     ` Kaustabh Chakraborty
2026-03-06  0:50       ` Rob Herring
2026-03-08 12:13         ` Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 05/13] dt-bindings: mfd: s2mps11: add documentation for S2MU005 PMIC Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 06/13] mfd: sec: add support " Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 07/13] mfd: sec: set DMA coherent mask Kaustabh Chakraborty
2026-03-06  7:03   ` André Draszik
2026-02-24 19:15 ` [PATCH v3 08/13] mfd: sec: resolve PMIC revision in S2MU005 Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 09/13] leds: flash: add support for Samsung S2M series PMIC flash LED device Kaustabh Chakraborty
2026-03-10 11:38   ` Lee Jones
2026-03-13 20:33     ` Kaustabh Chakraborty
2026-03-25 14:58       ` Lee Jones [this message]
2026-02-24 19:15 ` [PATCH v3 10/13] leds: rgb: add support for Samsung S2M series PMIC RGB " Kaustabh Chakraborty
2026-03-10 11:48   ` Lee Jones
2026-02-24 19:15 ` [PATCH v3 11/13] Documentation: leds: document pattern behavior of Samsung S2M series PMIC RGB LEDs Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 12/13] extcon: add support for Samsung S2M series PMIC extcon devices Kaustabh Chakraborty
2026-02-24 19:15 ` [PATCH v3 13/13] power: supply: add support for Samsung S2M series PMIC charger device Kaustabh Chakraborty

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=20260325145845.GC1141718@google.com \
    --to=lee@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andre.draszik@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kauschluss@disroot.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=pavel@kernel.org \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=sre@kernel.org \
    --cc=trannamatk@gmail.com \
    /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