mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
HID: hid-sensor-hub: Force logical minimum to 1 for power and report state
In the reference HID sensor hub firmware all Named array enums were 0-based. There is no description of the default base of enums in HID sensor hub specification as logical minimum should have set this base value. Every sensor hub implemented enum as 1-based, without explicitly setting logical minimum to 1, because of the implementation by one of the major OS vendor. In Linux we used logical minimum to decide the enum base. Some sensor hub FWs already changed logical minimum from 0 to 1. We hoped that every other vendor will follow. But that didn't happen and we had to fix the report header for every sensor hub to change logical minimum to 1 by using .report_fixup() callback. So for every new sensor hub we had to modify source code by adding this quirk based on the vendor and device id. This is becoming a maintenance burden. This patch hardcodes the logical minimum of power and report state attributes to 1. In this way we can remove the existing quirks and also we don't have to add more quirks. Signed-off-by: Srinivas Pandruvada <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
a9d0683e0b
commit
b0f847e16c
2 changed files with 3 additions and 94 deletions
|
|
@ -473,6 +473,9 @@ int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev,
|
|||
HID_USAGE_SENSOR_PROY_POWER_STATE,
|
||||
&st->power_state);
|
||||
|
||||
st->power_state.logical_minimum = 1;
|
||||
st->report_state.logical_minimum = 1;
|
||||
|
||||
sensor_hub_input_get_attribute_info(hsdev,
|
||||
HID_FEATURE_REPORT, usage_id,
|
||||
HID_USAGE_SENSOR_PROP_SENSITIVITY_ABS,
|
||||
|
|
|
|||
Loading…
Reference in a new issue