Skip to content

Commit eb96483

Browse files
spandruvadaJiri Kosina
authored andcommitted
HID: hid-sensor-hub: fix attribute read for logical usage id
For defining enumeration values like report or power status events, the enumeration usage ids are enclosed in a logical collection. In this case we need to match logical usage id for pending read on this usage id. For example, in the below field, when read is requested for 0319, the report will contain one of the status usages like 850, 851 etc. In this case the raw event will not match 0319. So when logical collection matches, then wake up the pending thread. Physical(Sensor.OtherCustom) Logical(Sensor.0319) Application(Sensor.Sensor) Usage(6) Sensor.0850 Sensor.0851 Sensor.0852 Sensor.0853 Sensor.0854 Sensor.0855 Logical Minimum(1) Logical Maximum(5) Report Size(8) Report Count(1) Report Offset(24) Flags( Array Absolute ) Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 3950e03 commit eb96483

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/hid/hid-sensor-hub.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,10 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
495495
ptr += sz;
496496
continue;
497497
}
498-
if (hsdev->pending.status && hsdev->pending.attr_usage_id ==
499-
report->field[i]->usage->hid) {
498+
if (hsdev->pending.status && (hsdev->pending.attr_usage_id ==
499+
report->field[i]->usage->hid ||
500+
hsdev->pending.attr_usage_id ==
501+
report->field[i]->logical)) {
500502
hid_dbg(hdev, "data was pending ...\n");
501503
hsdev->pending.raw_data = kmemdup(ptr, sz, GFP_ATOMIC);
502504
if (hsdev->pending.raw_data)

0 commit comments

Comments
 (0)