summaryrefslogtreecommitdiffstats
path: root/drivers/iio/common
diff options
context:
space:
mode:
authorSong Hongyan <hongyan.song@intel.com>2017-03-03 21:44:32 +0800
committerJonathan Cameron <jic23@kernel.org>2017-03-04 18:45:26 +0000
commit59d0f2da35693bfbcf6ffb014213cb8e225c8928 (patch)
treede359752da0bee9076b7e25ca1308f6a2aa67a38 /drivers/iio/common
parent0f0c106aa95243c5e59f06fb447ed7ea89818be1 (diff)
downloadlinux-59d0f2da35693bfbcf6ffb014213cb8e225c8928.tar.bz2
iio: hid: Add temperature sensor support
Environmental temperature sensor is a hid defined sensor, it measures temperature. More information can be found in: http://www.usb.org/developers/hidpage/HUTRR39b.pdf According to IIO ABI definition, IIO_TEMP data output unit is milli degrees Celsius. Add the unit convert from degree to milli degree. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/common')
-rw-r--r--drivers/iio/common/hid-sensors/hid-sensor-attributes.c3
1 files changed, 3 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 7afdac42ed42..9338f94ce1dc 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -62,6 +62,9 @@ static struct {
{HID_USAGE_SENSOR_TIME_TIMESTAMP, 0, 1000000000, 0},
{HID_USAGE_SENSOR_TIME_TIMESTAMP, HID_USAGE_SENSOR_UNITS_MILLISECOND,
1000000, 0},
+
+ {HID_USAGE_SENSOR_TEMPERATURE, 0, 1000, 0},
+ {HID_USAGE_SENSOR_TEMPERATURE, HID_USAGE_SENSOR_UNITS_DEGREES, 1000, 0},
};
static int pow_10(unsigned power)