aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sensor-hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-sensor-hub.c')
-rw-r--r--drivers/hid/hid-sensor-hub.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index a184e1921c11..8fab82829f8b 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -112,13 +112,15 @@ static int sensor_hub_get_physical_device_count(
112 112
113static void sensor_hub_fill_attr_info( 113static void sensor_hub_fill_attr_info(
114 struct hid_sensor_hub_attribute_info *info, 114 struct hid_sensor_hub_attribute_info *info,
115 s32 index, s32 report_id, s32 units, s32 unit_expo, s32 size) 115 s32 index, s32 report_id, struct hid_field *field)
116{ 116{
117 info->index = index; 117 info->index = index;
118 info->report_id = report_id; 118 info->report_id = report_id;
119 info->units = units; 119 info->units = field->unit;
120 info->unit_expo = unit_expo; 120 info->unit_expo = field->unit_exponent;
121 info->size = size/8; 121 info->size = (field->report_size * field->report_count)/8;
122 info->logical_minimum = field->logical_minimum;
123 info->logical_maximum = field->logical_maximum;
122} 124}
123 125
124static struct hid_sensor_hub_callbacks *sensor_hub_get_callback( 126static struct hid_sensor_hub_callbacks *sensor_hub_get_callback(
@@ -325,9 +327,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
325 if (field->physical == usage_id && 327 if (field->physical == usage_id &&
326 field->logical == attr_usage_id) { 328 field->logical == attr_usage_id) {
327 sensor_hub_fill_attr_info(info, i, report->id, 329 sensor_hub_fill_attr_info(info, i, report->id,
328 field->unit, field->unit_exponent, 330 field);
329 field->report_size *
330 field->report_count);
331 ret = 0; 331 ret = 0;
332 } else { 332 } else {
333 for (j = 0; j < field->maxusage; ++j) { 333 for (j = 0; j < field->maxusage; ++j) {
@@ -336,11 +336,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
336 field->usage[j].collection_index == 336 field->usage[j].collection_index ==
337 collection_index) { 337 collection_index) {
338 sensor_hub_fill_attr_info(info, 338 sensor_hub_fill_attr_info(info,
339 i, report->id, 339 i, report->id, field);
340 field->unit,
341 field->unit_exponent,
342 field->report_size *
343 field->report_count);
344 ret = 0; 340 ret = 0;
345 break; 341 break;
346 } 342 }
@@ -573,6 +569,8 @@ static int sensor_hub_probe(struct hid_device *hdev,
573 goto err_free_names; 569 goto err_free_names;
574 } 570 }
575 sd->hid_sensor_hub_client_devs[ 571 sd->hid_sensor_hub_client_devs[
572 sd->hid_sensor_client_cnt].id = PLATFORM_DEVID_AUTO;
573 sd->hid_sensor_hub_client_devs[
576 sd->hid_sensor_client_cnt].name = name; 574 sd->hid_sensor_client_cnt].name = name;
577 sd->hid_sensor_hub_client_devs[ 575 sd->hid_sensor_hub_client_devs[
578 sd->hid_sensor_client_cnt].platform_data = 576 sd->hid_sensor_client_cnt].platform_data =