summaryrefslogtreecommitdiffstats
path: root/drivers/iio/light
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2013-10-30 22:48:00 +0000
committerJonathan Cameron <jic23@kernel.org>2013-11-05 23:03:11 +0000
commitf87ee1bd888e0f6b9179c569b60d2c92c0000bc8 (patch)
treebfa315257e96322ec574e8409b00386e8a882011 /drivers/iio/light
parent2371aebf027b86d740e40b47c813be8474500bcd (diff)
downloadlinux-f87ee1bd888e0f6b9179c569b60d2c92c0000bc8.tar.gz
linux-f87ee1bd888e0f6b9179c569b60d2c92c0000bc8.tar.bz2
linux-f87ee1bd888e0f6b9179c569b60d2c92c0000bc8.zip
iio: hid-sensors: light/als : Add sensitivity
A number of Properties that can be applied to Data Fields are per data field basis or for all data fields. Adding sensitivity field for all als fields, which is most commonly used in currently available sensor hubs. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/light')
-rw-r--r--drivers/iio/light/hid-sensor-als.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index fa6ae8cf89ea..0c7f115ee3b3 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -229,6 +229,17 @@ static int als_parse_report(struct platform_device *pdev,
dev_dbg(&pdev->dev, "als %x:%x\n", st->als_illum.index,
st->als_illum.report_id);
+ /* Set Sensitivity field ids, when there is no individual modifier */
+ if (st->common_attributes.sensitivity.index < 0) {
+ sensor_hub_input_get_attribute_info(hsdev,
+ HID_FEATURE_REPORT, usage_id,
+ HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS |
+ HID_USAGE_SENSOR_DATA_LIGHT,
+ &st->common_attributes.sensitivity);
+ dev_dbg(&pdev->dev, "Sensitivity index:report %d:%d\n",
+ st->common_attributes.sensitivity.index,
+ st->common_attributes.sensitivity.report_id);
+ }
return ret;
}