Bug 115841 - Add HID_QUIRK_MULTI_INPUT for Dragonrise GameCube adapter
Summary: Add HID_QUIRK_MULTI_INPUT for Dragonrise GameCube adapter
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-03 20:01 UTC by Robert de Rooy
Modified: 2021-04-18 16:00 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.6rc2
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Dragonrise GameCube adapter patch (1.52 KB, patch)
2016-04-03 20:01 UTC, Robert de Rooy
Details | Diff
Dolphin Bar - Mode 3 quirk (1.33 KB, patch)
2016-12-20 08:41 UTC, Robert de Rooy
Details | Diff
Mayflash 4port Gamecube and Dolphinbar support (3.20 KB, patch)
2016-12-22 11:01 UTC, Robert de Rooy
Details | Diff
Proposed change to hid-mf.c (1.05 KB, patch)
2016-12-22 11:25 UTC, mahasler
Details | Diff

Description Robert de Rooy 2016-04-03 20:01:04 UTC
Created attachment 211581 [details]
Dragonrise GameCube adapter patch

This issue was first reported on the linux-input ML by Andrew Roland[1] in February 2015, and it was quickly found by Dmitry Torokhov that the device needs HID_QUIRK_MULTI_INPUT set and a patch was posted[2].
Unfortunately the patch was never applied, and so the adapter still does not work with the latest kernels.

I have recreated the patch for the current 4.6rc2 kernel and attached it. With this patch, I get four js input devices, one for each joystick port.

[1] http://www.spinics.net/lists/linux-input/msg36431.html
[2] http://www.spinics.net/lists/linux-input/msg36434.html
Comment 1 Robert de Rooy 2016-04-03 20:41:42 UTC
Just as an additional comment, in case somebody with a "Mayflash GameCube Controller Adapter for Wii U and PC USB" finds this bugreport before it has been fixed upstream, you can fix the issue locally by adding the following to your Linux kernel boot commandline;

usbhid.quirks=0x79:0x1843:0x40

Without this quirk, no joystick device will be created, and some of the inputs will function like a mouse.
Comment 2 mahasler 2016-10-15 22:44:48 UTC
I didn't want to create a new bug report, but the same thing also applies to the "Mayflash PS3 Game Controller Adapter". I had to add 'usbhid.quirks=0x0079:0x1801:0x40' in order to get four joystick devices instead of a mouse.
Comment 3 Robert de Rooy 2016-12-13 08:55:13 UTC
I have yet another mayflash device that also needs the quirk.

The Mayflash Dolphin-bar has 4 modes. In mode 1 and 2 it emulates a keyboard and mouse, and this works fine (0079:1802 DragonRise Inc.).

In mode 3 it emulates a PC joystick, and since it supports 4 devices it needs the same quirk. The USB ID in this mode is 0079:1803 DragonRise Inc.

I verified mode 3 with booting with:
usbhid.quirks=0x79:0x1803:0x40
In that case four js devices are created and they work.

Mode 4 is something special, and is supposed to be handled directly by the Dolphin emulator. In that case I get USB 057e:0306 Nintendo Co., Ltd Wii Remote Controller RVL-003 and dmesg shows me four input,hidraw devices. I have not been able to check out this mode further for the moment as I first need to get Dolphin working again.

Still it would be good to get the quirk for mode 3 added.
Comment 4 mahasler 2016-12-19 10:38:27 UTC
The quirks for the Wii U and PS3 adapters have already been added. I also submitted a force feedback driver for these adapters which should be included in Linux 4.10. But since I only have the PS3 adapter myself, this is the only one currently supported by the driver. I would expect the others to work as well, if someone could test this with other devices I would appreciate it. See https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f8690450f3d0d415f42c94f7e69258d8ba54ff29 for the patch. You'd have to add your own devices to the tables to make them work.
Comment 5 Robert de Rooy 2016-12-19 23:10:47 UTC
I grabbed and built the latest from git, and build it with your force feedback driver enabled (and patched to support the gamecube adapter), but unfortunately the kernel freezes when GDM is started.

So, my options are to see if I can boot to a commandprompt, try to debug the GDM problem, which is probably some Intel KMS video issue, wait until rc1 is released to see if that helps, or backport your patch to 4.8 which boots without problems.

I will see if I have some time tomorrow to try a few things to get it running one way or another.
Comment 6 Robert de Rooy 2016-12-20 08:41:20 UTC
Created attachment 248091 [details]
Dolphin Bar - Mode 3 quirk

Here is the patch for the Dolphin Bar mode 3. With this patch I get 4 js devices. The patch is on top of upstream git from yesterday.
Comment 7 Robert de Rooy 2016-12-22 11:01:11 UTC
Created attachment 248311 [details]
Mayflash 4port Gamecube and Dolphinbar support

This patch adds HID_QUIRK_MULTI_INPUT and force-feedback support for the following:
- Mayflash 4-port Gamecube adapter in PC mode with device ID 1843
- Mayflash Dolphin-bar in mode 3 (USB joystick emulation mode)

It also adds force-feedback for:
- Mayflash 4-port Gamecube adapter in PC mode with device ID 1844

The 4-port Gamecube adapter originally had device ID 1843, but a firmware update released earlier this year changed the device ID to 1844. After the (windows) firmware update the quirk is no longer needed to enumerate the individual devices.
Comment 8 mahasler 2016-12-22 11:25:07 UTC
Created attachment 248321 [details]
Proposed change to hid-mf.c

Thanks. Just to be sure, and for sake of correctness, I would suggest only to set the quirk for devices that actually need it. Do you want to submit the patch yourself or should I take care of it?
Comment 9 Robert de Rooy 2016-12-22 11:29:18 UTC
Looks good. I'm about to go away on vacation, so sure, go ahead and submit it.

Thanks!
Comment 10 mahasler 2016-12-22 11:43:48 UTC
Okay, I'll put together a patchset as soon as find the time. Thanks again for testing!

Note You need to log in before you can comment on or make changes to this bug.