1
0
Fork 0
alistair23-linux/drivers/iio
Hans de Goede d3e27c6233 iio: accel: kxcjk1013: Add support for KIOX010A ACPI DSM for setting tablet-mode
commit e5b1032a65 upstream.

Some 360 degree hinges (yoga) style 2-in-1 devices use 2 KXCJ91008-s
to allow the OS to determine the angle between the display and the base
of the device, so that the OS can determine if the 2-in-1 is in laptop
or in tablet-mode.

On Windows both accelerometers are read by a special HingeAngleService
process; and this process calls a DSM (Device Specific Method) on the
ACPI KIOX010A device node for the sensor in the display, to let the
embedded-controller (EC) know about the mode so that it can disable the
kbd and touchpad to avoid spurious input while folded into tablet-mode.

This notifying of the EC is problematic because sometimes the EC comes up
thinking that device is in tablet-mode and the kbd and touchpad do not
work. This happens for example on Irbis NB111 devices after a suspend /
resume cycle (after a complete battery drain / hard reset without having
booted Windows at least once). Other 2-in-1s which are likely affected
too are e.g. the Teclast F5 and F6 series.

The kxcjk-1013 driver may seem like a strange place to deal with this,
but since it is *the* driver for the ACPI KIOX010A device, it is also
the driver which has access to the ACPI handle needed by the DSM.

Add support for calling the DSM and on probe unconditionally tell the
EC that the device is laptop mode, fixing the kbd and touchpad sometimes
not working.

Fixes: 7f6232e695 ("iio: accel: kxcjk1013: Add KIOX010A ACPI Hardware-ID")
Reported-and-tested-by: russianneuromancer <russianneuromancer@ya.ru>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201110133835.129080-3-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-24 13:29:21 +01:00
..
accel iio: accel: kxcjk1013: Add support for KIOX010A ACPI DSM for setting tablet-mode 2020-11-24 13:29:21 +01:00
adc iio:adc:ti-adc12138 Fix alignment issue with timestamp 2020-11-05 11:43:30 +01:00
afe
amplifiers
buffer
chemical iio:chemical:ccs811: Fix timestamp alignment and prevent data leak. 2020-09-17 13:47:51 +02:00
common iio: cros_ec: Set Gyroscope default frequency to 25Hz 2020-09-17 13:47:49 +02:00
dac iio: dac: ad5592r: fix unbalanced mutex unlocks in ad5592r_read_raw() 2020-08-21 13:05:24 +02:00
dummy
frequency
gyro iio:gyro:itg3200: Fix timestamp alignment and prevent data leak. 2020-11-05 11:43:30 +01:00
health iio:health:afe4404 Fix timestamp alignment and prevent data leak. 2020-07-22 09:33:00 +02:00
humidity iio:humidity:hts221 Fix alignment and data leak issues 2020-07-22 09:32:54 +02:00
imu
light iio: light: fix kconfig dependency bug for VCNL4035 2020-11-24 13:29:21 +01:00
magnetometer iio:magnetometer:ak8975 Fix alignment and data leak issues. 2020-09-17 13:47:50 +02:00
multiplexer
orientation
potentiometer
potentiostat
pressure iio:pressure:ms5611 Fix buffer element alignment 2020-07-22 09:32:54 +02:00
proximity iio:proximity:mb1232: Fix timestamp alignment and prevent data leak. 2020-09-17 13:47:50 +02:00
resolver
temperature
trigger iio: trigger: stm32-timer: disable master mode when stopping 2020-03-25 08:25:53 +01:00
Kconfig
Makefile
iio_core.h
iio_core_trigger.h
industrialio-buffer.c iio: buffer: align the size of scan bytes to size of the largest element 2020-01-23 08:22:33 +01:00
industrialio-configfs.c
industrialio-core.c iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers 2020-07-22 09:32:54 +02:00
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c