From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Jean-Jacques Hiblot <jjhiblot@traphandler.com>,
lee.jones@linaro.org, pavel@ucw.cz, robh+dt@kernel.org,
sven.schwermer@disruptive-technologies.com,
krzysztof.kozlowski+dt@linaro.org
Cc: johan+linaro@kernel.org, marijn.suijten@somainline.org,
bjorn.andersson@linaro.org, andy.shevchenko@gmail.com,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 6/6] leds: Add a multicolor LED driver to group monochromatic LEDs
Date: Sun, 6 Nov 2022 14:57:59 +0100 [thread overview]
Message-ID: <1ca5fc04-f16b-f98a-0373-c61c258aa8bd@gmail.com> (raw)
In-Reply-To: <20221028170308.2676734-7-jjhiblot@traphandler.com>
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@traphandler.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@traphandler.com>");
> +MODULE_DESCRIPTION("multi-color LED group driver");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:leds-group-multicolor");
--
Best regards,
Jacek Anaszewski
prev parent reply other threads:[~2022-11-06 13:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 17:03 [PATCH v5 0/6] Add a multicolor LED driver for groups of monochromatic LEDs Jean-Jacques Hiblot
2022-10-28 17:03 ` [PATCH v5 1/6] devres: provide devm_krealloc_array() Jean-Jacques Hiblot
2022-10-28 17:03 ` [PATCH v5 2/6] leds: class: simplify the implementation of devm_of_led_get() Jean-Jacques Hiblot
2022-10-28 17:03 ` [PATCH v5 3/6] leds: provide devm_of_led_get_optional() Jean-Jacques Hiblot
2022-10-28 17:03 ` [PATCH v5 4/6] leds: class: store the color index in struct led_classdev Jean-Jacques Hiblot
2022-10-28 17:03 ` [PATCH v5 5/6] dt-bindings: leds: Add binding for a multicolor group of LEDs Jean-Jacques Hiblot
2022-10-28 17:03 ` [PATCH v5 6/6] leds: Add a multicolor LED driver to group monochromatic LEDs Jean-Jacques Hiblot
2022-11-06 13:57 ` Jacek Anaszewski [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=1ca5fc04-f16b-f98a-0373-c61c258aa8bd@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=jjhiblot@traphandler.com \
--cc=johan+linaro@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
--cc=sven.schwermer@disruptive-technologies.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;
as well as URLs for NNTP newsgroup(s).