From 2b853d45c72bee80252f1cfe77694f09e58045fc Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 4 Jan 2013 11:26:54 -0800 Subject: [PATCH] iio: hid-sensor-accel-3d: add alternate sensitivity property 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 --- drivers/iio/accel/hid-sensor-accel-3d.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c index d5d95317003a..e892567b9510 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c @@ -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); -- 2.11.0