summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-04-01 21:28:10 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-12-12 17:44:12 +0100
commitab2bfa8d34cabf61bf9cc6725c46b30cfc019a27 (patch)
tree6679dc34150d358c12bdac2953a8f94ffdf4bbd4
parent8351ed2cc576307c4097233753043d5da044cddd (diff)
downloadqemu-ab2bfa8d34cabf61bf9cc6725c46b30cfc019a27.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>
-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;
}