linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Manuel Schönlaub" <manuel.schoenlaub@gmail.com>
Cc: lains@riseup.net, jikos@kernel.org,
	benjamin.tissoires@redhat.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: logitech-hidpp: support Color LED feature (8071).
Date: Wed, 23 Mar 2022 22:04:23 +0100	[thread overview]
Message-ID: <20220323210423.GA10741@duo.ucw.cz> (raw)
In-Reply-To: <Yifr4etBFPu1a2Ct@hermes>

[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

Hi!

> The HID++ protocol allows to set multicolor (RGB) to a static color.
> Multiple of such LED zones per device are supported.
> This patch exports said LEDs so that they can be set from userspace.
> 
> Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>

Please cc LEDs stuff to the LED lists.

> +static int hidpp_mc_led_register(struct hidpp_device *hidpp_dev,
> +				 struct led_classdev_mc *mc_dev,
> +				 int zone)
> +{
> +	struct hid_device *hdev = hidpp_dev->hid_dev;
> +	struct mc_subled *mc_led_info;
> +	struct led_classdev *cdev;
> +	int ret;
> +
> +	mc_led_info = devm_kmalloc_array(&hdev->dev, 3,
> +					 sizeof(*mc_led_info),
> +					 GFP_KERNEL | __GFP_ZERO);
> +	if (!mc_led_info)
> +		return -ENOMEM;
> +
> +	mc_led_info[0].color_index = LED_COLOR_ID_RED;
> +	mc_led_info[1].color_index = LED_COLOR_ID_GREEN;
> +	mc_led_info[2].color_index = LED_COLOR_ID_BLUE;
> +
> +	mc_dev->subled_info = mc_led_info;
> +	mc_dev->num_colors = 3;
> +
> +	cdev = &mc_dev->led_cdev;
> +	cdev->name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
> +				    "%s:rgb:indicator-%d", hdev->uniq, zone);

So this is keyboard backlight? We should add the documentation at the
very least, so that other drivers use same name.

Best regards,
								Pavel

-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2022-03-23 21:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 23:50 [PATCH] HID: logitech-hidpp: support Color LED feature (8071) Manuel Schönlaub
2022-03-23 21:04 ` Pavel Machek [this message]
2022-03-24  2:21   ` Manuel Schönlaub
2022-05-05  8:25     ` Pavel Machek
2022-03-23 21:22 ` Filipe Laíns
2022-03-23 22:24   ` Bastien Nocera
2022-03-24  3:28     ` Manuel Schönlaub
2022-03-24  9:32       ` Bastien Nocera
2022-03-24 16:10         ` Manuel Schönlaub
2022-05-05  8:29           ` Pavel Machek
2022-03-24  3:34   ` Manuel Schönlaub
2022-03-24 19:54     ` Benjamin Tissoires
2022-03-25  1:29       ` Manuel Schönlaub
2022-05-05  8:32         ` Pavel Machek

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=20220323210423.GA10741@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=lains@riseup.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manuel.schoenlaub@gmail.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).