Skip to content

Commit 4748bb4

Browse files
antheasij-intel
authored andcommitted
HID: asus: add support for the asus-wmi brightness handler
If the asus-wmi brightness handler is available, send the keyboard brightness events to it instead of passing them to userspace. If it is not, fall back to sending them to it. Reviewed-by: Luke D. Jones <luke@ljones.dev> Tested-by: Luke D. Jones <luke@ljones.dev> Reviewed-by: Denis Benato <benato.denis96@gmail.com> Acked-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://patch.msgid.link/20260122075044.5070-12-lkml@antheas.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 7525566 commit 4748bb4

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/hid/hid-asus.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@ static int asus_event(struct hid_device *hdev, struct hid_field *field,
324324
usage->hid & HID_USAGE);
325325
}
326326

327+
if (usage->type == EV_KEY && value) {
328+
switch (usage->code) {
329+
case KEY_KBDILLUMUP:
330+
return !asus_hid_event(ASUS_EV_BRTUP);
331+
case KEY_KBDILLUMDOWN:
332+
return !asus_hid_event(ASUS_EV_BRTDOWN);
333+
case KEY_KBDILLUMTOGGLE:
334+
return !asus_hid_event(ASUS_EV_BRTTOGGLE);
335+
}
336+
}
337+
327338
return 0;
328339
}
329340

0 commit comments

Comments
 (0)