Created attachment 191941 [details] hid-sony.c patch This bug is present in all kernels starting at 3.15.0 I have a brand new Sony DualShock 4 that seems to use a slightly different protocol than the hid-sony driver expects. I'm not sure why this controller is different. Maybe updated firmware from Sony or maybe because it has never been connected to a PS4. Whatever the case, the device descriptor size is different from what hid-sony expects and because of that it does not remap the descriptor table as required. This causes only the trackpad to function and none of the other controls work. So basically the controller does not work at all. The current hid-sony driver expects a descriptor size of 467 when using USB or 357 when using Bluetooth. The controller I have uses 499 and 365 respectively. I have created a patch that fixes it for me. I have only tested the patch against kernels 4.1, 4.2, and 4.3 but it's simple enough that it should be trivially portable to any 3.15+ kernel. The attached patch is based against the current git 4.3 kernel. I wonder if the descriptor size check is even necessary. My patch adds the size of my controller's descriptor to keep with the original code style. However, don't all DualShock 4 controllers require remapping the descriptor table, regardless of descriptor size matching?
Chris, Thank you for the patch. Please format it as outlined in Documentation/SubmittingPatches (and make sure you add your signed-off-by) and send as plaintext mail to linux-input@vger.kernel.org (cc jkosina@suse.cz) and we'll be happy to apply it. Your questions are better asked on the mailing list as well. Thanks!
This issue with newer DualShock 4 controllers when connected via bluetooth has already been fixed since Linux 4.5.
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=b71b5578a84d297954e4812ba0ca2d466e61cf42