[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220323210423.GA10741@duo.ucw.cz>
Date: Wed, 23 Mar 2022 22:04:23 +0100
From: Pavel Machek <pavel@....cz>
To: Manuel Schönlaub <manuel.schoenlaub@...il.com>
Cc: lains@...eup.net, jikos@...nel.org, benjamin.tissoires@...hat.com,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: logitech-hidpp: support Color LED feature (8071).
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@...il.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.
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists