Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GameSir T4 Kaleid & GameSir-G7 SE #295

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3565e20
xpad: print received packets if DEBUG_VERBOSE
dantob May 9, 2016
e0f001b
add code to enable debug outputs
paroj Jul 5, 2015
75e79d8
add README.md
paroj Jun 24, 2015
876f439
add stress_urb_out.sh
paroj Sep 27, 2015
78d2f92
add PR template
paroj Dec 8, 2019
6fd35f2
add CI build
paroj Sep 5, 2022
61b4e97
Input: xpad - initialize 360 controllers
Oblomov Aug 14, 2021
1b1391a
Input: xpad - refactor using BIT() macro
paroj Sep 8, 2022
2c087f9
Input: xpad - decipher xpadone packages with GIP defines
paroj Sep 9, 2022
5d67940
input: xpad - Switch to workqueue for xpad360w button poweroff
DD3Boh Oct 22, 2022
0270e37
Input: xpad - add support for GHL Xbox One controller
dynamix1337 Oct 22, 2022
dbe7e09
xbox 360: fix null pointer dereference when manufacturer is null
eldad Oct 20, 2022
1821d28
Input: xpad - add support for 8BitDo Ultimate Wireless controller dongle
jcotton42 Nov 14, 2022
4a64f5c
Improve name of 8BitDo controller 2dc8:3106
lbschenkel Jan 4, 2023
1bdf092
Added Turtle Beach Recon support (from the diff from https://www.spin…
treus Nov 26, 2022
904be14
Support KEY_RECORD for 8BitDo Pro 2...for Xbox
lbschenkel Jan 9, 2023
51af064
Input: xpad - add support for 8BitDo Ultimate bluetooth/hall effect v…
jdarn Apr 12, 2023
889871e
Input: xpad - add support for wooting two he (arm)
ProjectSynchro Jun 28, 2023
eddb513
Input: xpad - add support for SCUF Instinct
WaferMouse Jul 2, 2023
3a21582
feat: add Black Shark Green Ghost controller support
Nov 22, 2023
ae0917a
Support GameSir T4 Kaleid & GameSir-G7 SE
DisDis Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
If you are adding support for a new generic xpad controller it is sufficient
to update the xpad_table[] array.
The type will be auto-detected in xpad_probe().
Updating the xpad_device[] array is only needed if the controller requires
additional flags like DANCEPAD_MAP_CONFIG to work.

If you are updating any of the above tables, make sure you keep the sorted!

To get attribution for your work when this goes upstream, make sure to use
a real name and a real email address as per:
https://www.kernel.org/doc/html/v4.10/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
-->
19 changes: 19 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux:
runs-on: ubuntu-22.04
steps:
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y dkms
- uses: actions/checkout@v2
- name: Build
run: |
sudo ln -s `pwd` /usr/src/xpad-0.4
sudo dkms install -m xpad -v 0.4
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Updated Xpad Linux Kernel Driver
Driver for the Xbox/ Xbox 360/ Xbox 360 Wireless/ Xbox One Controllers

This driver includes the latest changes in the upstream linux kernel and additionally carries the following staging changes:

* support for more compatible devices
* support for xbox360 class controllers, that need initialisation
* support for xbox one elite paddles
* xpad360w: power-off by long-pressing the power button

## Xbox One Controllers
This driver is only used if you connect the controller via USB.

**Connecting via Bluetooth**
If you get past the pairing issues, the controller will operate in the [generic-HID bluetooth profile](https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles#Human_Interface_Device_Profile_(HID)).
The xpad driver will not be used.

**Connecting via XBox One Wireless Adapter (WiFi)**
The adapter needs daemon in userspace, see: [medusalix/xow](https://github.com/medusalix/xow)
Opinion: rather get a controller that supports bluetooth.


# Installing
```
sudo git clone https://github.com/paroj/xpad.git /usr/src/xpad-0.4
sudo dkms install -m xpad -v 0.4
```
# Updating
```
cd /usr/src/xpad-0.4
sudo git fetch
sudo git checkout origin/master
sudo dkms remove -m xpad -v 0.4 --all
sudo dkms install -m xpad -v 0.4
```
# Removing
```
sudo dkms remove -m xpad -v 0.4 --all
sudo rm -rf /usr/src/xpad-0.4
```
# Usage
This driver creates three devices for each attached gamepad

1. /dev/input/js**N**
* example `jstest /dev/input/js0`
2. /sys/class/leds/xpad**N**/brightness
* example `echo COMMAND > /sys/class/leds/xpad0/brightness` where COMMAND is one of
* 0: off
* 1: all blink, then previous setting
* 2: 1/top-left blink, then on
* 3: 2/top-right blink, then on
* 4: 3/bottom-left blink, then on
* 5: 4/bottom-right blink, then on
* 6: 1/top-left on
* 7: 2/top-right on
* 8: 3/bottom-left on
* 9: 4/bottom-right on
* 10: rotate
* 11: blink, based on previous setting
* 12: slow blink, based on previous setting
* 13: rotate with two lights
* 14: persistent slow all blink
* 15: blink once, then previous setting
3. the generic event device
* example `fftest /dev/input/by-id/usb-*360*event*`

# Debugging
As a regular unpriveledged user

Setup console to display kernel log.
`dmesg --level=debug --follow`

Open a new console and access the device with jstest.
`jstest /dev/input/jsX`

Interact with the device and observe that data packets recieved from device are printed to kernel log.
```
[ 3968.772128] xpad-dbg: 00000000: 20 00 b5 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 40 fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.772135] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.804137] xpad-dbg: 00000000: 20 00 b6 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 fc fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.804145] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3969.152120] xpad-dbg: 00000000: 20 00 b7 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 b8 fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3969.152129] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
```

Save dmesg buffer and attach to bug report, don't forget to describe button sequences in bug report.
`dmesg --level=debug > dmesg.txt`

Ctrl+C to close interactive console sessions when finished.

# Sending Upstream

1. `git format-patch --cover-letter upstream..master`
2. `git send-email --to xxx *.patch`
10 changes: 10 additions & 0 deletions stress_urb_out.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# stress test irq_urb_out. provokes URB request dropping.
# script by Laura Abbott
# see: http://www.spinics.net/lists/linux-input/msg40477.html

while true; do
for i in $(seq 0 5); do
echo $i > /sys/class/leds/xpad0/subsystem/xpad0/brightness
done
done
Loading