Package Details: hid-sony-ds3usb-dkms 5.6.13-1

Git Clone URL: (read-only, click to copy)
Package Base: hid-sony-ds3usb-dkms
Description: The hid_sony kernel module with a patch to fix buttons on Sony DualShock 3 USB adapters
Upstream URL:
Licenses: GPL2
Submitter: sshumate
Maintainer: sshumate
Last Packager: sshumate
Votes: 1
Popularity: 0.20
First Submitted: 2020-05-17 13:39 (UTC)
Last Updated: 2020-05-17 13:39 (UTC)

Latest Comments

noabody commented on 2022-04-13 17:05 (UTC) (edited on 2022-04-23 22:10 (UTC) by noabody)

Really great template for how to create dkms of kernel module for testing purposes or while awaiting a git merge of changes. Needs to be ammended as so:


It was originally designed to deploy code in the patch that has since been added to kernel sources. I suggest that file be replaced with this one which adds support for feature report 0x12, as a supplement to 0x81, to read data from generic DS4 gamepad compatible devices.

I was trying to get a WingmanXB adapter to be recognized as a Dualshock 4 with a customized PKGBUILD like this one (for linux515). It worked perfectly, once I changed the patch and added a special rule:

pkgdesc="The hid_sony kernel module with a patch for generic DS4 USB adapters"

    local workdir="${srcdir}/workdir"
    mkdir -p "${workdir}"
    cp "${srcdir}/hid-sony.c" "${workdir}"
    cp "${srcdir}/hid-ids.h" "${workdir}"
    perl -pi -e 's|(.*0x0c12.*)|\1\n#define USB_DEVICE_ID_ZEROPLUS_WINGMAN_XE\t0x0efa|gi' "${workdir}/hid-ids.h"
    perl -pi -e 's|(^\t\{ \})|\t/* Zeroplus Wingman XE dongles */\n\t{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, USB_DEVICE_ID_ZEROPLUS_WINGMAN_XE),\n\t\t.driver_data = DUALSHOCK4_CONTROLLER_USB },\n\1|gi' "${workdir}/hid-sony.c"
    patch -d "${workdir}" -Np3 -i "${srcdir}/hid-sony-ds3usb.patch"

package() {
    local dest="${pkgdir}/usr/src/${_pkgbase}-${pkgver}"
    install -d "${dest}"
    install -m 644 -T "${srcdir}/workdir/hid-sony.c" "${dest}/${_pkgbase}.c"
    install -m 644 -T "${srcdir}/workdir/hid-ids.h" "${dest}/hid-ids.h"
    install -m 644 -T "${srcdir}/Makefile" "${dest}/Makefile"
    install -m 644 -T "${srcdir}/hid-sony-ds3usb-dkms.dkms" "${dest}/dkms.conf"

    sed -e "s/@_PKGBASE@/${_pkgbase}/" \
        -e "s/@PKGVER@/${pkgver}/" \
        -i "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"

    # Blacklist the original hid_sony module
    install -dm755 "${pkgdir}/usr/lib/modprobe.d"
    install -Dm644 "${srcdir}/hid-sony-blacklist.modprobe" "${pkgdir}/usr/lib/modprobe.d/hid-sony-blacklist.conf"

hid-sony-ds3usb.patch: Copy and paste from there as the message retains tabs which is necessary. AurWeb converts tabs to spaces which will break the patch.

Rule to add Always Poll quirk:

echo -e 'options usbhid quirks=0x0c12:0x0efa:0x400' | sudo tee /etc/modprobe.d/wingxe.conf