linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@gmail.com>
To: linux-input@vger.kernel.org
Cc: Jiri Kosina <jkosina@suse.cz>, David Herrmann <dh.herrmann@gmail.com>
Subject: [RFC 00/21] Nintendo Wii Remote Extension Hotplugging
Date: Sat, 13 Apr 2013 12:47:41 +0200	[thread overview]
Message-ID: <1365850082-3585-1-git-send-email-dh.herrmann@gmail.com> (raw)

Hi

Last two month I sat down and started reverse-engineering the wiimote protocol
again. My goal was to finally get reliable extension hotplugging. What I then
ended up with was a huge Bluetooth-HID rewrite, a major hid-wiimote
modularization and finally working extension hotplug support.

The patches in Detail:
 - #1 to #6 are small fixes and initial device-detection logic. They are fairly
   simple and fix small issues I encountered.
 - #7 to #12 move all the sub-device drivers into modules. This allows us to
   extend device detection and load only the sub-devices that are actually
   present. For instance, the Balance Board does only provide one LED so we
   should not register led #2-#4. Note that the balance board still emulates the
   other LEDs in the protocol so we wouldn't notice that they are not present if
   we didn't know.
 - #13 to #17 implement extension hotplugging. Patch #13 extends the core to
   handle hotplugging and #14 to #17 implement the protocol parsers as modules
   so we can dynamically load different modules.
 - #18 to #21 add sysfs attributes and contain small fixes

I know that the driver became pretty huge, but it currently contains an
IR-camera driver, 4 accelerometer/gyro drivers, force-feedback driver, LED
driver, weight-sensor driver and like 5 different button/joystick drivers. So
considering that I think it's actually pretty small.

Another point is that I tried to be as conservative as possible. I tested this
code with several 3rd-party devices and all of them ended up breaking at some
point because they expect the exact Wii-Console behavior. I fixed everything I
found but I need more input from users here. At least I don't break any devices
that worked with the driver so far (as far as I know).

Also please don't merge it, yet. I still have to remove hid-wiimote-ext.c as it
is no longer needed, but I haven't tested how this affects
backwards-compatibility. I did my best to not break existing user-space, but I
want to do some more tests. So if there are no comments on this series, I will
resend in about 1 week with a ready-to-merge series. But I wanted to see whether
anyone has issues with the patches, first.


Some sidenotes:
 - Marcel already ACK'ed my Bluetooth HIDP rewrite which finally gives us
   working Bluetooth HID without any kernel oops. Gustavo is currently applying
   the patches. This series doesn't exactly depend on it, but you cannot test
   Bluetooth device hotplugging without it, because the kernel just breaks.
 - I currently work on the "Wii U Pro Controller". It's similar to the Classic
   Controller and I hope I can include patches for it in the next revision.
 - I also work on reverse-engineering the Wii U GamePad. It uses 5Ghz 802.11n
   instead of Bluetooth, but the Miracast (Wifi Display) protocol allows a
   separate HID stream side-by-side with the MPEG-4 video stream. So there might
   be a new hid_ll_driver in the future. However, I guess UHID will serve well
   for the beginning.

Last but not least I noticed that we duplicate the HID Boot Protocol in usbhid
and Bluetooth HID. The Wifi-Display HID also provides some similar protocol. So
I currently look into creating a hid-boot.c so we have a central place that
implements it.


Cheers
David

David Herrmann (21):
  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

 drivers/hid/Kconfig               |   20 +-
 drivers/hid/Makefile              |    2 +-
 drivers/hid/hid-wiimote-core.c    | 1571 +++++++++++++++++++++------------
 drivers/hid/hid-wiimote-debug.c   |   10 +-
 drivers/hid/hid-wiimote-ext.c     |   16 +-
 drivers/hid/hid-wiimote-modules.c | 1717 +++++++++++++++++++++++++++++++++++++
 drivers/hid/hid-wiimote.h         |  168 +++-
 7 files changed, 2925 insertions(+), 579 deletions(-)
 create mode 100644 drivers/hid/hid-wiimote-modules.c

-- 
1.8.2.1


             reply	other threads:[~2013-04-13 10:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-13 10:47 David Herrmann [this message]
2013-04-13 10:47 ` [PATCH 01/21] HID: wiimote: extend driver description David Herrmann
2013-04-13 10:47 ` [PATCH 02/21] HID: wiimote: move queue handling into separate struct David Herrmann
2013-04-13 10:47 ` [PATCH 03/21] HID: wiimote: keep HID device open David Herrmann
2013-04-13 10:47 ` [PATCH 04/21] HID: wiimote: add device detection David Herrmann
2013-04-13 10:47 ` [PATCH 05/21] HID: wiimote: use cached battery values on I/O failure David Herrmann
2013-04-13 10:47 ` [PATCH 06/21] HID: wiimote: wake up if output queue failed David Herrmann
2013-04-13 10:47 ` [PATCH 07/21] HID: wiimote: add sub-device module infrastructure David Herrmann
2013-04-13 10:47 ` [PATCH 08/21] HID: wiimote: convert KEYS and RUMBLE to modules David Herrmann
2013-04-13 10:47 ` [PATCH 09/21] HID: wiimote: convert BATTERY to module David Herrmann
2013-04-13 10:47 ` [PATCH 10/21] HID: wiimote: convert LEDS to modules David Herrmann
2013-04-13 10:47 ` [PATCH 11/21] HID: wiimote: convert ACCEL to module David Herrmann
2013-04-13 10:47 ` [PATCH 12/21] HID: wiimote: convert IR " David Herrmann
2013-04-13 10:47 ` [PATCH 13/21] HID: wiimote: add extension hotplug support David Herrmann
2013-04-13 10:47 ` [PATCH 14/21] HID: wiimote: add Balance Board support David Herrmann
2013-04-13 10:47 ` [PATCH 15/21] HID: wiimote: add Nunchuk support David Herrmann
2013-04-13 10:47 ` [PATCH 16/21] HID: wiimote: add Classic Controller extension David Herrmann
2013-04-13 10:47 ` [PATCH 17/21] HID: wiimote: add Motion Plus extension module David Herrmann
2013-04-13 10:47 ` [PATCH 18/21] HID: wiimote: fix ctx pointer in debugfs DRM-write David Herrmann
2013-04-13 10:48 ` [PATCH 19/21] HID: wiimote: lock DRM mode during debugfs overwrite David Herrmann
2013-04-13 10:48 ` [PATCH 20/21] HID: wiimote: add sysfs extension/device-type attrs David Herrmann
2013-04-13 10:48 ` [PATCH 21/21] HID: wiimote: add "bboard_calib" attribute David Herrmann
2013-04-19 19:38 ` [RFC 00/21] Nintendo Wii Remote Extension Hotplugging Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365850082-3585-1-git-send-email-dh.herrmann@gmail.com \
    --to=dh.herrmann@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).