summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-03-24 14:40:15 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-03-24 14:40:15 +0100
commitd26faef5d3e70ab8072f6387dd97b2527b8f0e39 (patch)
treef2b4e2d0fcf3d28b8250ec4caa37552a0efbdfa2 /hw
parentdd6315d9bdf86a7c1feb3f47b0840d33f4d99cd5 (diff)
downloadqemu-d26faef5d3e70ab8072f6387dd97b2527b8f0e39.tar.gz
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 <peter@lekensteyn.nl>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/hid-logitech-hidpp20.c15
1 files changed, 15 insertions, 0 deletions
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 },
};