[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1ca5fc04-f16b-f98a-0373-c61c258aa8bd@gmail.com>
Date: Sun, 6 Nov 2022 14:57:59 +0100
From: Jacek Anaszewski <jacek.anaszewski@...il.com>
To: Jean-Jacques Hiblot <jjhiblot@...phandler.com>,
lee.jones@...aro.org, pavel@....cz, robh+dt@...nel.org,
sven.schwermer@...ruptive-technologies.com,
krzysztof.kozlowski+dt@...aro.org
Cc: johan+linaro@...nel.org, marijn.suijten@...ainline.org,
bjorn.andersson@...aro.org, andy.shevchenko@...il.com,
linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 6/6] leds: Add a multicolor LED driver to group
monochromatic LEDs
Hi Jean,
On 10/28/22 19:03, Jean-Jacques Hiblot wrote:
> By allowing to group multiple monochrome LED into multicolor LEDs,
> all involved LEDs can be controlled in-sync. This enables using effects
> using triggers, etc.
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@...phandler.com>
> ---
> drivers/leds/rgb/Kconfig | 10 ++
> drivers/leds/rgb/Makefile | 1 +
> drivers/leds/rgb/leds-group-multicolor.c | 154 +++++++++++++++++++++++
> 3 files changed, 165 insertions(+)
> create mode 100644 drivers/leds/rgb/leds-group-multicolor.c
>
> diff --git a/drivers/leds/rgb/Kconfig b/drivers/leds/rgb/Kconfig
> index 204cf470beae..1a87f53faa8a 100644
> --- a/drivers/leds/rgb/Kconfig
> +++ b/drivers/leds/rgb/Kconfig
> @@ -2,6 +2,16 @@
>
[...]
> +
> + for (i = 0; i < count; i++) {
> + struct led_classdev *led_cdev = priv->monochromatics[i];
> +
> + /* Make the sysfs of the monochromatic LED read-only */
> + led_cdev->flags |= LED_SYSFS_DISABLE;
Clearing these on remove is needed as well.
> + }
> +
> + return 0;
> +}
> +
> +static const struct of_device_id of_led_mcg_match[] = {
> + { .compatible = "leds-group-multicolor" },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, of_led_mcg_match);
> +
> +static struct platform_driver led_mcg_driver = {
> + .probe = led_mcg_probe,
> + .driver = {
> + .name = "leds_group_multicolor",
> + .of_match_table = of_led_mcg_match,
> + }
> +};
> +module_platform_driver(led_mcg_driver);
> +
> +MODULE_AUTHOR("Jean-Jacques Hiblot <jjhiblot@...phandler.com>");
> +MODULE_DESCRIPTION("multi-color LED group driver");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:leds-group-multicolor");
--
Best regards,
Jacek Anaszewski
Powered by blists - more mailing lists