OSDN Git Service

iio: hid-sensor-accel-3d: add alternate sensitivity property
authorDaniel Leung <daniel.leung@intel.com>
Fri, 4 Jan 2013 19:26:54 +0000 (11:26 -0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 13 Dec 2014 17:06:42 +0000 (01:06 +0800)
The sensor hub on some devices (e.g. Acer W700 tablet) advertises
another property as the sensitivity change control. This property
is also defined in the HID sensor hub document HUTRR39b.

This patch lets the sensor driver picks the new property to use
as sensitivity if the original one does not exist.

For: AXIA-1451
Change-Id: I9369c0e908be9f999de437ad6ba40712fc902f3d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
drivers/iio/accel/hid-sensor-accel-3d.c

index d5d9531..e892567 100644 (file)
@@ -325,6 +325,14 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "failed to setup common attributes\n");
                return ret;
        }
+       if (accel_state->common_attributes.sensitivity.report_id == -1) {
+               sensor_hub_input_get_attribute_info(hsdev,
+                       HID_FEATURE_REPORT,
+                       HID_USAGE_SENSOR_ACCEL_3D,
+                       HID_USAGE_SENSOR_DATA_ACCELERATION |
+                               HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS,
+                       &accel_state->common_attributes.sensitivity);
+       }
 
        channels = kmemdup(accel_3d_channels, sizeof(accel_3d_channels),
                           GFP_KERNEL);