From ccf61b621fd4cc6eb5ae90bfc5595b5f4644e351 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 1 Apr 2014 19:26:36 +0200 Subject: unifying: implement unknown hidden 0x2101 feature for T400 This got called during the initial start up of SetPoint. It probably has something to do with scrolling. Signed-off-by: Peter Wu --- hw/usb/hid-logitech-hidpp20.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/hw/usb/hid-logitech-hidpp20.c b/hw/usb/hid-logitech-hidpp20.c index c69f6fd9c0..72e610b5e2 100644 --- a/hw/usb/hid-logitech-hidpp20.c +++ b/hw/usb/hid-logitech-hidpp20.c @@ -314,6 +314,31 @@ static HIDPP20_FEATURE(feat_verticalscrolling) } } +/* unknown, hidden feature found on T400 */ +static HIDPP20_FEATURE(feat_2101) +{ + switch (fn) { + case 0: /* ?? func with no params */ + params[0] = params[1] = params[2] = 3; + params[3] = 2; + return 4; + case 1: /* ?? */ + if (params[0] > 3) { + return -HIDPP20_ERR_CODE_INVALIDARGUMENT; + } + params[0] = params[1] = 3; + params[2] = params[0]; + params[3] = 2; + return 4; + case 2: /* ?? not seen, but probed manually. No params */ + params[0] = 0; + params[1] = 0x14; + return 2; + default: + return -HIDPP20_ERR_CODE_INVALID_FUNCTION_ID; + } +} + static HIDPP20_FEATURE(feat_hiresscrolling) { switch (fn) { @@ -447,7 +472,7 @@ static const HidppFeature features_t400[] = { { 0x1F03, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, { 0x1F04, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, { 0x2100, 0, feat_verticalscrolling }, - { 0x2101, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, + { 0x2101, HIDPP20_FEAT_TYPE_HIDDEN, feat_2101 }, { 0x2120, 0, feat_hiresscrolling }, { 0x2200, 0, feat_mousepointer }, { 0x6110, HIDPP20_FEAT_TYPE_HIDDEN, feat_touchmouserawpoints }, -- cgit v1.2.1