hidptp -- a quick and dirty utility to debug Precision Touchpad (PTP) devices

Build hidptp by typing "make".

Use the utility as follows (requires root privileges!):

./hidptp <hiddev device node> <enable or disable PTP mode>

For example,
sudo ./hidptp /dev/usb/hiddev0 0

will disable PTP mode in device hiddev0. It is hard to know which physical device
"hiddev0" represents, but on my Surface Pro 2 it is the Type Cover v2. You may
need to test hiddev1, hiddev2, etc.

The utility will print the name of the device (so for a Type/Touch Cover 1/2 it
should be "MICROSOFT SAM"), and then enable or disable PTP mode as requested.

Current Linux versions can't work when the touchpad is configured in PTP mode.
So in most scenarios you want to disable PTP mode.

As an additional feature the tool will start listening and dumping events from
the selected device. Stop with Ctrl+C.