Skip to content

Wii Remote Extension Hotplugging Support

David Herrmann alsa-devel linux-input 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26HID: wiimote: extend driver descriptiondrivers/hid/Kconfig drivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-debug.c +2 more+27 -112 replies
2/26HID: wiimote: move queue handling into separate structdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote.h+38 -300 replies
3/26HID: wiimote: keep HID device opendrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-ext.c+11 -490 replies
4/26HID: wiimote: add device detectiondrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote.h+188 -20 replies
5/26HID: wiimote: use cached battery values on I/O failuredrivers/hid/hid-wiimote-core.c+7 -70 replies
6/26HID: wiimote: wake up if output queue faileddrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote.h+38 -50 replies
7/26HID: wiimote: add sub-device module infrastructuredrivers/hid/Makefile drivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c +1 more+194 -40 replies
8/26HID: wiimote: convert KEYS and RUMBLE to modulesdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+172 -1140 replies
9/26HID: wiimote: convert BATTERY to moduledrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+104 -760 replies
10/26HID: wiimote: convert LEDS to modulesdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+158 -1120 replies
11/26HID: wiimote: convert ACCEL to moduledrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+140 -860 replies
12/26HID: wiimote: convert IR to moduledrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+287 -2120 replies
13/26HID: wiimote: add extension hotplug supportdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+709 -252 replies
14/26HID: wiimote: add Balance Board supportdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+246 -00 replies
15/26HID: wiimote: add Nunchuk supportdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+205 -00 replies
16/26HID: wiimote: add Classic Controller extensiondrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+286 -03 replies
17/26HID: wiimote: add Motion Plus extension moduledrivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+145 -00 replies
18/26HID: wiimote: fix ctx pointer in debugfs DRM-writedrivers/hid/hid-wiimote-debug.c+2 -10 replies
19/26HID: wiimote: lock DRM mode during debugfs overwritedrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-debug.c drivers/hid/hid-wiimote.h+7 -10 replies
20/26HID: wiimote: add sysfs extension/device-type attrsDocumentation/ABI/testing/sysfs-driver-hid-wiimote drivers/hid/hid-wiimote-core.c+128 -20 replies
21/26HID: wiimote: add "bboard_calib" attributeDocumentation/ABI/testing/sysfs-driver-hid-wiimote drivers/hid/hid-wiimote-modules.c+82 -10 replies
22/26HID: wiimote: remove old static extension supportdrivers/hid/Kconfig drivers/hid/Makefile drivers/hid/hid-wiimote-ext.c +1 more+0 -8680 replies
23/26HID: wiimote: add MP quirksdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+98 -50 replies
24/26HID: wiimote: support Nintendo Wii U Pro Controllerdrivers/hid/hid-wiimote-core.c drivers/hid/hid-wiimote-modules.c drivers/hid/hid-wiimote.h+320 -013 replies
25/26HID: wiimote: fix DRM debug-attr to correctly parse inputdrivers/hid/hid-wiimote-debug.c+2 -20 replies
26/26HID/ALSA: wiimote: add speaker supportdrivers/hid/Kconfig drivers/hid/Makefile drivers/hid/hid-wiimote-core.c +3 more+755 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/26] Wii Remote Extension Hotplugging Support

Hi

This is my second revision of the hid-wiimote rework. It features:
- Full extension hotplugging support: We can now initialize extensions during runtime and no longer require them to be plugged during connection setup.
- Sub-device modularization: Nintendo produced many different devices which are based on the Wii-Remote protocol. However, they often emulate the core protocol but don't feature the hardware. The modularization allows us to disable hardware that isn't present and instead provide a consistent API to user-space.
For instance, patch 24/26 adds "Wii U Pro Controller" support and avoids all the standard wii-remote input devices (rumble, IR, accelerometer, extensions, ...) and instead provides a single interface for the Pro-Controller features. That makes working with the device from user-space a lot easier.
- Speaker support: Patch 26/26 adds an alsa sound driver and allows user-space to use the built-in speaker like any standard sound card.
- Fixes: Several small fixes are included. They are very hard to backport so I didn't CC stable@vger. However, none of the fixes are crucial so I think we can ignore the stable kernels here. They fix things like reducing timeouts and debugfs bugs.

The Bluetooth HIDP rework is now upstream and already in David Miller's queue. It will be part of linux-3.10 so if someone wants to test this, I recommend using linux-next. However, this series doesn't depend on it. But if you want to avoid Bluetooth l2cap oopses during hotplugging, you should use linux-next..

I did several code review-rounds myself and tested this with 4 different Wii Remote revisions simultaneously. I didn't get any kernel oops, panic or deadlock and it works very well. I also tested different extension devices, 3rd party devices (including balance-board and Pro-Controller) and emulated devices. It also works with Wii-U devices.
I did some backwards-compatibility checks. Obviously, old user-space won't notice hot-plugged devices, but other than that the patches should be 100% backwards-compatible.

Note that the driver doesn't support extension devices between patch 13 and 16. But extension support is reworked heavily, so there is no reason to do a bisect on wiimote extensions, anyway. Other than that the series should be bisectable.

Patch 24/26 is marked as RFC because it adds Wii-U-Pro-Controller mappings. If someone could review them, I would be very glad. Because I want to avoid introducing horrible mappings as I did with the main Wii-Remote buttons..

Patch 26/26 is marked as RFC as it adds an Alsa driver which I'd like to get reviewed by ALSA developers. It works for me (and heavily tested), but it's my first alsa driver, so I am not entirely sure. (alsa-devel is CC'ed for this patch).

ABI changes are tagged as 3.11 so no need to push this into 3.10. Sorry for the 3 weeks delay, but I thought I'd do some more review myself before resending it.

Cheers
David

David Herrmann (26):
HID: wiimote: extend driver description
HID: wiimote: move queue handling into separate struct
HID: wiimote: keep HID device open
HID: wiimote: add device detection
HID: wiimote: use cached battery values on I/O failure
HID: wiimote: wake up if output queue failed
HID: wiimote: add sub-device module infrastructure
HID: wiimote: convert KEYS and RUMBLE to modules
HID: wiimote: convert BATTERY to module
HID: wiimote: convert LEDS to modules
HID: wiimote: convert ACCEL to module
HID: wiimote: convert IR to module
HID: wiimote: add extension hotplug support
HID: wiimote: add Balance Board support
HID: wiimote: add Nunchuk support
HID: wiimote: add Classic Controller extension
HID: wiimote: add Motion Plus extension module
HID: wiimote: fix ctx pointer in debugfs DRM-write
HID: wiimote: lock DRM mode during debugfs overwrite
HID: wiimote: add sysfs extension/device-type attrs
HID: wiimote: add "bboard_calib" attribute
HID: wiimote: remove old static extension support
HID: wiimote: add MP quirks
HID: wiimote: support Nintendo Wii U Pro Controller
HID: wiimote: fix DRM debug-attr to correctly parse input HID/ALSA: wiimote: add speaker support

 Documentation/ABI/testing/sysfs-driver-hid-wiimote |   39 +-
 drivers/hid/Kconfig                                |   31 +-
 drivers/hid/Makefile                               |    8 +-
 drivers/hid/hid-wiimote-core.c                     | 1714 ++++++++++------
 drivers/hid/hid-wiimote-debug.c                    |   14 +-
 drivers/hid/hid-wiimote-ext.c                      |  849 --------
 drivers/hid/hid-wiimote-modules.c                  | 2091 ++++++++++++++++++++
 drivers/hid/hid-wiimote-speaker.c                  |  662 +++++++
 drivers/hid/hid-wiimote.h                          |  234 ++-
 9 files changed, 4188 insertions(+), 1454 deletions(-)
 delete mode 100644 drivers/hid/hid-wiimote-ext.c
 create mode 100644 drivers/hid/hid-wiimote-modules.c
 create mode 100644 drivers/hid/hid-wiimote-speaker.c
Signature · 1 line
1.8.2.2