Linux LED subsystem development
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "lee@kernel.org" <lee@kernel.org>
Cc: "jingoohan1@gmail.com" <jingoohan1@gmail.com>,
	"afd@ti.com" <afd@ti.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"danielt@kernel.org" <danielt@kernel.org>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"pavel@ucw.cz" <pavel@ucw.cz>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>
Subject: Re: [PATCH v3 2/2] leds: lp8864: New driver
Date: Thu, 12 Dec 2024 20:01:42 +0000	[thread overview]
Message-ID: <1099b6964d39ceaea04719b32b366e4bf3d7b30a.camel@siemens.com> (raw)
In-Reply-To: <20241212185926.GL7139@google.com>

Hi Lee!

On Thu, 2024-12-12 at 18:59 +0000, Lee Jones wrote:
> On Mon, 09 Dec 2024, A. Sverdlin wrote:
> 
> > From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> > 
> > Add driver for TI LP8864, LP8864S, LP8866 4/6 channel LED-backlight drivers
> > with I2C interface.
> > 
> > Link: https://www.ti.com/lit/gpn/lp8864-q1
> > Link: https://www.ti.com/lit/gpn/lp8864s-q1
> > Link: https://www.ti.com/lit/gpn/lp8866-q1
> > Link: https://www.ti.com/lit/gpn/lp8866s-q1
> > Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> > ---
> > Changelog:
> > v3:
> > - dropped lp8864_init(), REGCACHE_NONE, %pe in dev_err_probe(),
> >    i2c_set_clientdata()
> > - added devm_add_action_or_reset() return value check, dev_err_probe() after
> >    devm_regmap_init_i2c()
> > v2: no changes
> > 
> >   MAINTAINERS                |   7 +
> >   drivers/leds/Kconfig       |  12 ++
> >   drivers/leds/Makefile      |   1 +
> >   drivers/leds/leds-lp8864.c | 308 +++++++++++++++++++++++++++++++++++++
> >   4 files changed, 328 insertions(+)
> >   create mode 100644 drivers/leds/leds-lp8864.c
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 21f855fe468bc..a89f0b9d991fb 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -23262,6 +23262,13 @@ S:	Supported
> >   F:	Documentation/devicetree/bindings/iio/dac/ti,dac7612.yaml
> >   F:	drivers/iio/dac/ti-dac7612.c
> >   
> > +TEXAS INSTRUMENTS' LB8864 LED BACKLIGHT DRIVER
> > +M:	Alexander Sverdlin <alexander.sverdlin@siemens.com>
> > +L:	linux-leds@vger.kernel.org
> > +S:	Maintained
> > +F:	Documentation/devicetree/bindings/leds/backlight/ti,lp8864.yaml
> > +F:	drivers/leds/leds-lp8864.c
> > +
> >   TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
> >   M:	Nishanth Menon <nm@ti.com>
> >   M:	Tero Kristo <kristo@kernel.org>
> > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > index b784bb74a8378..6d0e88e501614 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -511,6 +511,18 @@ config LEDS_LP8860
> >   	  on the LP8860 4 channel LED driver using the I2C communication
> >   	  bus.
> >   
> > +config LEDS_LP8864
> > +	tristate "LED support for the TI LP8864/LP8866 4/6 channel LED drivers"
> > +	depends on LEDS_CLASS && I2C && OF
> > +	select REGMAP_I2C
> > +	help
> > +	  If you say yes here you get support for the TI LP8864-Q1,
> > +	  LP8864S-Q1, LP8866-Q1, LP8866S-Q1 4/6 channel LED backlight
> > +	  drivers with I2C interface.
> > +
> > +	  To compile this driver as a module, choose M here: the
> > +	  module will be called leds-lp8864.
> > +
> >   config LEDS_CLEVO_MAIL
> >   	tristate "Mail LED on Clevo notebook"
> >   	depends on LEDS_CLASS && BROKEN
> > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > index 18afbb5a23ee5..f66bf2e13665f 100644
> > --- a/drivers/leds/Makefile
> > +++ b/drivers/leds/Makefile
> > @@ -57,6 +57,7 @@ obj-$(CONFIG_LEDS_LP55XX_COMMON)	+= leds-lp55xx-common.o
> >   obj-$(CONFIG_LEDS_LP8501)		+= leds-lp8501.o
> >   obj-$(CONFIG_LEDS_LP8788)		+= leds-lp8788.o
> 
> >   obj-$(CONFIG_LEDS_LP8860)		+= leds-lp8860.o
> > +obj-$(CONFIG_LEDS_LP8864)		+= leds-lp8864.o
> 
> How different are these two devices?  Do you need a new driver?

From the marketing perspective these are similar devices, but it turns out the
implementation is very different, new devices are much simpler, they
don't have "cluster mode", only one global brightness. No user-accessible EEPROM
(handling of which feels like 60% of the 8860 driver).
The only similar thing is the register name to control brightness, but register
map is completely different, with 16-bit wide registers instead of 8 in the
legacy devices. I actually made a diff between them, only couple of boilerplate
lines remain from the original one. There would be no code reuse from the original
driver if I'd add the support into 8860.

Thank you for your review, I'll incorporate your comments into v4!

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

      reply	other threads:[~2024-12-12 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09  8:45 [PATCH v3 0/2] leds: TI LP8864/LP8866 support A. Sverdlin
2024-12-09  8:45 ` [PATCH v3 1/2] dt-bindings: backlight: add TI LP8864/LP8866 LED-backlight drivers A. Sverdlin
2024-12-17 13:12   ` Rob Herring (Arm)
2024-12-09  8:45 ` [PATCH v3 2/2] leds: lp8864: New driver A. Sverdlin
2024-12-09 14:07   ` Andrew Davis
2024-12-12 18:59   ` Lee Jones
2024-12-12 20:01     ` Sverdlin, Alexander [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=1099b6964d39ceaea04719b32b366e4bf3d7b30a.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=afd@ti.com \
    --cc=conor+dt@kernel.org \
    --cc=danielt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --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