Skip to content

Commit d2c3423

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Status luminance properties should set brightness of all LEDs
The wacom driver has (deprecated) sysfs properties `status0_luminance` and `status1_luminance` that are used to control the low- and high- level brightness values (llv and hlv) of the status LEDs. These two properties had an effect on /all/ of the status LEDs. After our driver switched to exposing each status LED individually through the LED class, this behavior changed. These controls started having only a temporary effect on the currently-lit LED. If a trigger changed the current LED, the driver would switch the brightness back to the llv/hlv values stored per-LED. (The code's current behavior of updating the "global" e.g. `wacom->led.llv` values has essentially no effect because those values are only used at initialization time). This commit restores the original behavior by ensuring these properties update the per-LED brightness for all LEDs. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent 4f4ab4b commit d2c3423

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/hid/wacom_sys.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,17 @@ static ssize_t wacom_luminance_store(struct wacom *wacom, u8 *dest,
10841084
mutex_lock(&wacom->lock);
10851085

10861086
*dest = value & 0x7f;
1087+
for (unsigned int i = 0; i < wacom->led.count; i++) {
1088+
struct wacom_group_leds *group = &wacom->led.groups[i];
1089+
1090+
for (unsigned int j = 0; j < group->count; j++) {
1091+
if (dest == &wacom->led.llv)
1092+
group->leds[j].llv = *dest;
1093+
else if (dest == &wacom->led.hlv)
1094+
group->leds[j].hlv = *dest;
1095+
}
1096+
}
1097+
10871098
err = wacom_led_control(wacom);
10881099

10891100
mutex_unlock(&wacom->lock);

0 commit comments

Comments
 (0)