Skip to content

Commit

Permalink
Merge branch 'for-6.13' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jigpu committed Dec 10, 2024
2 parents bf62fdd + 7dceb0b commit 5f60a3c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
26 changes: 15 additions & 11 deletions 4.18/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,17 +1392,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;
Expand All @@ -1419,6 +1408,21 @@ 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;
#ifdef WACOM_TRIGGER_BRIGHTNESS
if (id == wacom->led.groups[group].select)
led->trigger.brightness = wacom_leds_brightness_get(led);
#endif
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,
Expand Down
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ int test(struct hid_usage *usage) { return usage->resolution_multiplier; }
AC_MSG_RESULT([no])
])

dnl Check if LED triggers define brightness. This should be in Linux
dnl 6.10 and later.
AC_MSG_CHECKING(trigger brightness)
WACOM_LINUX_TRY_COMPILE([
#include <linux/leds.h>
int test(struct led_trigger *trigger) { return trigger->brightness; }
],[
],[
HAVE_TRIGGER_BRIGHTNESS=yes
AC_MSG_RESULT([yes])
AC_DEFINE([WACOM_TRIGGER_BRIGHTNESS], [], [kernel defines trigger brightness from v6.10+])
],[
HAVE_TRIGGER_BRIGHTNESS=no
AC_MSG_RESULT([no])
])



dnl Check which version of the driver we should compile
Expand Down

0 comments on commit 5f60a3c

Please sign in to comment.