aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/common
diff options
context:
space:
mode:
authorYe Xiang <xiang.ye@intel.com>2020-12-15 13:44:43 +0800
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-01-22 08:52:02 +0000
commit660987e1250334dd944aab0421144b541675d5d1 (patch)
tree49808f78e56f3830233e037b4a4f151bee7abfc4 /drivers/iio/common
parentHID: hid-sensor-custom: Add custom sensor iio support (diff)
downloadlinux-dev-660987e1250334dd944aab0421144b541675d5d1.tar.xz
linux-dev-660987e1250334dd944aab0421144b541675d5d1.zip
iio: hid-sensors: Add hinge sensor driver
The Hinge sensor is a common custom sensor on laptops. It calculates the angle between the lid (screen) and the base (keyboard). In addition, it also exposes screen and the keyboard angles with respect to the ground. Applications can easily get laptop's status in space through this sensor, in order to display appropriate user interface. Signed-off-by: Ye Xiang <xiang.ye@intel.com> Link: https://lore.kernel.org/r/20201215054444.9324-3-xiang.ye@intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/common')
-rw-r--r--drivers/iio/common/hid-sensors/hid-sensor-attributes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index 442ff787f7af..5b822a4298a0 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -71,6 +71,8 @@ static struct {
{HID_USAGE_SENSOR_TEMPERATURE, HID_USAGE_SENSOR_UNITS_DEGREES, 1000, 0},
{HID_USAGE_SENSOR_HUMIDITY, 0, 1000, 0},
+ {HID_USAGE_SENSOR_HINGE, 0, 0, 17453293},
+ {HID_USAGE_SENSOR_HINGE, HID_USAGE_SENSOR_UNITS_DEGREES, 0, 17453293},
};
static void simple_div(int dividend, int divisor, int *whole,