From c1ba3a7d4ac7273891b974770196608ddf2c5d43 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 1 Apr 2014 00:13:22 +0200 Subject: unifying: add T400 device This also has the DFU capability :-) Signed-off-by: Peter Wu --- hw/usb/hid-logitech-dj.c | 15 +++++++++++++++ hw/usb/hid-logitech-dj.h | 1 + hw/usb/hid-logitech-hidpp20.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) (limited to 'hw') diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c index 7afd3d8194..403d994457 100644 --- a/hw/usb/hid-logitech-dj.c +++ b/hw/usb/hid-logitech-dj.c @@ -610,6 +610,21 @@ static void hidpp_init_device(USBLtunifyState *s, int device_index, uint16_t pid hd->battery.level = 2; /* Full - 90 % */ hd->battery.critical_perc = 2; break; + case WPID_T400: + hd->info.device_type = DEVTYPE_MOUSE; + hd->info.version = (struct firmware_version) { 0x39, 0x00, 0x29, 3, 0 }; + // Other versions: (2) HW 01.00; (3) TP 04.00 + hd->hid = &s->hid[IFACE_MSE]; + hd->info.report_types = 0x0e; /* Keyboard, Mouse, Consumer Ctrl */ + hd->info.serial = 0x4f6f7073; + memcpy(hd->info.name, "T400", 4); + hd->info.device_name = "Zone Touch Mouse T400"; + hd->report_interval = 8; + hd->battery.nlevels = 4; + hd->battery.level = 3; /* Good - 50 % */ + hd->battery.flags = BAT_FLAG_RECHARGEABLE; + hd->battery.critical_perc = 10; + break; case WPID_T650: hd->info.device_type = DEVTYPE_TOUCHPAD; hd->info.version = (struct firmware_version) { 0x41, 0x01, 0x37, 3, 0 }; diff --git a/hw/usb/hid-logitech-dj.h b/hw/usb/hid-logitech-dj.h index 474ab9ac8c..d0522b2a81 100644 --- a/hw/usb/hid-logitech-dj.h +++ b/hw/usb/hid-logitech-dj.h @@ -147,6 +147,7 @@ typedef struct { #define WPID_K800 0x2010U #define WPID_M525 0x4013U +#define WPID_T400 0x4026U #define WPID_T650 0x4101U /* device and receiver info */ diff --git a/hw/usb/hid-logitech-hidpp20.c b/hw/usb/hid-logitech-hidpp20.c index 7f679d7828..ba9807079e 100644 --- a/hw/usb/hid-logitech-hidpp20.c +++ b/hw/usb/hid-logitech-hidpp20.c @@ -315,12 +315,46 @@ static const HidppFeature features_t650[] = { { 0x1830, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, }; +static const HidppFeature features_t400[] = { + { 0x0001, 0, feat_featureset }, + { 0x0002, 0, feat_featureinfo }, + { 0x0003, 0, feat_devicefwversion }, + { 0x0005, 0, feat_devicename }, + { 0x00C0, 0, feat_dfucontrol }, + { 0x1000, 0, feat_batterystatus }, + { 0x1802, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x1810, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x1830, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x1850, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x1860, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x1890, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x18A0, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x18E3, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x1B00, 0, feat_reprogcontrols }, + { 0x1D4B, 0, NULL }, /* WirelessDeviceStatus events */ + { 0x1DF3, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 0x1E00, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, + { 0x1E80, HIDPP20_FEAT_TYPE_HIDDEN | HIDPP20_FEAT_TYPE_INTERNAL, feat_unknown }, + { 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 }, +// { 0x2120, 0, feat_hiresscrolling }, +// { 0x2200, 0, feat_mousepointer }, +// { 0x6110, HIDPP20_FEAT_TYPE_HIDDEN, feat_touchmouserawpoints }, +// { 0x1B03, 0, feat_reprogcontrolsv3 }, +}; + void hidpp20_init_features(LHidDevice *hd) { switch (hd->info.wireless_pid) { case WPID_M525: hd->info.features = features_m525; hd->info.features_count = ARRAY_SIZE(features_m525); break; + case WPID_T400: + hd->info.features = features_t400; + hd->info.features_count = ARRAY_SIZE(features_t400); + break; case WPID_T650: hd->info.features = features_t650; hd->info.features_count = ARRAY_SIZE(features_t650); -- cgit v1.2.1