diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2015-02-19 18:33:56 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-02-23 09:16:37 -0500 |
commit | b3f4737d00de317d1549d5cb5b1dad90e19f5cec (patch) | |
tree | 92cb55d8f19f340f2daf779336368cb3a34e8426 /drivers/iio | |
parent | cb67126f32f008b9abe97fbfca9b23a797b2458a (diff) |
HID: hid-sensor-hub: Extend API for async reads
Add additional flag to read in async mode. In this mode the caller will get
reply via registered callback for capture_sample. Callbacks can be registered
using sensor_hub_register_callback function. The usage id parameter of the
capture_sample can be matched with the usage id of the requested attribute.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/accel/hid-sensor-accel-3d.c | 3 | ||||
-rw-r--r-- | drivers/iio/gyro/hid-sensor-gyro-3d.c | 3 | ||||
-rw-r--r-- | drivers/iio/light/hid-sensor-als.c | 3 | ||||
-rw-r--r-- | drivers/iio/light/hid-sensor-prox.c | 3 | ||||
-rw-r--r-- | drivers/iio/magnetometer/hid-sensor-magn-3d.c | 3 | ||||
-rw-r--r-- | drivers/iio/orientation/hid-sensor-incl-3d.c | 3 | ||||
-rw-r--r-- | drivers/iio/pressure/hid-sensor-press.c | 3 |
7 files changed, 14 insertions, 7 deletions
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c index d5d95317003a..0085c2faeaaa 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c | |||
@@ -130,7 +130,8 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev, | |||
130 | *val = sensor_hub_input_attr_get_raw_value( | 130 | *val = sensor_hub_input_attr_get_raw_value( |
131 | accel_state->common_attributes.hsdev, | 131 | accel_state->common_attributes.hsdev, |
132 | HID_USAGE_SENSOR_ACCEL_3D, address, | 132 | HID_USAGE_SENSOR_ACCEL_3D, address, |
133 | report_id); | 133 | report_id, |
134 | SENSOR_HUB_SYNC); | ||
134 | else { | 135 | else { |
135 | *val = 0; | 136 | *val = 0; |
136 | hid_sensor_power_state(&accel_state->common_attributes, | 137 | hid_sensor_power_state(&accel_state->common_attributes, |
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c index a3ea1e8785d7..bdcd105aba26 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c | |||
@@ -130,7 +130,8 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev, | |||
130 | *val = sensor_hub_input_attr_get_raw_value( | 130 | *val = sensor_hub_input_attr_get_raw_value( |
131 | gyro_state->common_attributes.hsdev, | 131 | gyro_state->common_attributes.hsdev, |
132 | HID_USAGE_SENSOR_GYRO_3D, address, | 132 | HID_USAGE_SENSOR_GYRO_3D, address, |
133 | report_id); | 133 | report_id, |
134 | SENSOR_HUB_SYNC); | ||
134 | else { | 135 | else { |
135 | *val = 0; | 136 | *val = 0; |
136 | hid_sensor_power_state(&gyro_state->common_attributes, | 137 | hid_sensor_power_state(&gyro_state->common_attributes, |
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index a5283d75c096..321862da626b 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c | |||
@@ -109,7 +109,8 @@ static int als_read_raw(struct iio_dev *indio_dev, | |||
109 | *val = sensor_hub_input_attr_get_raw_value( | 109 | *val = sensor_hub_input_attr_get_raw_value( |
110 | als_state->common_attributes.hsdev, | 110 | als_state->common_attributes.hsdev, |
111 | HID_USAGE_SENSOR_ALS, address, | 111 | HID_USAGE_SENSOR_ALS, address, |
112 | report_id); | 112 | report_id, |
113 | SENSOR_HUB_SYNC); | ||
113 | hid_sensor_power_state(&als_state->common_attributes, | 114 | hid_sensor_power_state(&als_state->common_attributes, |
114 | false); | 115 | false); |
115 | } else { | 116 | } else { |
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index f5a514698fd8..db9c60e47276 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c | |||
@@ -105,7 +105,8 @@ static int prox_read_raw(struct iio_dev *indio_dev, | |||
105 | *val = sensor_hub_input_attr_get_raw_value( | 105 | *val = sensor_hub_input_attr_get_raw_value( |
106 | prox_state->common_attributes.hsdev, | 106 | prox_state->common_attributes.hsdev, |
107 | HID_USAGE_SENSOR_PROX, address, | 107 | HID_USAGE_SENSOR_PROX, address, |
108 | report_id); | 108 | report_id, |
109 | SENSOR_HUB_SYNC); | ||
109 | hid_sensor_power_state(&prox_state->common_attributes, | 110 | hid_sensor_power_state(&prox_state->common_attributes, |
110 | false); | 111 | false); |
111 | } else { | 112 | } else { |
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c index 6294575d2777..4d299f39ffd1 100644 --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c | |||
@@ -178,7 +178,8 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev, | |||
178 | *val = sensor_hub_input_attr_get_raw_value( | 178 | *val = sensor_hub_input_attr_get_raw_value( |
179 | magn_state->common_attributes.hsdev, | 179 | magn_state->common_attributes.hsdev, |
180 | HID_USAGE_SENSOR_COMPASS_3D, address, | 180 | HID_USAGE_SENSOR_COMPASS_3D, address, |
181 | report_id); | 181 | report_id, |
182 | SENSOR_HUB_SYNC); | ||
182 | else { | 183 | else { |
183 | *val = 0; | 184 | *val = 0; |
184 | hid_sensor_power_state(&magn_state->common_attributes, | 185 | hid_sensor_power_state(&magn_state->common_attributes, |
diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/orientation/hid-sensor-incl-3d.c index 1ff181bbbcef..45bed080b4a6 100644 --- a/drivers/iio/orientation/hid-sensor-incl-3d.c +++ b/drivers/iio/orientation/hid-sensor-incl-3d.c | |||
@@ -132,7 +132,8 @@ static int incl_3d_read_raw(struct iio_dev *indio_dev, | |||
132 | *val = sensor_hub_input_attr_get_raw_value( | 132 | *val = sensor_hub_input_attr_get_raw_value( |
133 | incl_state->common_attributes.hsdev, | 133 | incl_state->common_attributes.hsdev, |
134 | HID_USAGE_SENSOR_INCLINOMETER_3D, address, | 134 | HID_USAGE_SENSOR_INCLINOMETER_3D, address, |
135 | report_id); | 135 | report_id, |
136 | SENSOR_HUB_SYNC); | ||
136 | else { | 137 | else { |
137 | hid_sensor_power_state(&incl_state->common_attributes, | 138 | hid_sensor_power_state(&incl_state->common_attributes, |
138 | false); | 139 | false); |
diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c index 764928682df2..ac150f0c8b02 100644 --- a/drivers/iio/pressure/hid-sensor-press.c +++ b/drivers/iio/pressure/hid-sensor-press.c | |||
@@ -108,7 +108,8 @@ static int press_read_raw(struct iio_dev *indio_dev, | |||
108 | *val = sensor_hub_input_attr_get_raw_value( | 108 | *val = sensor_hub_input_attr_get_raw_value( |
109 | press_state->common_attributes.hsdev, | 109 | press_state->common_attributes.hsdev, |
110 | HID_USAGE_SENSOR_PRESSURE, address, | 110 | HID_USAGE_SENSOR_PRESSURE, address, |
111 | report_id); | 111 | report_id, |
112 | SENSOR_HUB_SYNC); | ||
112 | hid_sensor_power_state(&press_state->common_attributes, | 113 | hid_sensor_power_state(&press_state->common_attributes, |
113 | false); | 114 | false); |
114 | } else { | 115 | } else { |