mbox series

[RFC,0/3] platform/x86: asus-wmi: Only map brightness codes when using asus-wmi backlight control

Message ID 20231017090725.38163-1-hdegoede@redhat.com (mailing list archive)
Headers show
Series platform/x86: asus-wmi: Only map brightness codes when using asus-wmi backlight control | expand

Message

Hans de Goede Oct. 17, 2023, 9:07 a.m. UTC
Hi All,

Here is a series to address the issue of some newer Asus laptop models
sending 0x2a - 0x2c events for various keys which fall within
the NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX range causing these to
wrongly get translated to KEY_BRIGHTNESSDOWN events.

To fix this change the NOTIFY_BRNUP_MIN - NOTIFY_BRNUP_MAX +
NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX key-mapping to only apply
to old models which use the vendor specific asus-wmi interface for
backlight control.

This series is marked as RFC because I still need to hear back
from the reporter if this series actually fixes things.

Regards,

Hans


Hans de Goede (3):
  platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to
    0x2e
  platform/x86: asus-wmi: Only map brightness codes when using asus-wmi
    backlight control
  platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events

 drivers/platform/x86/asus-nb-wmi.c |  3 +++
 drivers/platform/x86/asus-wmi.c    | 15 ++++-----------
 drivers/platform/x86/asus-wmi.h    |  2 +-
 3 files changed, 8 insertions(+), 12 deletions(-)

Comments

Hans de Goede Oct. 18, 2023, 10:02 a.m. UTC | #1
Hi All,

On 10/17/23 11:07, Hans de Goede wrote:
> Hi All,
> 
> Here is a series to address the issue of some newer Asus laptop models
> sending 0x2a - 0x2c events for various keys which fall within
> the NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX range causing these to
> wrongly get translated to KEY_BRIGHTNESSDOWN events.
> 
> To fix this change the NOTIFY_BRNUP_MIN - NOTIFY_BRNUP_MAX +
> NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX key-mapping to only apply
> to old models which use the vendor specific asus-wmi interface for
> backlight control.
> 
> This series is marked as RFC because I still need to hear back
> from the reporter if this series actually fixes things.

Ok, so this has been tested now and since this is being hit by
multiple users (also see: https://bbs.archlinux.org/viewtopic.php?pid=2123716 )
I have decided to push this to pdx86/fixes now.

Note there is a chance that this may lead to regressions where
the brightness hotkeys stop working on some really old Asus laptop
models, in case they do report the NOTIFY_BRNUP_MIN - NOTIFY_BRNUP_MAX +
NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX keys even though another
method (acpi_video / GPU-native) is used to control the backlight.

This would be weird, but not entirely unsurprising.

Unfortunately the only way to find out if this is the case is to try,
so I've decided to move ahead with this series to fix the known issues
caused without it on newer models. I will deal with any regressions
on older models if / when they get reported.

Regards,

Hans



> Hans de Goede (3):
>   platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to
>     0x2e
>   platform/x86: asus-wmi: Only map brightness codes when using asus-wmi
>     backlight control
>   platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events
> 
>  drivers/platform/x86/asus-nb-wmi.c |  3 +++
>  drivers/platform/x86/asus-wmi.c    | 15 ++++-----------
>  drivers/platform/x86/asus-wmi.h    |  2 +-
>  3 files changed, 8 insertions(+), 12 deletions(-)
>