]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:36:33 +0000 (18:36 +0100)
commit450f8c95a5cb011dc49c5b357a50dc65631e93c2
treeea4152a5a17f425ef2995cd131feda4aefa0f229
parentf277c14b6d5feb8f1e480c10fd17378df64a1242
platform/x86: asus-wmi: Simplify tablet-mode-switch handling

[ Upstream commit 1ea0d3b46798afc35c3185f6058b8bc08525d56c ]

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
Stable-dep-of: b52cbca22cbf ("platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/asus-nb-wmi.c
drivers/platform/x86/asus-wmi.c