Skip to content

Commit 10e87dc

Browse files
aduggan-synaJiri Kosina
authored andcommitted
HID: rmi: Disable populating F30 when the touchpad has physical buttons
Physical buttons do not use F30 to report their state and in some cases the data reported in F30 is incorrect and inconsistent with what is reported by the HID descriptor. When physical buttons are present, ignore F30 and let hid-input report buttons based on what is defined in the HID descriptor. Signed-off-by: Andrew Duggan <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 6efdb11 commit 10e87dc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/hid/hid-rmi.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ static int rmi_populate_f30(struct hid_device *hdev)
10131013

10141014
static int rmi_populate(struct hid_device *hdev)
10151015
{
1016+
struct rmi_data *data = hid_get_drvdata(hdev);
10161017
int ret;
10171018

10181019
ret = rmi_scan_pdt(hdev);
@@ -1033,9 +1034,11 @@ static int rmi_populate(struct hid_device *hdev)
10331034
return ret;
10341035
}
10351036

1036-
ret = rmi_populate_f30(hdev);
1037-
if (ret)
1038-
hid_warn(hdev, "Error while initializing F30 (%d).\n", ret);
1037+
if (!(data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)) {
1038+
ret = rmi_populate_f30(hdev);
1039+
if (ret)
1040+
hid_warn(hdev, "Error while initializing F30 (%d).\n", ret);
1041+
}
10391042

10401043
return 0;
10411044
}

0 commit comments

Comments
 (0)