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

Git Clone URL: https://aur.archlinux.org/hid-sony-ds3usb-dkms.git (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: https://www.spinics.net/lists/linux-input/msg67472.html
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:

source=("hid-sony.c::https://github.com/archlinux/linux/raw/${_srctag}/drivers/hid/hid-sony.c"
        "hid-ids.h::https://github.com/archlinux/linux/raw/${_srctag}/drivers/hid/hid-ids.h"

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:

_pkgbase='hid-sony-ds3usb'
pkgname=${_pkgbase}-dkms
pkgver=5.15.13
pkgrel=1
pkgdesc="The hid_sony kernel module with a patch for generic DS4 USB adapters"
_srctag=v${pkgver}-arch1
url='https://lkml.org/lkml/2021/1/13/853'
license=('GPL2')
arch=('x86_64')
depends=('dkms')
source=("hid-sony.c::https://github.com/archlinux/linux/raw/${_srctag}/drivers/hid/hid-sony.c"
        "hid-ids.h::https://github.com/archlinux/linux/raw/${_srctag}/drivers/hid/hid-ids.h"
        "Makefile"
        "hid-sony-ds3usb.patch"
        "hid-sony-ds3usb-dkms.dkms"
        "hid-sony-blacklist.modprobe")
sha256sums=('d06b36d69f723777a4cba2fcae34523002e39a9549e2e67136e520627f1a173f'
            '34b9050b96abc68acabd3bde6ab34385dd0cdb90ae2b0d94592a38981b3bfa67'
            '96cab0ae36a9d7a8ab01aa7d5a20890981f7f5836328b1d35eaf54ec6bb6b208'
            '272b63bcdf20b032ec5f0f43fd1973c95ef74358374e16d4af76c4e4b214f2f9'
            '04a25acef8059630188ebbf398115c87bf27f97a8e37ce9a10d1d30387800610'
            'f4ab0b6941e353e861007a0bb6c468b4a7d027c56d530056fa686ad837616635')

prepare(){
    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