aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/common
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2015-02-19 18:35:26 -0500
committerJiri Kosina <jkosina@suse.cz>2015-02-23 09:20:00 -0500
commit3950e03389cfc8ee9d7131074d999b5fb6bbc2bf (patch)
treebbf036b38751363eb8d6c6c8f27225d49a5f6750 /drivers/iio/common
parent6adc83fca74ab73abcbd3b394cf3a8fd3701db99 (diff)
HID: hid-sensor-hub: Enhance feature report set API
Current API only allows setting one offset in the field. This API is extended to set multiple offsets in the field report. Also update parameters in the users of this API. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/iio/common')
-rw-r--r--drivers/iio/common/hid-sensors/hid-sensor-attributes.c11
-rw-r--r--drivers/iio/common/hid-sensors/hid-sensor-trigger.c9
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index e1435e98636d..e81f434760f4 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -212,9 +212,8 @@ int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st,
212 else 212 else
213 value = 0; 213 value = 0;
214 } 214 }
215 ret = sensor_hub_set_feature(st->hsdev, 215 ret = sensor_hub_set_feature(st->hsdev, st->poll.report_id,
216 st->poll.report_id, 216 st->poll.index, sizeof(value), &value);
217 st->poll.index, value);
218 if (ret < 0 || value < 0) 217 if (ret < 0 || value < 0)
219 ret = -EINVAL; 218 ret = -EINVAL;
220 219
@@ -254,9 +253,9 @@ int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st,
254 value = convert_to_vtf_format(st->sensitivity.size, 253 value = convert_to_vtf_format(st->sensitivity.size,
255 st->sensitivity.unit_expo, 254 st->sensitivity.unit_expo,
256 val1, val2); 255 val1, val2);
257 ret = sensor_hub_set_feature(st->hsdev, 256 ret = sensor_hub_set_feature(st->hsdev, st->sensitivity.report_id,
258 st->sensitivity.report_id, 257 st->sensitivity.index, sizeof(value),
259 st->sensitivity.index, value); 258 &value);
260 if (ret < 0 || value < 0) 259 if (ret < 0 || value < 0)
261 ret = -EINVAL; 260 ret = -EINVAL;
262 261
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index ef0c495a8ef9..910e82a7d06e 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -64,15 +64,16 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
64 if (state_val >= 0) { 64 if (state_val >= 0) {
65 state_val += st->power_state.logical_minimum; 65 state_val += st->power_state.logical_minimum;
66 sensor_hub_set_feature(st->hsdev, st->power_state.report_id, 66 sensor_hub_set_feature(st->hsdev, st->power_state.report_id,
67 st->power_state.index, 67 st->power_state.index, sizeof(state_val),
68 (s32)state_val); 68 &state_val);
69 } 69 }
70 70
71 if (report_val >= 0) { 71 if (report_val >= 0) {
72 report_val += st->report_state.logical_minimum; 72 report_val += st->report_state.logical_minimum;
73 sensor_hub_set_feature(st->hsdev, st->report_state.report_id, 73 sensor_hub_set_feature(st->hsdev, st->report_state.report_id,
74 st->report_state.index, 74 st->report_state.index,
75 (s32)report_val); 75 sizeof(report_val),
76 &report_val);
76 } 77 }
77 78
78 sensor_hub_get_feature(st->hsdev, st->power_state.report_id, 79 sensor_hub_get_feature(st->hsdev, st->power_state.report_id,