HID: asus: only support backlight when it's not driven by WMI
Subsystems (2)
PATCH 1/1 HID: asus: only support backlight when it's not driven by WMI
The Asus GL502VSK has the same 0B05:1837 keyboard as we've seen in several Republic of Gamers laptops.
However, in this model, the keybard backlight control exposed by hid-asus has no effect on the keyboard backlight. Instead, the keyboard backlight is correctly driven by asus-wmi.
With two keyboard backlight devices available (and only the acer-wmi one working), GNOME is picking the wrong one to drive in the UI.
Avoid this problem by not creating the backlight interface when we detect a WMI-driven keyboard backlight.
We have also tested Asus GL702VMK which does have the hid-asus backlight present, and it still works fine with this patch (WMI method call returns UNSUPPORTED_METHOD).
--- drivers/hid/Kconfig | 1 + drivers/hid/hid-asus.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-)
drivers/hid/Kconfig +1 -0
@@ -149,6 +149,7 @@ config HID_APPLEIR config HID_ASUS tristate "Asus" depends on LEDS_CLASS + depends on ACPI_WMI ---help--- Support for Asus notebook built-in keyboard and touchpad via i2c, and the Asus Republic of Gamers laptop keyboard special keys.
drivers/hid/hid-asus.c +52 -1
77 lines not on this page · raw message
Signature · 1 line
2.14.1
Quoted 13 lines · Daniel Drake
The Asus GL502VSK has the same 0B05:1837 keyboard as we've seen in several Republic of Gamers laptops.
However, in this model, the keybard backlight control exposed by hid-asus has no effect on the keyboard backlight. Instead, the keyboard backlight is correctly driven by asus-wmi.
With two keyboard backlight devices available (and only the acer-wmi one working), GNOME is picking the wrong one to drive in the UI.
Avoid this problem by not creating the backlight interface when we detect a WMI-driven keyboard backlight.
Quoted 8 lines
We have also tested Asus GL702VMK which does have the hid-asus backlight present, and it still works fine with this patch (WMI method call returns
UNSUPPORTED_METHOD).config
HID_ASUS
tristate "Asus"
depends onLEDS_CLASS
+ depends onACPI_WMI
No, for sure.
Imagine someone who on possession of laptop where it's not needed having old kernel configuration.
Building new kernel with old configuration will bring a regression.
Selection is also not a solution since we don't need all crap in kernel because of some particular case.
So, NO.
Quoted 7 lines
drivers/hid/hid-asus.c +4
-0+#define ASUS_WMI_MGMT_GUID "97845ED0-4E6D-11DE-8A39-0800200C9A66" +#define ASUS_WMI_METHODID_DSTS2 0x53545344/* Device STatuS #2*/ +#define ASUS_WMI_DEVID_KBD_BACKLIGHT 0x00050021 +#define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE
drivers/hid/hid-asus.c
Quoted 10 lines
drivers/hid/hid-asus.c +8
-0+#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000 +/* WMI-based keyboard backlight LED control (via asus-wmi driver) takes +* precedence. We only activate HID-based backlight control when the +* WMI control is not available. +*/ +static bool asus_kbd_wmi_led_control_present (struct hid_device *hdev) +{ +}
I have feelings that the code above should be located somewhere under drivers/platform/x86.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Imagine someone who on possession of laptop where it's not needed having old kernel configuration.
Building new kernel with old configuration will bring a regression.Selection is also not a solution since we don't need all crap in kernel because of some particular case.
So, NO.
If I can't use depends nor select, then what options are left? What alternative solutions do you have in mind?
Thanks
Daniel
Quoted 6 lines · Daniel Drake
Quoted 4 lines · Andy Shevchenko
Imagine someone who on possession of laptop where it's not needed having old kernel configuration.
Building new kernel with old configuration will bring a regression.
Quoted 7 lines
Quoted 4 lines
Selection is also not a solution since we don't need all crap in kernel because of some particular case.
So, NO.
If I can't use depends nor select, then what options are left? What alternative solutions do you have in mind?
If you would able to move code under corresponding WMI driver, make it use any means of autodetection (it looks like you found a way via checking return code of method call) and
then rely on distributions that they enable necessary modules (HID_ASUS, ASUS_WMI or alike).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 21 lines · Andy Shevchenko
Quoted 6 lines · Daniel Drake
Quoted 4 lines · Andy Shevchenko
Imagine someone who on possession of laptop where it's not needed having old kernel configuration.
Building new kernel with old configuration will bring a regression.Quoted 7 lines
Quoted 4 lines
Selection is also not a solution since we don't need all crap in kernel because of some particular case.
So, NO.
If I can't use depends nor select, then what options are left? What alternative solutions do you have in mind?
If you would able to move code under corresponding WMI driver, make it use any means of autodetection (it looks like you found a way via checking return code of method call) and
then rely on distributions that they enable necessary modules (HID_ASUS,ASUS_WMIor alike).
Quoted 7 lines
--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
It is interesting that the backlight buttons did not work for you. I think your keyboard (0b05:1837)is a USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2.
I also have a ROG laptop (GL553VD) whose keyboard (0b05:1854) is being identified as USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1. Its keyboard backlight shortcuts are enabled only after applying the following patch. I am wondering why this harmless one liner did not find its way into the modules tree. It's difficult to apply the patch to every keep up with the latest. Maybe other ASUS people confirm this and help pushing it further..
Kind Regards...
drivers/hid/hid-asus.c +1 -1
@@ -593,7 +593,7 @@ static const struct hid_device_id asus_devices[] = { {HID_I2C_DEVICE (USB_VENDOR_ID_ASUSTEK , USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD), I2C_TOUCHPAD_QUIRKS }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, - USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1) }, + USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1), QUIRK_USE_KBD_BACKLIGHT }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2), QUIRK_USE_KBD_BACKLIGHT }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
Hi Mustafa,
drivers/hid/hid-asus.c static const struct hid_device_id asus_devices[] = { · line 596
Quoted 3 lines · Mustafa Kuscu
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
drivers/hid/hid-asus.c +1
-1- USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1) }, + USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1), QUIRK_USE_KBD_BACKLIGHT },
This change is already included in the latest version of Linux so I assume you are just running an old version.
Andy, still waiting for any more feedback on the issue detailed in this thread once you have a chance.
Thanks
Daniel
Quoted 4 lines · Daniel Drake
On Fri, Jan 12, 2018 at 1:33 PM, Mustafa Kuscu <[email protected]> wrote:
Andy, still waiting for any more feedback on the issue detailed in this thread once you have a chance.
As I said before I don't like code duplication and even more I don't like functionality duplication.
So, check what can we re-use from asus-wmi.c and adopt it accordingly.
Signature · 2 lines
With Best Regards, Andy Shevchenko