hexdump0815 / linux-mainline-mediatek-mt81xx-kernel

linux-mainline-mediatek-mt81xx-kernel
14 stars 7 forks source link

Kernel support for Sony PS3 & PS4 joystick/controllers #10

Open avoiceofreason opened 8 months ago

avoiceofreason commented 8 months ago

Would you please add in kernel support for Sony PS3 & PS4 joystick/controllers (Maybe some other popular ones too) in the next mt8 kernel/image?

This seems a useful reference: https://wiki.gentoo.org/wiki/Sony_DualShock

This is for running retropie which seems to run ok on my kukui cb, but lacks the support for the controllers.

I'm currently building a custom kernel on 6.1.51 with the options enabled as per the gentoo wiki, although I'm not a kernel build expert and its currently compiling. Will report back on any success.

Would be nice to have it in there for everyone if it works on arm64.

hexdump0815 commented 8 months ago

i'll note it down for the future - please have a look at the doc subdir of the repo, there is some info on building and installing your own kernel ...

avoiceofreason commented 8 months ago

Success. I used your docs to build a custom kernel for 6.1.51. Copied the config from /boot and just did a make menuconfig rather than using your config repo files and added in kernel support as per the gentoo link above.

Surprised myself in getting it to work first time, and both PS3 and PS4 controller work as expected now when connected via USB.

Bluetooth connection half worked to begin with. Would connect then immediately disconnect. Then noticed the input.conf tip in the gentoo doc and that fixed the issue. Only funny now is all 4 PS3 controller LEDS blink when connected to BT, although controller works ok.

####### This fixes BT connection /etc/bluetooth/input.conf

Enable HID protocol handling in userspace input profile

Defaults to false (HIDP handled in HIDP kernel module)

UserspaceHID=true ##########

Hints: The documentation you've done is pretty good, but for others like me who are a bit dim:

Follow the steps in this doc to checkout the kernel source: https://github.com/hexdump0815/imagebuilder/blob/main/doc/building-own-kernels.md use git checkout v6.1.51 (or matched to the kernel you have)

Use the correct build doc for your chromebook, e.g. for me: https://github.com/hexdump0815/linux-mainline-mediatek-mt81xx-kernel/blob/lts/readme.mt8 Follow the directory structure set out in the doc and put the right repos in the right place Cut and paste commands section by section and run each piece separately so you can see any errors etc

I ignored the scripts/kconfig/merge_config.sh / make olddefconfig lines and instead:

sudo cp /boot/config.mt8-6.1.51-stb-mt8+ .config make menuconfig (add kernel options) (save file)

Note that depending on user context some of the build commands need sudo e.g. copying files to /boot or update-initramfs

Finally don't forget to dd the kernel to the kernel partition as per this doc:

https://github.com/hexdump0815/imagebuilder/blob/main/doc/installing-a-newer-kernel.md