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>
This commit is contained in:
Srinivas Pandruvada 2015-02-19 15:33:56 -08:00 committed by Jiri Kosina
parent cb67126f32
commit b3f4737d00
10 changed files with 64 additions and 44 deletions

View file

@ -169,19 +169,27 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
struct hid_sensor_hub_attribute_info *info);
/**
* sensor_hub_input_attr_get_raw_value() - Synchronous read request
* sensor_hub_input_attr_get_raw_value() - Attribute read request
* @usage_id: Attribute usage id of parent physical device as per spec
* @attr_usage_id: Attribute usage id as per spec
* @report_id: Report id to look for
* @flag: Synchronous or asynchronous read
*
* Issues a synchronous read request for an input attribute. Returns
* data upto 32 bits. Since client can get events, so this call should
* not be used for data paths, this will impact performance.
* Issues a synchronous or asynchronous read request for an input attribute.
* Returns data upto 32 bits.
*/
enum sensor_hub_read_flags {
SENSOR_HUB_SYNC,
SENSOR_HUB_ASYNC,
};
int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
u32 usage_id,
u32 attr_usage_id, u32 report_id);
u32 usage_id,
u32 attr_usage_id, u32 report_id,
enum sensor_hub_read_flags flag
);
/**
* sensor_hub_set_feature() - Feature set request
* @report_id: Report id to look for