From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Jason Gerecke <jason.gerecke@wacom.com>,
Jiri Kosina <jkosina@suse.com>
Subject: [PATCH 6.12 33/40] HID: wacom: Initialize brightness of LED trigger
Date: Thu, 30 Jan 2025 14:59:33 +0100 [thread overview]
Message-ID: <20250130133501.030376782@linuxfoundation.org> (raw)
In-Reply-To: <20250130133459.700273275@linuxfoundation.org>
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gerecke <jason.gerecke@wacom.com>
commit 88006b8eca63467cf1b28fed839f4954c578eeff upstream.
If an LED has a default_trigger set prior to being registered with
the subsystem, that trigger will be executed with a brightness value
defined by `trigger->brightness`. Our driver was not setting this
value, which was causing problems. It would cause the selected LED
to be turned off, as well as corrupt the hlv/llv values assigned to
other LEDs (since calling `wacom_led_brightness_set` will overite
these values).
This patch sets the value of `trigger->brightness` to an appropriate
value. We use `wacom_leds_brightness_get` to transform the llv/hlv
values into a brightness that is understood by the rest of the LED
subsystem.
Fixes: 822c91e72eac ("leds: trigger: Store brightness set by led_trigger_event()")
Cc: stable@vger.kernel.org # v6.10+
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/wacom_sys.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 9843b52bd017..34428349fa31 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1370,17 +1370,6 @@ static int wacom_led_register_one(struct device *dev, struct wacom *wacom,
if (!name)
return -ENOMEM;
- if (!read_only) {
- led->trigger.name = name;
- error = devm_led_trigger_register(dev, &led->trigger);
- if (error) {
- hid_err(wacom->hdev,
- "failed to register LED trigger %s: %d\n",
- led->cdev.name, error);
- return error;
- }
- }
-
led->group = group;
led->id = id;
led->wacom = wacom;
@@ -1397,6 +1386,19 @@ static int wacom_led_register_one(struct device *dev, struct wacom *wacom,
led->cdev.brightness_set = wacom_led_readonly_brightness_set;
}
+ if (!read_only) {
+ led->trigger.name = name;
+ if (id == wacom->led.groups[group].select)
+ led->trigger.brightness = wacom_leds_brightness_get(led);
+ error = devm_led_trigger_register(dev, &led->trigger);
+ if (error) {
+ hid_err(wacom->hdev,
+ "failed to register LED trigger %s: %d\n",
+ led->cdev.name, error);
+ return error;
+ }
+ }
+
error = devm_led_classdev_register(dev, &led->cdev);
if (error) {
hid_err(wacom->hdev,
--
2.48.1
next prev parent reply other threads:[~2025-01-30 14:01 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-30 13:59 [PATCH 6.12 00/40] 6.12.12-rc1 review Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 01/40] ASoC: wm8994: Add depends on MFD core Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 02/40] ASoC: codecs: es8316: Fix HW rate calculation for 48Mhz MCLK Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 03/40] ASoC: samsung: Add missing selects for MFD_WM8994 Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 04/40] seccomp: Stub for !CONFIG_SECCOMP Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 05/40] ASoC: cs42l43: Add codec force suspend/resume ops Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 06/40] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 07/40] drm/amd/display: Use HW lock mgr for PSR1 Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 08/40] drm/amd/display: Initialize denominator defaults to 1 Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 09/40] of/unittest: Add test that of_address_to_resource() fails on non-translatable address Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 10/40] ALSA: hda/realtek: Fix volume adjustment issue on Lenovo ThinkBook 16P Gen5 Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 11/40] drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 12/40] irqchip/sunxi-nmi: Add missing SKIP_WAKE flag Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 13/40] hwmon: (drivetemp) Set scsi command timeout to 10s Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 14/40] ASoC: samsung: Add missing depends on I2C Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 15/40] mm: zswap: properly synchronize freeing resources during CPU hotunplug Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 16/40] mm: zswap: move allocations during CPU init outside the lock Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 17/40] gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 18/40] libfs: Return ENOSPC when the directory offset range is exhausted Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 19/40] Revert "libfs: Add simple_offset_empty()" Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 20/40] Revert "libfs: fix infinite directory reads for offset dir" Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 21/40] libfs: Replace simple_offset end-of-directory detection Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 22/40] libfs: Use d_children list to iterate simple_offset directories Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 23/40] smb: client: handle lack of EA support in smb2_query_path_info() Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 24/40] net: sched: fix ets qdisc OOB Indexing Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 25/40] Revert "HID: multitouch: Add support for lenovo Y9000P Touchpad" Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 26/40] cachestat: fix page cache statistics permission checking Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 27/40] vfio/platform: check the bounds of read/write syscalls Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 28/40] scsi: storvsc: Ratelimit warning logs to prevent VM denial of service Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 29/40] USB: serial: quatech2: fix null-ptr-deref in qt2_process_read_urb() Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 30/40] Revert "usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null" Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 31/40] ALSA: usb-audio: Add delay quirk for USB Audio Device Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 32/40] wifi: rtl8xxxu: add more missing rtl8192cu USB IDs Greg Kroah-Hartman
2025-01-30 13:59 ` Greg Kroah-Hartman [this message]
2025-01-30 13:59 ` [PATCH 6.12 34/40] Input: xpad - add support for Nacon Pro Compact Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 35/40] Input: atkbd - map F23 key to support default copilot shortcut Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 36/40] Input: xpad - add unofficial Xbox 360 wireless receiver clone Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 37/40] Input: xpad - add QH Electronics VID/PID Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 38/40] Input: xpad - improve name of 8BitDo controller 2dc8:3106 Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 39/40] Input: xpad - add support for Nacon Evol-X Xbox One Controller Greg Kroah-Hartman
2025-01-30 13:59 ` [PATCH 6.12 40/40] Input: xpad - add support for wooting two he (arm) Greg Kroah-Hartman
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=20250130133501.030376782@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=jason.gerecke@wacom.com \
--cc=jkosina@suse.com \
--cc=patches@lists.linux.dev \
--cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).