HID: wiimote: work around broken DRM_KAI on GEN10
authorDavid Herrmann <dh.herrmann@gmail.com>
Sun, 4 Aug 2013 16:50:10 +0000 (18:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Sep 2013 00:21:45 +0000 (17:21 -0700)
commit1e21323805fe0c851c3182d68bf2130e30fe92ed
treed20bd768318ada93aaba2eeac55b88c9a1ecd159
parent41570c0dd9cd83f10bf6bb7d4c25614ed5f0a93e
HID: wiimote: work around broken DRM_KAI on GEN10

commit a6be8569b6705cbc26e7ae1a8be476067cc5a78b upstream.

GEN10 and earlier devices seem to not support DRM_KAI if we run in basic
IR mode. Use DRM_KAIE instead. This might increases overhead slightly as
the extension port is read and streamed but we stream accelerometer data
constantly, too, so this is negligible.

Note that our parsers are hardcoded on IR-formats, so we cannot actually
use 96-bit IR DRMs for basic IR data. We would have to adjust the parsers.
But as only GEN20 and newer support this, we simply avoid mixed DRMs.

This fixes a bug where GEN10 devices didn't provide IR data if
accelerometer and IR are enabled simultaneously. As a workaround, you can
enable DRM_KAIE without this patch via (disables device power-management):
  echo "37" >/sys/kernel/debug/hid/<dev>/drm

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reported-by: Nicolas Adenis-Lamarre <nicolas.adenis.lamarre@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-wiimote-core.c