]> Pileus Git - ~andy/linux/commit
HID: wiimote: add device detection
authorDavid Herrmann <dh.herrmann@gmail.com>
Sun, 5 May 2013 21:12:48 +0000 (23:12 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 3 Jun 2013 09:06:59 +0000 (11:06 +0200)
commitc57ff761be8365599ff9ccdbb205ead4912b2067
treeb9b8700089c89e50e097e43e3bac202cd3162310
parent5682b1a8690cfae5ad3bd40a123510fd4014066d
HID: wiimote: add device detection

Nintendo produced many different devices that are internally based on the
Wii Remote protocol but provide different peripherals. To support these
devices, we need to schedule a device detection during initialization.

Device detection includes requesting a status report, reading extension
information and then evaluating which device we may be dealing with.

We currently detect gen1 and gen2 Wii Remote devices. All other devices
are marked as generic devices. More detections will be added later.

In followup patches we will be using these device IDs to control which
peripherals to initialize. For instance if a device is known to have no IR
camera, there is no need to provide the IR input device nor trying to
access IR registers. In fact, there are 3rd party devices that break if we
try things like this (hurray!).

The init_worker will be scheduled whenever we get hotplug events. This
isn't implemented, yet and will be added later. However, we need to make
sure that this worker can be called multiple times.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-wiimote-core.c
drivers/hid/hid-wiimote.h