From 92095d960146f62f24a124fb657b4ce3cb3c6b4b Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 1 Apr 2014 21:28:10 +0200 Subject: 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 --- hw/usb/hid-logitech-hidpp20.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.1