diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-05-05 23:13:00 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-06-03 11:07:03 +0200 |
commit | 9d6f9ecb0cbf714f39c0ae492fe8678bcb93a001 (patch) | |
tree | 673e3e906b49c1e0b9672e5e54a2a52f4cb12bff /drivers/hid/hid-wiimote-core.c | |
parent | b6ee67b37c02790ba9bd170ee1fe0d2cd2941001 (diff) |
HID: wiimote: add Classic Controller extension
Add a new extension module for the classic controller so we get hotplug
support for this device. It is mostly the same as the old static classic
controller parser.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
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 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index dedf3c84e243..f6c4773fac56 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -446,6 +446,8 @@ static __u8 wiimote_cmd_read_ext(struct wiimote_data *wdata, __u8 *rmem) if (rmem[4] == 0x00 && rmem[5] == 0x00) return WIIMOTE_EXT_NUNCHUK; + if (rmem[4] == 0x01 && rmem[5] == 0x01) + return WIIMOTE_EXT_CLASSIC_CONTROLLER; if (rmem[4] == 0x04 && rmem[5] == 0x02) return WIIMOTE_EXT_BALANCE_BOARD; @@ -480,6 +482,9 @@ static bool wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype) /* map MP with correct pass-through mode */ switch (exttype) { + case WIIMOTE_EXT_CLASSIC_CONTROLLER: + wmem = 0x07; + break; case WIIMOTE_EXT_NUNCHUK: wmem = 0x05; break; @@ -1040,6 +1045,7 @@ static const char *wiimote_exttype_names[WIIMOTE_EXT_NUM] = { [WIIMOTE_EXT_NONE] = "None", [WIIMOTE_EXT_UNKNOWN] = "Unknown", [WIIMOTE_EXT_NUNCHUK] = "Nintendo Wii Nunchuk", + [WIIMOTE_EXT_CLASSIC_CONTROLLER] = "Nintendo Wii Classic Controller", [WIIMOTE_EXT_BALANCE_BOARD] = "Nintendo Wii Balance Board", }; |