diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2014-01-23 18:50:21 -0800 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-17 15:09:46 +0100 |
commit | e02cee4819ae51f26333471c8eed50678b08572a (patch) | |
tree | d3d345f5eacbaf69b952ff23e16401e02973c8d5 /include/linux/hid-sensor-hub.h | |
parent | 4988abf1749241bc80600a6b3283d03898d2717c (diff) |
HID: hid-sensor-hub: Add selector api
In some report descriptors, they leave holes in the selectors. In
this case if we use hardcoded selector values, this will result
in invalid values. For example, if there is selectors defined for
Power State from OFF to D0 to D3. We can't use indexes of these states
if some states are not implemented or not present in the report decriptors.
In this case, we need to get the indexes from report descriptors.
One API is added to get the index of a selector. This API will
search for usage id in the field usage list and return the index.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid-sensor-hub.h')
-rw-r--r-- | include/linux/hid-sensor-hub.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index b914ca3f57b..205eba0326a 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h @@ -218,4 +218,7 @@ int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st, int hid_sensor_read_samp_freq_value(struct hid_sensor_common *st, int *val1, int *val2); +int hid_sensor_get_usage_index(struct hid_sensor_hub_device *hsdev, + u32 report_id, int field_index, u32 usage_id); + #endif |