OSDN Git Service

REVERTME: hid-sensors: Set default unit of measure
authorPer Persson <per.persson@intel.com>
Fri, 17 Jan 2014 14:48:33 +0000 (13:48 -0100)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 13 Dec 2014 17:06:44 +0000 (01:06 +0800)
For PROP_REPORT_INTERVAL, the default unit of measure is set to
milliseconds instead of zero.
This patch is a workaround, which changes the default value if it is
zero. The proper solution should be to initiate with correct default
value. There might be other parameters that need a change in default
value as well. How that is best done needs to be investigated further.

Tracked-By: APDEV-1124
Issue: APDEV-1000

Change-Id: I6df27a7612499f93d65b4cccecf9677005315eb7
Signed-off-by: Per Persson <per.persson@intel.com>
drivers/iio/common/hid-sensors/hid-sensor-attributes.c

index 25b01e1..7832ad6 100644 (file)
@@ -367,6 +367,10 @@ int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev,
 
        hid_sensor_get_reporting_interval(hsdev, usage_id, st);
 
+       /* Default unit of measure is milliseconds */
+       if (st->poll.units == 0)
+               st->poll.units = HID_USAGE_SENSOR_UNITS_MILLISECOND;
+
        sensor_hub_input_get_attribute_info(hsdev,
                                        HID_FEATURE_REPORT, usage_id,
                                        HID_USAGE_SENSOR_PROP_REPORT_STATE,