[PATCH v4 2/2] leds: lp8864: New driver
Sverdlin, Alexander
alexander.sverdlin at siemens.com
Tue Dec 17 17:26:24 UTC 2024
Hi Andrew!
On Tue, 2024-12-17 at 09:56 -0600, Andrew Davis wrote:
> On 12/17/24 7:37 AM, A. Sverdlin wrote:
> > From: Alexander Sverdlin <alexander.sverdlin at 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 at siemens.com>
> > ---
> > Changelog:
> > v4:
> > - better separated comments from register defines
> > - removed NULL from fault text arrays for two regs with odd-even structure
> > - changed HW fault printf from errors to warnings
> > - renamed "buf" -> "val"
> > - reflowed the code with up to 100 symbols per line
> > - added comments for 8<->16-bit linear scaling in set/get callbacks
> > - removed register names from error messages
> > 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 | 296 +++++++++++++++++++++++++++++++++++++
> > 4 files changed, 316 insertions(+)
> > create mode 100644 drivers/leds/leds-lp8864.c
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index b332995b3350..d4268a3bbc5a 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -23322,6 +23322,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 at siemens.com>
> > +L: linux-leds at 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 at ti.com>
> > M: Tero Kristo <kristo at kernel.org>
> > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > index 3bf51a4e01d7..5dde8f46100c 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -513,6 +513,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 e7982938ddc1..8a2caa48343b 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
> > obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o
> > obj-$(CONFIG_LEDS_MAX5970) += leds-max5970.o
> > obj-$(CONFIG_LEDS_MAX77650) += leds-max77650.o
> > diff --git a/drivers/leds/leds-lp8864.c b/drivers/leds/leds-lp8864.c
> > new file mode 100644
> > index 000000000000..9ee9e5e0df3c
> > --- /dev/null
> > +++ b/drivers/leds/leds-lp8864.c
> > @@ -0,0 +1,296 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +/*
> > + * TI LP8864/LP8866 4/6 Channel LED Driver
> > + *
> > + * Copyright (C) 2024 Siemens AG
> > + *
> > + * Based on LP8860 driver by Dan Murphy <dmurphy at ti.com>
> > + */
> > +
> > +#include <linux/gpio/consumer.h>
> > +#include <linux/i2c.h>
> > +#include <linux/init.h>
> > +#include <linux/leds.h>
> > +#include <linux/module.h>
> > +#include <linux/mutex.h>
> > +#include <linux/of.h>
> > +#include <linux/regmap.h>
> > +#include <linux/regulator/consumer.h>
> > +#include <linux/slab.h>
> > +
> > +#define LP8864_BRT_CONTROL 0x00
> > +#define LP8864_USER_CONFIG1 0x04
> > +#define LP8864_BRT_MODE_MASK GENMASK(9, 8)
> > +#define LP8864_BRT_MODE_REG BIT(9) /* Brightness control by DISPLAY_BRT reg */
> > +#define LP8864_SUPPLY_STATUS 0x0e
> > +#define LP8864_BOOST_STATUS 0x10
> > +#define LP8864_LED_STATUS 0x12
> > +#define LP8864_LED_STATUS_WR_MASK GENMASK(14, 9 /* Writeable bits in the LED_STATUS reg */
>
> Missing the closing ) ?
Thanks for the review!
Seems that my testing went seriously wrong :[ ]
--
Alexander Sverdlin
Siemens AG
www.siemens.com
More information about the dri-devel
mailing list