mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
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:
parent
cb67126f32
commit
b3f4737d00
10 changed files with 64 additions and 44 deletions
|
@ -213,7 +213,7 @@ static int hid_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
|||
/* get a report with all values through requesting one value */
|
||||
sensor_hub_input_attr_get_raw_value(time_state->common_attributes.hsdev,
|
||||
HID_USAGE_SENSOR_TIME, hid_time_addresses[0],
|
||||
time_state->info[0].report_id);
|
||||
time_state->info[0].report_id, SENSOR_HUB_SYNC);
|
||||
/* wait for all values (event) */
|
||||
ret = wait_for_completion_killable_timeout(
|
||||
&time_state->comp_last_time, HZ*6);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue