Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Amlogic-ng: add Xbox One controller bluetooth driver
- Loading branch information
Showing
5 changed files
with
1,563 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
projects/Amlogic-ng/filesystem/usr/lib/udev/rules.d/99-xpadneo.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# XPADNEO UDEV BINDING | ||
# by atar-axis (dollinger.florian@gmx.de) | ||
|
||
# in general those files with a higher leading number are processed | ||
# and executed _later_, that means assignment in those files can overwrite | ||
# assignments in other rules which are parsed earlier | ||
|
||
# every block is a rule. rules are collected from the .rules files | ||
# according to their name. on every kernel uevent, all rules are | ||
# compared to that event - one by one. | ||
|
||
# kernel versions manual binding (bind/unbind) bind uevent hid_generic greedy hid_microsoft support gamepad method | ||
# --------------- ---------------------------- -------------- ------------------ --------------------- ------- ------ | ||
# [ ... - 2.6.13 [ no no yes no * rmmod (not supported in xpadneo) | ||
# [ 2.6.13 - 4.14 [ yes no yes no * 1: add, hid_generic | ||
# [ 4.14 - 4.16 [ yes yes yes no * 2: bind, hid_generc | ||
# [ 4.16 - 4.20 [ yes yes no no * automatic | ||
# [ 4.20 - ... ] yes yes no yes 02FD 3: bind, microsoft | ||
# 02E0 automatic | ||
|
||
ACTION=="add", \ | ||
KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*", \ | ||
SUBSYSTEM=="hid", \ | ||
RUN:="/bin/sh -c 'echo xpadneo udev: $kernel > /dev/kmsg; modprobe hid_xpadneo; echo $kernel > /sys/bus/hid/drivers/hid-generic/unbind; echo $kernel > /sys/bus/hid/drivers/microsoft/unbind; echo $kernel > /sys/bus/hid/drivers/xpadneo/bind; echo xpadneo udev: ok > /dev/kmsg'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
projects/Amlogic-ng/patches/linux/linux-02-fix_bluetooth_reconnect.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From 0996abc14470622eece29b66913b082a2eebe5f2 Mon Sep 17 00:00:00 2001 | ||
From: Florian Dollinger <dollinger.florian@gmx.de> | ||
Date: Sun, 7 Jan 2018 23:55:52 +0100 | ||
Subject: [PATCH] The current L2CAP implementation does not change any options if the | ||
other side respons with "unknown options", but does if "unaccepted options" is the answer. | ||
It is up to the implementation to decide on the effort spent on config negotiations, | ||
therefore the current implementation is correct at this point - but many devices | ||
(like Xbox One S controllers) are not useable this way. | ||
A workaround for many users therefore is to disable_ertm, since this is often the option | ||
which is unknown. I would prefer to try it again with altered options instead of globally | ||
disable ERTM. | ||
|
||
In result, I suggest the following patch. It simply adds a new case (L2CAP_CONF_UNKNOWN), | ||
which does nothing but falling through to L2CAP_CONF_UNACCEPT. | ||
|
||
Signed-off-by: Florian Dollinger <dollinger.florian@gmx.de> | ||
--- | ||
net/bluetooth/l2cap_core.c | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c | ||
index 43ba91c44..388d53bfd 100644 | ||
--- a/net/bluetooth/l2cap_core.c | ||
+++ b/net/bluetooth/l2cap_core.c | ||
@@ -4208,6 +4208,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, | ||
} | ||
goto done; | ||
|
||
+ case L2CAP_CONF_UNKNOWN: | ||
case L2CAP_CONF_UNACCEPT: | ||
if (chan->num_conf_rsp <= L2CAP_CONF_MAX_CONF_RSP) { | ||
char req[64]; | ||
-- | ||
2.15.1 |
39 changes: 39 additions & 0 deletions
39
projects/Amlogic-ng/patches/linux/linux-03-stop-hid-generic-from-grabing-xbone.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 090b784913a5ff0a823510553f97c0d7b1115f57 Mon Sep 17 00:00:00 2001 | ||
From: cdu13a <cdu13a@gmail.com> | ||
Date: Sat, 23 Nov 2019 14:08:13 -0500 | ||
Subject: hid: stop hid-generic from being greedy with the xbox one controller | ||
|
||
--- | ||
drivers/hid/hid-core.c | 2 ++ | ||
drivers/hid/hid-ids.h | 2 ++ | ||
2 files changed, 4 insertions(+) | ||
|
||
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c | ||
index f5e17e8ce9ba..188c25a30870 100644 | ||
--- a/drivers/hid/hid-core.c | ||
+++ b/drivers/hid/hid-core.c | ||
@@ -2004,6 +2004,8 @@ static const struct hid_device_id hid_have_special_driver[] = { | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_600) }, | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1) }, | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER) }, | ||
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S) }, | ||
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S_2016) }, | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) }, | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) }, | ||
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h | ||
index 8b5d1166416a..4d753184436a 100644 | ||
--- a/drivers/hid/hid-ids.h | ||
+++ b/drivers/hid/hid-ids.h | ||
@@ -745,6 +745,8 @@ | ||
#define USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP 0x07dd | ||
#define USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP 0x07e9 | ||
#define USB_DEVICE_ID_MS_POWER_COVER 0x07da | ||
+#define USB_DEVICE_ID_MS_XBOX_ONE_S 0x02fd | ||
+#define USB_DEVICE_ID_MS_XBOX_ONE_S_2016 0x02e0 | ||
|
||
#define USB_VENDOR_ID_MOJO 0x8282 | ||
#define USB_DEVICE_ID_RETRO_ADAPTER 0x3201 | ||
-- | ||
2.17.1 | ||
|
Oops, something went wrong.