Input: wacom - add reporting of SW_MUTE_DEVICE events

New Intuos series models added a hardware switch to turn touch
data on/off. The state of the switch is reported periodically
from the tablet. To report the state the driver will emit SW_MUTE_DEVICE
events.

Reviewed_by: Chris Bagwell <chris@cnpbagwell.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Compare against full 32-bit HID Usage value when parsing

A HID Usage is a 32-bit value: an upper 16-bit "page" and a lower
16-bit ID. Prior to this patch, we performed a switch() on the
ID without concern for page. To prevent different pages from
doing triggering the wrong behavior, an additional set of checks
was performed after the correct ID was located.

The old design makes it impossible to have distinct cases for two
usages that share IDs. This patch changes things so that we
switch on the actual 32-bit usage by combining the page and ID
into a single value.
Override 'pressure_max' with value from HID_USAGE_PRESSURE

The 0xEC sensor is used in multiple tablet PCs and curiously has
versions that report 512 levels of pressure (Samsung Slate 7)
as well as versions that report 1024 levels (Lenovo Thinkpad Yoga).
To allow both versions to work properly, we use the value of
HID_USAGE_PRESSURE reported through the HID descriptor to
override pressure_max.

 ** HISTORIC NOTE **

In the 2.6.30 tree, we had some basic pressure support. However,
according to the comments, there wasn't actually a reported
maximum. We currently expect a logical maximum following this,
but that apparently doesn't always hold. It was forced to 255
here.

Also, apparently fingers used to report the amount of sensed
capacitance (a reasonable indicator of pressure) and included
info in the HID descriptor. (HID_USAGE_DESKTOP << 16 | HID_USAGE_UNDEFINED)
stored a 16-bit value at report[i+3] just like our current
pressure. This test was removed from the mainline a few years
ago because the the reported capacitance values were generally
too bogus to be useful.
2.6.38 parse fix
2.6.38 pressure
2.6.36 parse
2.6.36 pressure
2.6.30 parse
2.6.30 pressure