diff options
author | Ye Xiang <xiang.ye@intel.com> | 2020-12-15 13:44:43 +0800 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-01-22 08:52:02 +0000 |
commit | 660987e1250334dd944aab0421144b541675d5d1 (patch) | |
tree | 49808f78e56f3830233e037b4a4f151bee7abfc4 /drivers/iio/common | |
parent | 239319670e2a7c405eeb4b3e7721cf8bf8eef840 (diff) |
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.c | 2 |
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, |