From 660987e1250334dd944aab0421144b541675d5d1 Mon Sep 17 00:00:00 2001 From: Ye Xiang Date: Tue, 15 Dec 2020 13:44:43 +0800 Subject: 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 Link: https://lore.kernel.org/r/20201215054444.9324-3-xiang.ye@intel.com Signed-off-by: Jonathan Cameron --- drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/iio/common') 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, -- cgit v1.2.3-59-g8ed1b