platform/x86: intel-vbtn: Do not advertise switches to userspace if they are not...
authorHans de Goede <hdegoede@redhat.com>
Sat, 2 May 2020 18:29:49 +0000 (20:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:31:04 +0000 (09:31 +0200)
commit708e0175edf5d5fce1fb76c18a62355908c504c6
tree26f540aaea8a21d6c338878f5e10dca9e2a5f683
parent0ac5741007f19ccea8602e17b38f62cdd1d3a5dd
platform/x86: intel-vbtn: Do not advertise switches to userspace if they are not there

[ Upstream commit 990fbb48067bf8cfa34b7d1e6e1674eaaef2f450 ]

Commit de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode
switch on 2-in-1's") added a DMI chassis-type check to avoid accidentally
reporting SW_TABLET_MODE = 1 to userspace on laptops (specifically on the
Dell XPS 9360), to avoid e.g. userspace ignoring touchpad events because
userspace thought the device was in tablet-mode.

But if we are not getting the initial status of the switch because the
device does not have a tablet mode, then we really should not advertise
the presence of a tablet-mode switch to userspace at all, as userspace may
use the mere presence of this switch for certain heuristics.

Fixes: de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/intel-vbtn.c