Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Benjamin Tissoires and committed by
Linus Torvalds
522214d9 044d5dfd

+3 -2
+3 -2
drivers/input/rmi4/rmi_f30.c
··· 258 258 259 259 /* 260 260 * Buttonpad could be also inferred from f30->has_mech_mouse_btns, 261 - * but I am not sure, so use only the pdata info. 261 + * but I am not sure, so use only the pdata info and the number of 262 + * mapped buttons. 262 263 */ 263 - if (pdata->f30_data.buttonpad) 264 + if (pdata->f30_data.buttonpad || (button - BTN_LEFT == 1)) 264 265 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); 265 266 266 267 return 0;