From d26faef5d3e70ab8072f6387dd97b2527b8f0e39 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 24 Mar 2014 14:40:15 +0100 Subject: unifying: partially implement ReprogControls The actual controls themselves are not implemented, for now always return as if there are no re-programmable controls for software. Signed-off-by: Peter Wu --- hw/usb/hid-logitech-hidpp20.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/usb/hid-logitech-hidpp20.c b/hw/usb/hid-logitech-hidpp20.c index 4bebe0af44..001eea0479 100644 --- a/hw/usb/hid-logitech-hidpp20.c +++ b/hw/usb/hid-logitech-hidpp20.c @@ -238,6 +238,20 @@ static HIDPP20_FEATURE(feat_unknown) return -HIDPP20_ERR_CODE_UNSUPPORTED; } +static HIDPP20_FEATURE(feat_reprogcontrols) +{ + /* TODO: if controls really matter, add hd->info.controls{,_count} */ + switch (fn) { + case 0: /* ctrlIDCount = GetCount() */ + params[0] = 0; + return 1; + case 1: /* ctrlIDIndex+flags list = GetCtrlIDInfo(ctrlIDIndex) */ + return -HIDPP20_ERR_CODE_OUTOFRANGE; + default: + return -HIDPP20_ERR_CODE_INVALID_FUNCTION_ID; + } +} + /* root feature not included! */ static const HidppFeature features_m525[] = { { 0x0001, 0, feat_featureset }, @@ -246,6 +260,7 @@ static const HidppFeature features_m525[] = { { 0x1000, 0, feat_batterystatus }, { 0x1D4B, 0, NULL }, /* WirelessDeviceStatus events */ { 0x1DF3, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, + { 0x1B00, 0, feat_reprogcontrols }, { 0x1DF0, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, { 0x1F03, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, }; -- cgit v1.2.1