]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: asus-wmi: Simplify tablet-mode-switch handling
authorHans de Goede <hdegoede@redhat.com>
Wed, 24 Aug 2022 15:11:45 +0000 (17:11 +0200)
committerHans de Goede <hdegoede@redhat.com>
Thu, 25 Aug 2022 14:23:53 +0000 (16:23 +0200)
commit1c3702f14d43918efd2c7341a32aeaa4948f9b2b
tree2a1588ecacef5fcf8ff912901d35440bc0323c69
parent27c86dac3adb707389050897c6481199adf4a9e1
platform/x86: asus-wmi: Simplify tablet-mode-switch handling

Simplify tablet-mode-switch handling:
1. The code is the same for all variants, the only difference is the
   dev_id and notify event code. Store the dev_id + code in struct asus_wmi
   and unify the handling
2. Make the new unified asus_wmi_tablet_mode_get_state() check dev_id has
   been set and make it a no-op when not set. This allows calling it
   unconditionally at resume/restore time
3. Simplify the tablet_mode_sw module-param handling, this also allows
   selecting the new lid-flip-rog type through the module-param.

Cc: Luke D. Jones <luke@ljones.dev>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220824151145.1448010-2-hdegoede@redhat.com
drivers/platform/x86/asus-nb-wmi.c
drivers/platform/x86/asus-wmi.c