platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA
PATCH 1/1 platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA
asus-nb-wmi does not add any extra functionality on these Asus Transformer books. They have detachable keyboards, so the hotkeys are send through a HID device (and handled by the hid-asus driver) and also the rfkill functionality is not used on these devices.
Besides not adding any extra functionality, initializing the WMI interface on these devices actually has a negative side-effect. For some reason the \_SB.ATKD.INIT() function which asus_wmi_platform_init() calls drives GPO2 (INT33FC:02) pin 8, which is connected to the front facing webcam LED, high and there is no (WMI or other) interface to drive this low again causing the LED to be permanently on, even during suspend.
This commit adds a blacklist of DMI system_ids on which not to load the asus-nb-wmi and adds these Transformer books to this list. This fixes the webcam LED being permanently on under Linux.
--- drivers/platform/x86/asus-nb-wmi.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +24 -0
@@ -515,9 +515,33 @@ static struct asus_wmi_driver asus_nb_wmi_driver = { .detect_quirks = asus_nb_wmi_quirks, }; +static const struct dmi_system_id asus_nb_wmi_blacklist[]__initconst = { + { +/* +* asus-nb-wm adds no functionality. The T100TA has a detachable +* USB kbd, so no hotkeys and it has no WMI rfkill; and loading +* asus-nb-wm causes the camera LED to turn and _stay_ on. +*/ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"T100TA" ), + }, + }, + { +/* The Asus T200TA has the same issue as the T100TA */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"T200TA" ), + }, + }, + {}/* Terminating entry */ +};static int __init asus_nb_wmi_init (void ) { +if (dmi_check_system (asus_nb_wmi_blacklist)) +return -ENODEV ; +return asus_wmi_register_driver (&asus_nb_wmi_driver); }
Signature · 1 line
2.26.0
Hi,
Quoted 12 lines · Hans de Goede
asus-nb-wmi does not add any extra functionality on these Asus Transformer books. They have detachable keyboards, so the hotkeys are send through a HID device (and handled by the hid-asus driver) and also the rfkill functionality is not used on these devices.
Besides not adding any extra functionality, initializing the WMI interface on these devices actually has a negative side-effect. For some reason the \_SB.ATKD.INIT() function which
asus_wmi_platform_init()calls drives GPO2 (INT33FC:02) pin 8, which is connected to the front facing webcam LED, high and there is no (WMI or other) interface to drive this low again causing the LED to be permanently on, even during suspend.
Quoted 5 lines
This commit adds a blacklist of DMI
system_idson which not to load the asus-nb-wmi and adds these Transformer books to this list. This fixes the webcam LED being permanently on under Linux.Signed-off-by Hans de Goede <[email protected]>
Because of the BYT/CHT work which I do as a side project I have a bunch of BYT/CHT based 2-in-1s as test devices, including the T100TA and T200TA.
So recently I've been looking into properly reporting SW_TABLET_MODE state to userspace to let userspace know if the keyboard of these detachables is attached or not; and guess what, the Asus models report this through WMI. So blacklisting is not the right thing to do here after all :| I do have a plan for another fix for this (which will also involve DMI matching)...
Andy, Darren, I see that you have already added this to the for-next branch of linux-platform-drivers-x86. I'm not sure what your vision on forced pushed there is. If forced pushes are ok, please drop this patch. If not let me know and I will send out a revert.
Regards,
Hans
Quoted 43 lines
--- drivers/platform/x86/asus-nb-wmi.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)drivers/platform/x86/asus-nb-wmi.c +24
-0@@ -515,9 +515,33 @@ static struct asus_wmi_driver asus_nb_wmi_driver = { .detect_quirks = asus_nb_wmi_quirks, }; +static const struct dmi_system_id asus_nb_wmi_blacklist[]__initconst = { + { +/* +* asus-nb-wm adds no functionality. The T100TA has a detachable +* USB kbd, so no hotkeys and it has no WMI rfkill; and loading +* asus-nb-wm causes the camera LED to turn and _stay_ on. +*/ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"T100TA" ), + }, + }, + { +/* The Asus T200TA has the same issue as the T100TA */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"T200TA" ), + }, + }, + {}/* Terminating entry */ +};static int __init asus_nb_wmi_init (void ) { +if (dmi_check_system (asus_nb_wmi_blacklist)) +return -ENODEV ; +return asus_wmi_register_driver (&asus_nb_wmi_driver); }
Quoted 6 lines · Hans de Goede
On 4/23/20 12:05 AM, Hans de Goede wrote:
Andy, Darren, I see that you have already added this to the for-next branch of linux-platform-drivers-x86. I'm not sure what your vision on forced pushed there is. If forced pushes are ok, please drop this patch. If not let me know and I will send out a revert.
Forced pushes are not okay, but we have exceptions in some cases. It would be done here, but there are complications, i.e. we have already immutable branch merged from MFD. Of course, I would remerge it again, but I think we better not to do this right now, so, revert seems a less painful in this case. Or, if you have already done something better, than keep it as follow up improvement rather than pure revert.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Hans de Goede
On 4/23/20 12:05 AM, Hans de Goede wrote:
Andy, Darren, I see that you have already added this to the for-next branch of linux-platform-drivers-x86. I'm not sure what your vision on forced pushed there is. If forced pushes are ok, please drop this patch. If not let me know and I will send out a revert.
Quoted 7 lines
Forced pushes are not okay, but we have exceptions in some cases. It would be done here, but there are complications, i.e. we have already immutable branch merged from MFD. Of course, I would remerge it again, but I think we better not to do this right now, so, revert seems a less painful in this case. Or, if you have already done something better, than keep it as follow up improvement rather than pure revert.
Oops, it seems I was quick enough to push this to v5.7-rc4. So, please send revert!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi,
Quoted 11 lines · Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Hans de Goede
On 4/23/20 12:05 AM, Hans de Goede wrote:
Andy, Darren, I see that you have already added this to the for-next branch of linux-platform-drivers-x86. I'm not sure what your vision on forced pushed there is. If forced pushes are ok, please drop this patch. If not let me know and I will send out a revert.
Quoted 7 lines
Quoted 7 lines
Forced pushes are not okay, but we have exceptions in some cases. It would be done here, but there are complications, i.e. we have already immutable branch merged from MFD. Of course, I would remerge it again, but I think we better not to do this right now, so, revert seems a less painful in this case. Or, if you have already done something better, than keep it as follow up improvement rather than pure revert.
Ok, doing the revert is fine with me, I've prepped it and I will send it out right away.
Quoted 2 lines
Oops, it seems I was quick enough to push this to v5.7-rc4. So, please send revert!
Note the commit does not break anything; it even works as advertised to fix the camera LED being stuck in on state at boot on the Asus T100TA and Asus T200TA.
The problem is that I'm working on making various 2-in-1s report their tablet-mode state (SW_TABLET_MODE) to userspace; and I've found that these 2 Asus models (and other Asus models) report this through WMI.
So the blacklisting of these 2 models inside asus-nb-wmi needs to be dropped to make the SW_TABLET_MODE reporting work once I have added that to the asus-nb-wmi driver, so the revert is to prepare for that it does not fix any regression, since the current version of asus-nb-wmi does not handle SW_TABLET_MODE.
So there is no need to rush the revert upstream, it can go to 5.8 together with the asus-nb-wmi changes to add SW_TABLET_MODE support.
The reason I was asking to drop the commit was because I came to the conclusion that in the end the blacklist is not what we want. But for now having the blacklist is fine.
Regards,
Hans