]> git.baikalelectronics.ru Git - kernel.git/commit
iio: accel: bmc150: Set label based on accel-location on 2-accel yoga-style 2-in-1s
authorHans de Goede <hdegoede@redhat.com>
Sun, 7 Feb 2021 16:09:00 +0000 (17:09 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 11 Mar 2021 20:46:59 +0000 (20:46 +0000)
commit8cab755aace28f39c6301efbcfea05080a682050
treeb4a320c3414abda1ac14dff35a87dcf15371c047
parenta086f0b2885ad6d473c4b42f2d2c7f03e954df16
iio: accel: bmc150: Set label based on accel-location on 2-accel yoga-style 2-in-1s

Some 2-in-1 laptops / convertibles with 360° (yoga-style) hinges,
use 2 bmc150 accelerometers, defined by a single BOSC0200 ACPI
device node (1 in their base and 1 in their display).

Since in this case we know the location of each accelerometer,
set the label for the accelerometers to the standardized
"accel-display" resp. "accel-base" labels. This way userspace
can use the labels to get the location.

This was tested on a Lenovo ThinkPad Yoga 11e 4th gen (N3450 CPU).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210207160901.110643-3-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/bmc150-accel-core.c