Skip to contentSkip to conversation

HID: Enable playstation driver independently of sony driver

PATCH Superseded Alex Henrie 3 participants 9 messages Feb 5, 2025 – Feb 8, 2025 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: Enable playstation driver independently of sony driver

PlayStation 4 controllers use the hid-playstation driver now, but they are still not included in the hid_have_special_driver table unless the hid-sony driver is enabled. Split up that section of the table so that hid-playstation works even in the absence of hid-sony.

Fixes 4f1f391869ee ("HID: sony: remove DualShock4 support.")
---
 drivers/hid/hid-quirks.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/hid/hid-quirks.c +7 -5
index e0bbf0c6345d..ff23a7ac7001 100644
@@ -595,6 +595,13 @@ static const struct hid_device_id hid_have_special_driver[] = {
 #if IS_ENABLED(CONFIG_HID_PLANTRONICS)
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
 #endif
+#if IS_ENABLED(CONFIG_HID_PLAYSTATION)
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
+#endif
 #if IS_ENABLED(CONFIG_HID_PRIMAX)
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
 #endif
@@ -664,11 +671,6 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
-	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
-	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER) },
Signature · 1 line
2.46.0
#1 lore raw

Hi Alex,

The change in general looks good to me. It had been an oversight. While add it, I guess also include the PS5 controllers in that list as well.

Thanks,
Roderick Colenbrander

Quoted 46 lines · Alex Henrie

PlayStation 4 controllers use the hid-playstation driver now, but they are still not included in the hid_have_special_driver table unless the hid-sony driver is enabled. Split up that section of the table so that hid-playstation works even in the absence of hid-sony.

Fixes 4f1f391869ee ("HID: sony: remove DualShock4 support.")
---
 drivers/hid/hid-quirks.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/hid/hid-quirks.c +7 -6
index e0bbf0c6345d..ff23a7ac7001 100644
@@ -595,6 +595,13 @@ static const struct hid_device_id hid_have_special_driver[] = {
 #if IS_ENABLED(CONFIG_HID_PLANTRONICS)
        { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
 #endif
+#if IS_ENABLED(CONFIG_HID_PLAYSTATION)
+       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
+       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
+       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
+#endif
 #if IS_ENABLED(CONFIG_HID_PRIMAX)
        { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
 #endif
@@ -664,11 +671,6 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
-       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
-       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER) },
--

2.46.0

maintainer Acked-by Roderick Colenbrander
#2 lore raw
Quoted 5 lines · Roderick Colenbrander

Hi Alex,

The change in general looks good to me. It had been an oversight. While add it, I guess also include the PS5 controllers in that list as well.

Can I take this as your

? I can do the PS5 change myself on top.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
maintainer
#3 lore raw
Quoted 8 lines · Jiri Kosina
Quoted 5 lines · Roderick Colenbrander

Hi Alex,

The change in general looks good to me. It had been an oversight. While add it, I guess also include the PS5 controllers in that list as well.

Quoted 5 lines

Can I take this as your

? I can do the PS5 change myself on top.

Nevermind, I see now that Alex sent that one as a followup already. Can I stick your Ack above to both of them, then?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw
Quoted 17 lines · Jiri Kosina
Quoted 8 lines · Jiri Kosina
Quoted 5 lines · Roderick Colenbrander

Hi Alex,

The change in general looks good to me. It had been an oversight. While add it, I guess also include the PS5 controllers in that list as well.

Quoted 5 lines

Can I take this as your

? I can do the PS5 change myself on top.

Quoted 9 lines

Nevermind, I see now that Alex sent that one as a followup already. Can I stick your Ack above to both of them, then?

Thanks,

--
Jiri Kosina
SUSE Labs

Hi Jiri,
Please consider it an Ack for both patches:

Thanks,
Roderick Colenbrander

#5 lore raw

v2 cover HID: hid_have_special_driver fixes for playstation driver

In reply to Alex Henrie

Changes from v1:
- Add a second patch to enable the hid-playstation driver for PS5 controllers

Thanks to Roderick for your feedback.

Alex Henrie (2):
HID: Enable playstation driver independently of sony driver
HID: Enable playstation driver for PlayStation 5 controllers

 drivers/hid/hid-quirks.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.47.1
#6 lore raw

PATCH v2 1/2 HID: Enable playstation driver independently of sony driver

PlayStation 4 controllers use the hid-playstation driver now, but they are still not included in the hid_have_special_driver table unless the hid-sony driver is enabled. Split up that section of the table so that hid-playstation works even in the absence of hid-sony.

Fixes 4f1f391869ee ("HID: sony: remove DualShock4 support.")
---
 drivers/hid/hid-quirks.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/hid/hid-quirks.c +7 -5
index e0bbf0c6345d..ff23a7ac7001 100644
@@ -595,6 +595,13 @@ static const struct hid_device_id hid_have_special_driver[] = {
 #if IS_ENABLED(CONFIG_HID_PLANTRONICS)
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
 #endif
+#if IS_ENABLED(CONFIG_HID_PLAYSTATION)
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
+#endif
 #if IS_ENABLED(CONFIG_HID_PRIMAX)
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
 #endif
@@ -664,11 +671,6 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
-	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
-	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER) },
Signature · 1 line
2.47.1
#7 lore raw

PATCH v2 2/2 HID: Enable playstation driver for PlayStation 5 controllers

In reply to Alex Henrie

Without entries in the hid_have_special_driver table, PS5 controllers default to the hidraw driver instead of the hid-playstation driver.

---
 drivers/hid/hid-quirks.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hid/hid-quirks.c +4 -0
index ff23a7ac7001..a2975e994bc1 100644
@@ -601,6 +601,10 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER_2) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER_2) },
 #endif
 #if IS_ENABLED(CONFIG_HID_PRIMAX)
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
Signature · 1 line
2.47.1
maintainer
#8 lore raw

Re: [PATCH v2 0/2] HID: hid_have_special_driver fixes for playstation driver

In reply to Alex Henrie
Quoted 4 lines · Alex Henrie

Changes from v1:
- Add a second patch to enable the hid-playstation driver for PS5 controllers

Quoted 8 lines

Thanks to Roderick for your feedback.

Alex Henrie (2):
HID: Enable playstation driver independently of sony driver
HID: Enable playstation driver for PlayStation 5 controllers

 drivers/hid/hid-quirks.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Both now applied to hid.git#for-6.15/sony. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs