Skip to content

Commit

Permalink
Input: rmi4 - f30: detect INPUT_PROP_BUTTONPAD from the button count
Browse files Browse the repository at this point in the history
INPUT_PROP_BUTTONPAD is currently only set through the platform data.
The RMI4 header doc says that this property is there to force the
buttonpad property, so we also need to detect it by looking at
the exported buttons count.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Benjamin Tissoires authored and Linus Torvalds committed Mar 1, 2017
1 parent 044d5df commit 522214d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/input/rmi4/rmi_f30.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,

/*
* Buttonpad could be also inferred from f30->has_mech_mouse_btns,
* but I am not sure, so use only the pdata info.
* but I am not sure, so use only the pdata info and the number of
* mapped buttons.
*/
if (pdata->f30_data.buttonpad)
if (pdata->f30_data.buttonpad || (button - BTN_LEFT == 1))
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);

return 0;
Expand Down

0 comments on commit 522214d

Please sign in to comment.