platform/x86: intel-vbtn: Stop reporting SW_DOCK events
authorHans de Goede <hdegoede@redhat.com>
Sun, 21 Mar 2021 16:35:13 +0000 (17:35 +0100)
committerHans de Goede <hdegoede@redhat.com>
Sun, 21 Mar 2021 16:44:34 +0000 (17:44 +0100)
commit2728f39dfc720983e2b69f0f1f0c403aaa7c346f
tree0c5585a3c0b7bb4f1996ed99cb6bcc9c75c0a85d
parent42f38dcccfb3c235f25f5b0b5a99436ccfcd0737
platform/x86: intel-vbtn: Stop reporting SW_DOCK events

Stop reporting SW_DOCK events because this breaks suspend-on-lid-close.

SW_DOCK should only be reported for docking stations, but all the DSDTs in
my DSDT collection which use the intel-vbtn code, always seem to use this
for 2-in-1s / convertibles and set SW_DOCK=1 when in laptop-mode (in tandem
with setting SW_TABLET_MODE=0).

This causes userspace to think the laptop is docked to a port-replicator
and to disable suspend-on-lid-close, which is undesirable.

Map the dock events to KEY_IGNORE to avoid this broken SW_DOCK reporting.

Note this may theoretically cause us to stop reporting SW_DOCK on some
device where the 0xCA and 0xCB intel-vbtn events are actually used for
reporting docking to a classic docking-station / port-replicator but
I'm not aware of any such devices.

Also the most important thing is that we only report SW_DOCK when it
reliably reports being docked to a classic docking-station without any
false positives, which clearly is not the case here. If there is a
chance of reporting false positives then it is better to not report
SW_DOCK at all.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210321163513.72328-1-hdegoede@redhat.com
drivers/platform/x86/intel-vbtn.c