HID: wacom: Replace touch_max fixup code with static touch_max definitions
authorJason Gerecke <killertofu@gmail.com>
Mon, 25 Jun 2018 20:24:34 +0000 (13:24 -0700)
committerJiri Kosina <jkosina@suse.cz>
Tue, 3 Jul 2018 10:07:52 +0000 (12:07 +0200)
commit29b9e14846f1ff201c4c1ba4fdb868dcdce6c760
treed8d5c2853ac7f97adc711ca30e98676fabaecf67
parent81e97f01371f4e1701feeafe484665112cd9ddc2
HID: wacom: Replace touch_max fixup code with static touch_max definitions

Detecting the number of supported touches for a particular device used
to be tricky, both because early forms of the driver didn't have a very
good HID parser and because early hardware didn't always advertise the
actual number. At the time, we added a block of code which would ensure
that touch_max would always be equal to at least 1 on any touch device,
and relied on setting touch_max to e.g. 2 only for the multitouch-capable
exceptions.

The common case has since flipped, and the driver and descriptors can
reliably detect the number of touches supported by modern sensors.
Because of this, it makes sense to remove the fixup code and instead
place static declarations of "touch_max = 1" for these old devices. It
isn't entirely clear if all 2-finger devices actually report a maximum
number of touches so we leave these declarations still in place.

For the eagle-eyed, the "> BAMBOO_PT" condition was originally equivalent
to ">= TABLETPC", which is what the intent was. This commit doesn't have
to consider the types introduced in the interim since they shouldn't be
affected, hence why only the tablet PC definitions have been modified.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_sys.c
drivers/hid/wacom_wac.c