From: Krzysztof Kozlowski <krzk@kernel.org>
To: Alistair Bell <dev@alistairbell.org>, linux-leds@vger.kernel.org
Cc: lee@kernel.org, pavel@kernel.org
Subject: Re: [PATCH 1/2] leds: Texas Instruments LP5816 driver
Date: Mon, 13 Jul 2026 08:05:12 +0200 [thread overview]
Message-ID: <20b639b7-ba2a-4c06-bfef-970ab2ad3f9b@kernel.org> (raw)
In-Reply-To: <20260712184318.78852-2-dev@alistairbell.org>
On 12/07/2026 20:43, Alistair Bell wrote:
> Add support for Texas Instruments LP5816 4-channel I2C device,
> the driver provides:
>
> - Independent 4-channel control via the multicolor sysfs class
> - Configurable fade effects, duration, fade profile and maximum
> operating current via sysfs
>
> Signed-off-by: Alistair Bell <dev@alistairbell.org>
> ---
> MAINTAINERS | 8 +
> drivers/leds/Kconfig | 12 +
> drivers/leds/Makefile | 1 +
> drivers/leds/leds-lp5816.c | 443 +++++++++++++++++++++++++++++++++++++
> 4 files changed, 464 insertions(+)
> create mode 100644 drivers/leds/leds-lp5816.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f37a81950..b6a8c812a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -26761,6 +26761,14 @@ F: drivers/leds/rgb/Makefile
> F: drivers/leds/rgb/leds-lp5812.c
> F: drivers/leds/rgb/leds-lp5812.h
>
> +TEXAS INSTRUMENTS' LP5816 RGBW LED DRIVER
> +M: Alistair Bell <dev@alistairbell.org>
> +L: linux-leds@vger.kernel.org
> +S: Maintained
> +F: drivers/leds/Kconfig
> +F: drivers/leds/Makefile
> +F: drivers/leds/leds-lp5816.c
> +
> TEXAS INSTRUMENTS' LB8864 LED BACKLIGHT DRIVER
> M: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> L: linux-leds@vger.kernel.org
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index f4a0a3c8c..ce3776adf 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -541,6 +541,18 @@ config LEDS_LP8864
> To compile this driver as a module, choose M here: the
> module will be called leds-lp8864.
>
> +config LEDS_LP5816
> + tristate "LED driver for LP5816 chip"
> + depends on I2C
> + depends on LEDS_CLASS && LEDS_CLASS_MULTICOLOR
> + select REGMAP_I2C
> + help
> + Say Y to enable support for the Texas Instruments LP5816
> + RGBW LED connected via I2C.
> +
> + To compile this driver as a module, choose M here:
> + the module will be called lp5816.
Messed indentation. Please be sure you are sending consistent code, not
something written completely different than the rest.
> +
> 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 7db376891..5ba7de099 100644
> --- a/drivers/leds/Makefile
...
> +
> +static ssize_t max_current_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct led_classdev *cdev;
> + struct lp5816 *chip;
> + int res, val;
> +
> + cdev = dev_get_drvdata(dev);
> + chip = container_of(cdev, struct lp5816, mcdev.led_cdev);
> +
> + res = kstrtoint(buf, 0, &val);
> + if (res < 0)
> + return res;
> + if (val < 0 || val > 1)
> + return -EINVAL;
> +
> + res = lp5816_multi_lock_write(chip, (const struct reg_sequence[]) {
> + { .reg = REG_DEV_CONFIG0, .def = val },
> + { .reg = REG_UPDATE_CMD, .def = UPDATE_CMD } }, 2);
> + return (res < 0) ? res : count;
> +}
You cannot introduce own ABI duplicating existing sysfs interface.
> +
> +static int lp5816_probe(struct i2c_client *client)
> +{
> + struct lp5816 *chip;
> + char *name;
> + int res;
> +
> + chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
> + if (!chip)
> + return dev_err_probe(&client->dev, -ENOMEM,
> + "failed to allocate lp5816 internal structure\n");
Since when any driver has such error message?
Please look at most recently addedd and reviewed drivers and learn from
them how typical code looks like.
Best regards,
Krzysztof
next prev parent reply other threads:[~2026-07-13 6:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-12 18:43 [PATCH 0/2] leds: Introduce Texas Instruments LP5816 LED driver Alistair Bell
2026-07-12 18:43 ` [PATCH 1/2] leds: Texas Instruments LP5816 driver Alistair Bell
2026-07-12 18:59 ` sashiko-bot
2026-07-12 22:16 ` Uwe Kleine-König
2026-07-13 6:05 ` Krzysztof Kozlowski [this message]
2026-07-12 18:43 ` [PATCH 2/2] dt-bindings: leds: Add binding for ti,lp5816 Alistair Bell
2026-07-12 18:59 ` sashiko-bot
2026-07-13 6:01 ` Krzysztof Kozlowski
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=20b639b7-ba2a-4c06-bfef-970ab2ad3f9b@kernel.org \
--to=krzk@kernel.org \
--cc=dev@alistairbell.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@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