aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2015-02-19 18:33:56 -0500
committerJiri Kosina <jkosina@suse.cz>2015-02-23 09:16:37 -0500
commitb3f4737d00de317d1549d5cb5b1dad90e19f5cec (patch)
tree92cb55d8f19f340f2daf779336368cb3a34e8426 /include
parentcb67126f32f008b9abe97fbfca9b23a797b2458a (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 'include')
-rw-r--r--include/linux/hid-sensor-hub.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index 60a34277ddf2..4c49b041922d 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -169,19 +169,27 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
169 struct hid_sensor_hub_attribute_info *info); 169 struct hid_sensor_hub_attribute_info *info);
170 170
171/** 171/**
172* sensor_hub_input_attr_get_raw_value() - Synchronous read request 172* sensor_hub_input_attr_get_raw_value() - Attribute read request
173* @usage_id: Attribute usage id of parent physical device as per spec 173* @usage_id: Attribute usage id of parent physical device as per spec
174* @attr_usage_id: Attribute usage id as per spec 174* @attr_usage_id: Attribute usage id as per spec
175* @report_id: Report id to look for 175* @report_id: Report id to look for
176* @flag: Synchronous or asynchronous read
176* 177*
177* Issues a synchronous read request for an input attribute. Returns 178* Issues a synchronous or asynchronous read request for an input attribute.
178* data upto 32 bits. Since client can get events, so this call should 179* Returns data upto 32 bits.
179* not be used for data paths, this will impact performance.
180*/ 180*/
181 181
182enum sensor_hub_read_flags {
183 SENSOR_HUB_SYNC,
184 SENSOR_HUB_ASYNC,
185};
186
182int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, 187int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
183 u32 usage_id, 188 u32 usage_id,
184 u32 attr_usage_id, u32 report_id); 189 u32 attr_usage_id, u32 report_id,
190 enum sensor_hub_read_flags flag
191);
192
185/** 193/**
186* sensor_hub_set_feature() - Feature set request 194* sensor_hub_set_feature() - Feature set request
187* @report_id: Report id to look for 195* @report_id: Report id to look for