Input: trackpoint - only expose supported controls for Elan, ALPS and NXP
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 5 Jan 2018 21:28:47 +0000 (13:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 13:03:42 +0000 (14:03 +0100)
commit203a60330e040f2aa326f028b8c41a774bcb0990
tree7f08dacd9b01a579358deb8f80e7eca4c9251706
parent7e4cd0ad576a75d26ea1658cf76c2ce00774ba73
Input: trackpoint - only expose supported controls for Elan, ALPS and NXP

commit 2a924d71794c530e55e73d0ce2cc77233307eaa9 upstream.

The newer trackpoints from ALPS, Elan and NXP implement a very limited
subset of extended commands and controls that the original trackpoints
implemented, so we should not be exposing not working controls in sysfs.
The newer trackpoints also do not implement "Power On Reset" or "Read
Extended Button Status", so we should not be using these commands during
initialization.

While we are at it, let's change "unsigned char" to u8 for byte data or
bool for booleans and use better suited error codes instead of -1.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/mouse/trackpoint.c
drivers/input/mouse/trackpoint.h