summaryrefslogtreecommitdiff
path: root/hw/usb/hid-logitech-hidpp20.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-04-01 21:28:10 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-04-01 21:28:10 +0200
commit92095d960146f62f24a124fb657b4ce3cb3c6b4b (patch)
tree92396958fceb665e17168d7bb6f68224409c17d5 /hw/usb/hid-logitech-hidpp20.c
parentccf61b621fd4cc6eb5ae90bfc5595b5f4644e351 (diff)
downloadqemu-92095d960146f62f24a124fb657b4ce3cb3c6b4b.tar.gz
unifying: partially implement TouchpadRawXY for T650
This feature will probably not be supported. Right now it reports some information, but as the emulated device does not send raw output, it is kind of broken. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw/usb/hid-logitech-hidpp20.c')
-rw-r--r--hw/usb/hid-logitech-hidpp20.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/hw/usb/hid-logitech-hidpp20.c b/hw/usb/hid-logitech-hidpp20.c
index 72e610b5e2..51e9596151 100644
--- a/hw/usb/hid-logitech-hidpp20.c
+++ b/hw/usb/hid-logitech-hidpp20.c
@@ -376,8 +376,28 @@ static HIDPP20_FEATURE(feat_mousepointer)
static HIDPP20_FEATURE(feat_touchpadrawxy)
{
- return -HIDPP20_ERR_CODE_UNSUPPORTED; /* TODO STUB */
switch (fn) {
+ case 0: /* info = GetTouchpadInfo() */
+ /* NOTE: hard-coded for T650 */
+ params[0] = 0x0B; params[1] = 0x10; /* X max pixels */
+ params[2] = 0x09; params[3] = 0x3C; /* Y max pixels */
+ params[4] = 0x08; /* Z data range (in bits) */
+ params[5] = 0x08; /* area data size (in bits) */
+ params[6] = 0x08; /* timestamp unit 1ms */
+ params[7] = 0x0A; /* max fingers */
+ params[8] = 0x01; /* origin position: lower-left */
+ params[13] = 0x02; params[14] = 0x58; /* DPI (same for X and Y) */
+ return 15;
+ case 1: /* state = GetRawReportState() */
+ /* disable raw */
+ params[0] = 0;
+ return 1;
+ case 2: /* SetRawReportState(state) */
+ if (params[0] & 0x11) {
+ /* raw mode is not implemented (note: not sent by real hw) */
+ return -HIDPP20_ERR_CODE_UNSUPPORTED;
+ }
+ return 0;
default:
return -HIDPP20_ERR_CODE_INVALID_FUNCTION_ID;
}