diff options
author | Joshua Jun <joshuajun@vivaldi.net> | 2022-10-23 00:24:08 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2022-11-04 09:57:16 +0100 |
commit | 05086f3db530b3b73920b0c8c50f5d5bc8494375 (patch) | |
tree | a31861bb26ca9048ed6190857053fbf9b56b8717 /drivers/hid/hid-wiimote-core.c | |
parent | Merge tag 'for-linus-2022102101' of git://git.kernel.org/pub/scm/linux/kernel... (diff) | |
download | linux-05086f3db530b3b73920b0c8c50f5d5bc8494375.tar.xz linux-05086f3db530b3b73920b0c8c50f5d5bc8494375.zip |
HID: wiimote: Add support for the DJ Hero turntable
This adds support for the turntable extension for Wiimote devices.
jstest-gtk and html5 gamepad tester show everything correctly
but when trying to map the controller in software like rpcs3 or dolphin
it currently doesn't map correctly
Co-authored-by: Bogdan Petru <thonkdifferent@outlook.com>
Signed-off-by: Bogdan Petru <thonkdifferent@outlook.com>
Signed-off-by: Joshua Jun <joshuajun@vivaldi.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-wiimote-core.c')
-rw-r--r-- | drivers/hid/hid-wiimote-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 4399d6c6afef..09db8111dc26 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -458,6 +458,9 @@ static __u8 wiimote_cmd_read_ext(struct wiimote_data *wdata, __u8 *rmem) if (rmem[0] == 0x00 && rmem[1] == 0x00 && rmem[4] == 0x01 && rmem[5] == 0x03) return WIIMOTE_EXT_GUITAR; + if (rmem[0] == 0x03 && rmem[1] == 0x00 && + rmem[4] == 0x01 && rmem[5] == 0x03) + return WIIMOTE_EXT_TURNTABLE; return WIIMOTE_EXT_UNKNOWN; } @@ -495,6 +498,7 @@ static bool wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype) case WIIMOTE_EXT_GUITAR: wmem = 0x07; break; + case WIIMOTE_EXT_TURNTABLE: case WIIMOTE_EXT_NUNCHUK: wmem = 0x05; break; @@ -1082,6 +1086,7 @@ static const char *wiimote_exttype_names[WIIMOTE_EXT_NUM] = { [WIIMOTE_EXT_PRO_CONTROLLER] = "Nintendo Wii U Pro Controller", [WIIMOTE_EXT_DRUMS] = "Nintendo Wii Drums", [WIIMOTE_EXT_GUITAR] = "Nintendo Wii Guitar", + [WIIMOTE_EXT_TURNTABLE] = "Nintendo Wii Turntable" }; /* @@ -1669,6 +1674,8 @@ static ssize_t wiimote_ext_show(struct device *dev, return sprintf(buf, "drums\n"); case WIIMOTE_EXT_GUITAR: return sprintf(buf, "guitar\n"); + case WIIMOTE_EXT_TURNTABLE: + return sprintf(buf, "turntable\n"); case WIIMOTE_EXT_UNKNOWN: default: return sprintf(buf, "unknown\n"); |