From 4546480e130a2dae981e17b91fc7372c4048ab35 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 22 Oct 2024 15:03:09 +1000 Subject: [PATCH] pad: default a pad group to mode 0 if all LEDs are off Since our API doesn't accomodate for "dunno" we need to pick a mode that we are actually in. This happens on the Intuos Pro 2 (PTH-660) which has all LEDs on brightness zero, resulting in a failure to set up the modes and we're left without a mode button. Fix it by just picking zero as the default mode until specified otherwise. Part-of: --- src/evdev-tablet-pad-leds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/evdev-tablet-pad-leds.c b/src/evdev-tablet-pad-leds.c index ba7b9e6d..f1c70f82 100644 --- a/src/evdev-tablet-pad-leds.c +++ b/src/evdev-tablet-pad-leds.c @@ -83,7 +83,9 @@ pad_led_group_get_mode(struct pad_led_group *group) return led->mode_idx; } - return -EINVAL; + /* Wacom PTH-660 doesn't light up any LEDs + * until the button is pressed, so let's assume mode 0 */ + return 0; } static inline void -- 2.34.1