diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2013-10-30 22:48:00 +0000 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-11-05 23:02:53 +0000 |
commit | 2371aebf027b86d740e40b47c813be8474500bcd (patch) | |
tree | cb6d6f3dc739e03324ef7ae2826c554c3ff5b5ee /drivers/iio/gyro | |
parent | 64528d03d7233800ec77f1acb9222cf090f926ca (diff) | |
download | lwn-2371aebf027b86d740e40b47c813be8474500bcd.tar.gz lwn-2371aebf027b86d740e40b47c813be8474500bcd.zip |
iio: hid-sensors: gyro : 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
gyro 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/gyro')
-rw-r--r-- | drivers/iio/gyro/hid-sensor-gyro-3d.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c index ea01c6bcfb56..97797dbaad34 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c @@ -262,6 +262,17 @@ static int gyro_3d_parse_report(struct platform_device *pdev, st->gyro[1].index, st->gyro[1].report_id, st->gyro[2].index, st->gyro[2].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_ANGL_VELOCITY, + &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; } |