summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/bmc150-accel-core.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-05-23 19:01:01 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-06-09 20:53:15 +0100
commitaddab6febc42ed94e4eee1abbe486150e4f8b9e9 (patch)
tree48c2dacf1baa4e9dbc7a67586aed91e603924682 /drivers/iio/accel/bmc150-accel-core.c
parent35157f443b6f4537b03ea1752bd96fbb28ec7a4f (diff)
downloadlwn-addab6febc42ed94e4eee1abbe486150e4f8b9e9.tar.gz
lwn-addab6febc42ed94e4eee1abbe486150e4f8b9e9.zip
iio: accel: bmc150: Add support for DUAL250E ACPI DSM for setting the hinge angle
Some 360 degree hinges (yoga) style 2-in-1 devices use 2 bmc150 accels 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 (polled) by a special service and this service calls the DSM (Device Specific Method), which in turn translates the angles to one of laptop/tablet/tent/stand mode and then notifies the EC about the new mode and the EC then enables or disables the builtin keyboard and touchpad based in the mode. When the 2-in-1 is powered-on or resumed folded in tablet mode the EC senses this independent of the DSM by using a HALL effect sensor which senses that the keyboard has been folded away behind the display. At power-on or resume the EC disables the keyboard based on this and the only way to get the keyboard to work after this is to call the DSM to re-enable it. Call the DSM on probe() and resume() to fix the keyboard not working when powered-on / resumed in tablet-mode. This patch was developed and tested on a Lenovo Yoga 300-IBR. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210523170103.176958-8-hdegoede@redhat.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/bmc150-accel-core.c')
-rw-r--r--drivers/iio/accel/bmc150-accel-core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index ee9ceb7d222e..917934fe14cb 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -1798,6 +1798,9 @@ static int bmc150_accel_resume(struct device *dev)
bmc150_accel_fifo_set_mode(data);
mutex_unlock(&data->mutex);
+ if (data->resume_callback)
+ data->resume_callback(dev);
+
return 0;
}
#endif