acrn-kernel/drivers/iio/accel
Hans de Goede e5b1032a65 iio: accel: kxcjk1013: Add support for KIOX010A ACPI DSM for setting tablet-mode
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>
2020-11-14 17:33:47 +00:00
..
Kconfig
Makefile
adis16201.c
adis16209.c
adxl345.h
adxl345_core.c
adxl345_i2c.c
adxl345_spi.c
adxl372.c
adxl372.h
adxl372_i2c.c
adxl372_spi.c
bma180.c iio:accel:bma180: Fix use of true when should be iio_shared_by enum 2020-09-21 19:59:57 +01:00
bma220_spi.c
bma400.h
bma400_core.c
bma400_i2c.c
bma400_spi.c
bmc150-accel-core.c
bmc150-accel-i2c.c
bmc150-accel-spi.c
bmc150-accel.h
cros_ec_accel_legacy.c iio: cros_ec: unify hw fifo attributes into the core file 2020-09-29 17:27:07 +01:00
da280.c
da311.c
dmard06.c
dmard09.c
dmard10.c
hid-sensor-accel-3d.c
kxcjk-1013.c iio: accel: kxcjk1013: Add support for KIOX010A ACPI DSM for setting tablet-mode 2020-11-14 17:33:47 +00:00
kxsd9-i2c.c
kxsd9-spi.c
kxsd9.c
kxsd9.h
mc3230.c
mma7455.h
mma7455_core.c
mma7455_i2c.c
mma7455_spi.c
mma7660.c
mma8452.c
mma9551.c
mma9551_core.c
mma9551_core.h
mma9553.c
mxc4005.c
mxc6255.c
sca3000.c
ssp_accel_sensor.c
st_accel.h
st_accel_buffer.c
st_accel_core.c
st_accel_i2c.c
st_accel_spi.c
stk8ba50.c
stk8312.c