summaryrefslogtreecommitdiffstats
path: root/drivers/input/rmi4/rmi_f30.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2017-03-01 09:57:00 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2017-03-01 19:01:56 +0100
commit522214d9be9c9f00f34ed89cb95e901b7ac31c59 (patch)
tree7329ec47b24cec04055addd9a05f5ea7b323f495 /drivers/input/rmi4/rmi_f30.c
parentMerge tag 'sound-fix-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
downloadlinux-522214d9be9c9f00f34ed89cb95e901b7ac31c59.tar.xz
linux-522214d9be9c9f00f34ed89cb95e901b7ac31c59.zip
Input: rmi4 - f30: detect INPUT_PROP_BUTTONPAD from the button count
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>
Diffstat (limited to '')
-rw-r--r--drivers/input/rmi4/rmi_f30.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c
index 3422464af229..198678613382 100644
--- a/drivers/input/rmi4/rmi_f30.c
+++ b/drivers/input/rmi4/rmi_f30.c
@@ -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;