Skip to content

Commit a6be856

Browse files
David HerrmannJiri Kosina
authored andcommitted
HID: wiimote: work around broken DRM_KAI on GEN10
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 Cc: [email protected] Signed-off-by: David Herrmann <[email protected]> Reported-by: Nicolas Adenis-Lamarre <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 9854a6f commit a6be856

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/hid/hid-wiimote-core.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,12 @@ static __u8 select_drm(struct wiimote_data *wdata)
212212

213213
if (ir == WIIPROTO_FLAG_IR_BASIC) {
214214
if (wdata->state.flags & WIIPROTO_FLAG_ACCEL) {
215-
if (ext)
216-
return WIIPROTO_REQ_DRM_KAIE;
217-
else
218-
return WIIPROTO_REQ_DRM_KAI;
215+
/* GEN10 and ealier devices bind IR formats to DRMs.
216+
* Hence, we cannot use DRM_KAI here as it might be
217+
* bound to IR_EXT. Use DRM_KAIE unconditionally so we
218+
* work with all devices and our parsers can use the
219+
* fixed formats, too. */
220+
return WIIPROTO_REQ_DRM_KAIE;
219221
} else {
220222
return WIIPROTO_REQ_DRM_KIE;
221223
}

0 commit comments

Comments
 (0)