From 8e22ecb603c88b7397ab2e80b7b0811b8a1318f5 Mon Sep 17 00:00:00 2001 From: Nicolas Adenis-Lamarre Date: Mon, 26 Aug 2013 19:14:48 +0200 Subject: HID: wiimote: add support for Guitar-Hero guitars Apart from drums, Guitar-Hero also ships with guitars. Use the recently introduced input ABS/BTN-bits to report this to user-space. Devices are reported as "Nintendo Wii Remote Guitar". If I ever get my hands on "RockBand" guitars, I will try to report them via the same interface so user-space does not have to bother which device it deals with. Signed-off-by: Nicolas.Adenis-Lamarre (add commit-msg and adjust to new BTN_* IDs) Signed-off-by: David Herrmann Signed-off-by: Jiri Kosina --- drivers/hid/hid-wiimote-core.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/hid/hid-wiimote-core.c') diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 946cdeff4798..d3055d1dbc06 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -459,6 +459,9 @@ static __u8 wiimote_cmd_read_ext(struct wiimote_data *wdata, __u8 *rmem) if (rmem[0] == 0x01 && rmem[1] == 0x00 && rmem[4] == 0x01 && rmem[5] == 0x03) return WIIMOTE_EXT_GUITAR_HERO_DRUMS; + if (rmem[0] == 0x00 && rmem[1] == 0x00 && + rmem[4] == 0x01 && rmem[5] == 0x03) + return WIIMOTE_EXT_GUITAR_HERO_GUITAR; return WIIMOTE_EXT_UNKNOWN; } @@ -493,6 +496,7 @@ static bool wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype) switch (exttype) { case WIIMOTE_EXT_CLASSIC_CONTROLLER: case WIIMOTE_EXT_GUITAR_HERO_DRUMS: + case WIIMOTE_EXT_GUITAR_HERO_GUITAR: wmem = 0x07; break; case WIIMOTE_EXT_NUNCHUK: @@ -1084,6 +1088,7 @@ static const char *wiimote_exttype_names[WIIMOTE_EXT_NUM] = { [WIIMOTE_EXT_BALANCE_BOARD] = "Nintendo Wii Balance Board", [WIIMOTE_EXT_PRO_CONTROLLER] = "Nintendo Wii U Pro Controller", [WIIMOTE_EXT_GUITAR_HERO_DRUMS] = "Nintendo Wii Guitar Hero Drums", + [WIIMOTE_EXT_GUITAR_HERO_GUITAR] = "Nintendo Wii Guitar Hero Guitar", }; /* @@ -1672,6 +1677,8 @@ static ssize_t wiimote_ext_show(struct device *dev, return sprintf(buf, "procontroller\n"); case WIIMOTE_EXT_GUITAR_HERO_DRUMS: return sprintf(buf, "drums\n"); + case WIIMOTE_EXT_GUITAR_HERO_GUITAR: + return sprintf(buf, "guitar\n"); case WIIMOTE_EXT_UNKNOWN: /* fallthrough */ default: -- cgit v1.2.3