Skip to content

Commit

Permalink
HID: rmi: Disable populating F30 when the touchpad has physical buttons
Browse files Browse the repository at this point in the history
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 <aduggan@synaptics.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Andrew Duggan authored and Jiri Kosina committed Jun 16, 2015
1 parent 6efdb11 commit 10e87dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/hid/hid-rmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ static int rmi_populate_f30(struct hid_device *hdev)

static int rmi_populate(struct hid_device *hdev)
{
struct rmi_data *data = hid_get_drvdata(hdev);
int ret;

ret = rmi_scan_pdt(hdev);
Expand All @@ -1033,9 +1034,11 @@ static int rmi_populate(struct hid_device *hdev)
return ret;
}

ret = rmi_populate_f30(hdev);
if (ret)
hid_warn(hdev, "Error while initializing F30 (%d).\n", ret);
if (!(data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)) {
ret = rmi_populate_f30(hdev);
if (ret)
hid_warn(hdev, "Error while initializing F30 (%d).\n", ret);
}

return 0;
}
Expand Down

0 comments on commit 10e87dc

Please sign in to comment.