summaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-03-25 00:08:09 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-03-25 00:08:09 +0100
commit086f6beea02ecf42afb2fcfe0ccef91a5709dfc6 (patch)
tree7fa3e3c1fc959132c5d6c79575f1579ec539fffe /hw/usb
parent1f5a4c0f0c6b7dde640dca9b949fe3e6d7ee66f2 (diff)
downloadqemu-086f6beea02ecf42afb2fcfe0ccef91a5709dfc6.tar.gz
unifying: add T650 features, start re firmware update
The M525 was nice for testing stuff out, but it gets really interesting with the T650 which has a firmware update available. Details will be available in https://git.lekensteyn.nl/ltunify/tree/firmware-update.txt Add the initial feature set for T650, complete M525 feature set (commented out since unknown and seemingly uninteresting to implement). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/hid-logitech-dj.c11
-rw-r--r--hw/usb/hid-logitech-hidpp20.c50
2 files changed, 60 insertions, 1 deletions
diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c
index d10e58d1bb..58d4aecc59 100644
--- a/hw/usb/hid-logitech-dj.c
+++ b/hw/usb/hid-logitech-dj.c
@@ -309,6 +309,14 @@ static void hidpp_process_receiver_report(USBLtunifyState *s, HidppMsg *msg)
hidpp_queue_error(s, msg, HIDPP_ERR_INVALID_VALUE);
}
break;
+ case SET_REG(0xF0): /* Enter DFU mode?? */
+ // 4c 54 02: "LT" + device index?
+ // (followed by read f0)
+ // 58 49 54: "XIT"
+ // (followed by GET_LONG_REG(0xB3)(0, 0, 0))
+ break;
+ case GET_REG(0xF0): /* Get DFU information? */
+ break;
case GET_REG(0xF1):
hidpp_process_version_request(s, ms, &rcvr->info.version);
break;
@@ -587,7 +595,7 @@ static void hidpp_init_device(USBLtunifyState *s, int device_index, int devtype)
/* hd->info.device_name N/A for HID++ 1.0 */
hd->report_interval = 20;
break;
- case DEVTYPE_MOUSE:
+ //case DEVTYPE_MOUSE:
hd->info.version = (struct firmware_version) { 0x27, 0x02, 0x28, 0, 0 };
hd->hid = &s->hid[IFACE_MSE];
hd->info.report_types = 4; /* HID Collection: Mouse */
@@ -600,6 +608,7 @@ static void hidpp_init_device(USBLtunifyState *s, int device_index, int devtype)
hd->battery.level = 2; /* Full - 90 % */
hd->battery.critical_perc = 2;
break;
+ case DEVTYPE_MOUSE:
case DEVTYPE_TOUCHPAD:
/* TODO: perhaps "unpair" mouse and use this touchpad instead? */
hd->hid = &s->hid[IFACE_MSE];
diff --git a/hw/usb/hid-logitech-hidpp20.c b/hw/usb/hid-logitech-hidpp20.c
index 915a028b47..4e43eb26a1 100644
--- a/hw/usb/hid-logitech-hidpp20.c
+++ b/hw/usb/hid-logitech-hidpp20.c
@@ -232,6 +232,24 @@ static HIDPP20_FEATURE(feat_batterystatus)
}
}
+static HIDPP20_FEATURE(feat_featureinfo)
+{
+ return -HIDPP20_ERR_CODE_UNSUPPORTED; /* TODO: figure out */
+ switch (fn) {
+ default:
+ return -HIDPP20_ERR_CODE_INVALID_FUNCTION_ID;
+ }
+}
+
+static HIDPP20_FEATURE(feat_dfucontrol)
+{
+ return -HIDPP20_ERR_CODE_UNSUPPORTED; /* TODO: figure out */
+ switch (fn) {
+ default:
+ return -HIDPP20_ERR_CODE_INVALID_FUNCTION_ID;
+ }
+}
+
static HIDPP20_FEATURE(feat_unknown)
{
/* Undocumented feature */
@@ -263,6 +281,34 @@ static const HidppFeature features_m525[] = {
{ 0x1B00, 0, feat_reprogcontrols },
{ 0x1DF0, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown },
{ 0x1F03, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown },
+// { 0x2100, 0, feat_verticalscrolling },
+// { 0x2120, 0, feat_hiresscrolling },
+// { 0x2200, 0, feat_mousepointer },
+};
+
+static const HidppFeature features_t650[] = {
+ { 0x0001, 0, feat_featureset },
+ { 0x0002, 0, feat_featureinfo },
+ { 0x0003, 0, feat_devicefwversion },
+ { 0x0005, 0, feat_devicename },
+ { 0x1000, 0, feat_batterystatus },
+ { 0x1D4B, 0, NULL }, /* WirelessDeviceStatus events */
+ { 0x1DF3, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
+ { 0x1B00, 0, feat_reprogcontrols },
+ { 0x1F03, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
+// { 0x2100, 0, feat_verticalscrolling },
+// { 0x2120, 0, feat_hiresscrolling },
+// { 0x2200, 0, feat_mousepointer },
+ { 0x00C0, 0, feat_dfucontrol },
+ { 0x1E80, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
+// { 0x6100, 0, feat_touchpadrawxy },
+ { 0x1860, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
+ { 0x1E00, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown },
+// { 0x1B01, 0, feat_reprogcontrolsv2 },
+ { 0x1890, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
+ { 0x18E5, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
+ { 0x18A0, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
+ { 0x1830, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown },
};
void hidpp20_init_features(LHidDevice *hd) {
@@ -271,6 +317,10 @@ void hidpp20_init_features(LHidDevice *hd) {
hd->info.features = features_m525;
hd->info.features_count = ARRAY_SIZE(features_m525);
break;
+ case 0x4026:
+ hd->info.features = features_t650;
+ hd->info.features_count = ARRAY_SIZE(features_t650);
+ break;
}
}