]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
HID: hid-sensor-hub: Force logical minimum to 1 for power and report state
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Mon, 7 Aug 2017 04:52:01 +0000 (21:52 -0700)
committerJiri Kosina <jkosina@suse.cz>
Wed, 9 Aug 2017 20:15:59 +0000 (22:15 +0200)
commitb0f847e16c1ea6ead5680cf58cade70918363315
tree690755027b3329bac77c861364d10e6c83ace641
parenta9d0683e0b62b46c7a5d0ebd8f642d8f9a4b7b32
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 <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sensor-hub.c
drivers/iio/common/hid-sensors/hid-sensor-attributes.c