From: Sanjay Govind <sanjay.govind9@gmail.com>
To: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Sanjay Govind <sanjay.govind9@gmail.com>
Subject: [PATCH 3/4] HID: sony: add support for the PDP and MadCatz Rock Band 4 PS4 drums
Date: Tue, 1 Dec 2026 15:09:22 +1300 [thread overview]
Message-ID: <20261201020922.3552247-5-sanjay.govind9@gmail.com> (raw)
In-Reply-To: <20261201020922.3552247-2-sanjay.govind9@gmail.com>
The PDP (0e6f:0174) and MadCatz (0738:8262) Rock Band 4 drum kits for
PS4 connect over Bluetooth. They send input report 0x01 with the same
layout as the PS4 mode of the Stage Tour drum kit over USB.
Add them using the existing Rock Band 4 drum support. As the length of
their reports is not known to match the 64 bytes sent over USB, only
check that a report is long enough to contain the pad and cymbal
velocities instead of checking for an exact length.
Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
---
Notes:
IDs and report layout from the PlasticBand PS4 4-lane drums
documentation:
https://github.com/TheNathannator/PlasticBand/blob/main/Docs/Instruments/4-Lane%20Drums/PS4.md
Santroller's Bluetooth host (src/devices/bt/host/ds4_host.cpp) handles
these kits as third-party DS4 devices and uses their 0x01 reports with
the USB layout; it does not check the report length, so the length
check only requires the bytes that are read.
Built hid-sony.ko with W=1 against the 7.3.6 headers, no warnings;
checkpatch clean. Not tested on hardware.
The patch and changelog were written with the help of an AI coding
assistant (Claude Opus 5.5).
drivers/hid/hid-ids.h | 2 ++
drivers/hid/hid-quirks.c | 2 ++
drivers/hid/hid-sony.c | 18 ++++++++++++++----
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index ae543eb43a6b..08cb8e54770d 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1184,6 +1184,7 @@
#define USB_VENDOR_ID_PDP 0x0e6F
#define USB_DEVICE_ID_PDP_PS4_JAGUAR 0x0173
+#define USB_DEVICE_ID_PDP_PS4_DRUMS 0x0174
#define USB_DEVICE_ID_PDP_PS4_RIFFMASTER 0x024a
#define USB_DEVICE_ID_PDP_PS5_RIFFMASTER 0x0249
#define USB_DEVICE_ID_PDP_SWITCH_AFTERGLOW 0x018c
@@ -1688,6 +1689,7 @@
#define USB_VENDOR_ID_MADCATZ 0x0738
#define USB_DEVICE_ID_MADCATZ_PS4_STRATOCASTER 0x8261
+#define USB_DEVICE_ID_MADCATZ_PS4_DRUMS 0x8262
#define USB_VENDOR_ID_MULTIPLE_1781 0x1781
#define USB_DEVICE_ID_RAPHNET_4NES4SNES_OLD 0x0a9d
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 1ee79d77c917..ed25d9539bc8 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -725,7 +725,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB3_MUSTANG_GUITAR) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_PS3) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_PS4_STRATOCASTER) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_PS4_DRUMS) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS4_JAGUAR) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS4_DRUMS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS4_RIFFMASTER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS5_RIFFMASTER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE, USB_DEVICE_ID_REDOCTANE_GUITAR_DONGLE) },
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 8f95df362850..4e68eb11c418 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -73,6 +73,7 @@
#define DJH_TURNTABLE BIT(22)
#define RB4_DRUMS_PS4_USB BIT(23)
#define RB4_DRUMS_PS5 BIT(24)
+#define RB4_DRUMS_PS4_BT BIT(25)
#define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)
#define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT)
@@ -86,7 +87,7 @@
#define SONY_BT_DEVICE (SIXAXIS_CONTROLLER_BT | MOTION_CONTROLLER_BT | NAVIGATION_CONTROLLER_BT)
#define NSG_MRXU_REMOTE (NSG_MR5U_REMOTE_BT | NSG_MR7U_REMOTE_BT)
#define RB4_GUITAR_PS4 (RB4_GUITAR_PS4_USB | RB4_GUITAR_PS4_BT)
-#define RB4_DRUMS_PS4 (RB4_DRUMS_PS4_USB)
+#define RB4_DRUMS_PS4 (RB4_DRUMS_PS4_USB | RB4_DRUMS_PS4_BT)
#define RB4_DRUMS (RB4_DRUMS_PS4 | RB4_DRUMS_PS5)
#define MAX_LEDS 4
@@ -1239,9 +1240,6 @@ static int rb4_drums_raw_event(struct sony_sc *sc, u8 *rd, int size)
u8 hat;
int i;
- if (unlikely(size != 64 || rd[0] != 0x01))
- return 0;
-
if (sc->quirks & RB4_DRUMS_PS5) {
hat_offset = 8;
velocity_offset = 40;
@@ -1250,6 +1248,14 @@ static int rb4_drums_raw_event(struct sony_sc *sc, u8 *rd, int size)
velocity_offset = 43;
}
+ /*
+ * Bluetooth kits use the USB report layout, but the report length is
+ * not known to match, so only check that the velocities are there.
+ */
+ if (unlikely(rd[0] != 0x01 ||
+ size < velocity_offset + ARRAY_SIZE(rb4_drums_velocity_absmap)))
+ return 0;
+
/* 0 is up, counting clockwise in steps of 45 degrees, 8 is centered */
hat = rd[hat_offset] & 0x0f;
input_report_key(input, BTN_DPAD_UP, hat == 7 || hat <= 1);
@@ -2726,6 +2732,10 @@ static const struct hid_device_id sony_devices[] = {
/* Rock Band 4 PS4 drums */
{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS4_STAGE_TOUR),
.driver_data = RB4_DRUMS_PS4_USB | INSTRUMENT },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS4_DRUMS),
+ .driver_data = RB4_DRUMS_PS4_BT | INSTRUMENT },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_PS4_DRUMS),
+ .driver_data = RB4_DRUMS_PS4_BT | INSTRUMENT },
/* Rock Band 4 PS5 drums */
{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS5_STAGE_TOUR),
.driver_data = RB4_DRUMS_PS5 | INSTRUMENT },
--
2.56.1
next prev parent reply other threads:[~2026-12-01 2:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 2:09 [PATCH 0/4] HID: sony: add support for new CRKD and RedOctane Games instruments Sanjay Govind
2026-12-01 2:09 ` [PATCH 1/4] HID: sony: add IDs for the 2026 CRKD Gibson SG and Gibson Kramer guitars Sanjay Govind
2026-12-01 2:09 ` [PATCH 2/4] HID: sony: add support for the Stage Tour drum kit Sanjay Govind
2026-12-01 2:09 ` Sanjay Govind [this message]
2026-12-01 2:09 ` [PATCH 4/4] HID: sony: report the battery of Rock Band 4 PS5 drums Sanjay Govind
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201020922.3552247-5-sanjay.govind9@gmail.com \
--to=sanjay.govind9@gmail.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®