Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 0/4] HID: sony: add support for new CRKD and RedOctane Games instruments
@ 2026-12-01  2:09 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
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sanjay Govind @ 2026-12-01  2:09 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input; +Cc: linux-kernel, Sanjay Govind

Add support for the 2026 CRKD Gibson SG and RedOctane Games Gibson
Kramer guitars, the RedOctane Games Stage Tour drum kit, and the PDP and
MadCatz Rock Band 4 PS4 drum kits.

Rock Band 4 drum kits report a velocity for each pad and cymbal. As in
hid-wiimote, these are reported on the hat axes, so the D-pad of these
drum kits is reported as BTN_DPAD_* instead. Existing instruments are
not affected.

The guitars and the Stage Tour drum kit were tested in both their PS4
and PS5 modes. The PDP and MadCatz drum kits connect over Bluetooth and
were not tested, as I don't have them.

This series is based on top of "[PATCH 0/2] HID: sony: fix RB4 PS5
guitar battery handling":
https://lore.kernel.org/linux-input/20261201020704.3545243-1-sanjay.govind9@gmail.com/
Only patch 4 depends on it.

Sanjay Govind (4):
  HID: sony: add IDs for the 2026 CRKD Gibson SG and Gibson Kramer
    guitars
  HID: sony: add support for the Stage Tour drum kit
  HID: sony: add support for the PDP and MadCatz Rock Band 4 PS4 drums
  HID: sony: report the battery of Rock Band 4 PS5 drums

 drivers/hid/hid-ids.h    |  12 +++
 drivers/hid/hid-quirks.c |  10 +++
 drivers/hid/hid-sony.c   | 184 +++++++++++++++++++++++++++++++++------
 3 files changed, 177 insertions(+), 29 deletions(-)


base-commit: 720806515cb6921ab05caaa6f470f7054b56385e
prerequisite-patch-id: 78a115ec515d2af27a1c66a4a2a6bb57460f2f5c
prerequisite-patch-id: acc666175320e698e0b990d2b90926936d57cf98
-- 
2.56.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] HID: sony: add IDs for the 2026 CRKD Gibson SG and Gibson Kramer guitars
  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 ` Sanjay Govind
  2026-12-01  2:09 ` [PATCH 2/4] HID: sony: add support for the Stage Tour drum kit Sanjay Govind
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sanjay Govind @ 2026-12-01  2:09 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input; +Cc: linux-kernel, Sanjay Govind

Add the PlayStation mode USB IDs of two new guitars:

  - CRKD Gibson SG (2026): 3651:8500 (PS4) and 3651:8600 (PS5), plus
    3651:8510 and 3651:8610 when connected through the wireless dongle.
  - RedOctane Games Gibson Kramer: 3958:5500 (PS4) and 3958:5600 (PS5).

Both guitars emulate Rock Band 4 guitars in these modes, so handle them
the same way as the existing CRKD Gibson SG.

Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
---

Notes:
    Built hid-sony.o and hid-quirks.o with W=1, no warnings; checkpatch
    clean.
    
    Tested:
    - Gibson Kramer, PS5 mode (3958:5600): the report descriptor is
      identical to the Stage Tour drum kit's in PS5 mode. The frets report
      BTN_SOUTH/EAST/NORTH/WEST/TL, strum reports ABS_HAT0Y, whammy (byte
      41) reports ABS_Z, tilt (byte 42) reports ABS_RZ, and the battery is
      reported through the power supply class.
    - Gibson Kramer, PS4 mode (3958:5500): input report 0x01 is 64 bytes.
      The frets and strum report the same events as in PS5 mode, whammy
      (byte 44) reports ABS_Z over its full 0-255 range and tilt (byte 45)
      reports ABS_RZ.
    - Gibson SG, PS5 mode, wired (3651:8600): same descriptor and events as
      the Gibson Kramer in PS5 mode, with whammy and tilt at bytes 41 and
      42.
    - Gibson SG, PS4 mode, wired (3651:8500): same descriptor and events as
      the Gibson Kramer in PS4 mode, with whammy (0-255) and tilt at bytes
      44 and 45.
    - Gibson SG through its dongle, PS4 mode (3651:8510) and PS5 mode
      (3651:8610): same descriptors and events as when wired. In PS5 mode
      the dongle also sends 0x0c for the battery level.
    
    The patch and changelog were written with the help of an AI coding
    assistant (Claude Opus 5.5).

 drivers/hid/hid-ids.h    |  8 ++++++++
 drivers/hid/hid-quirks.c |  6 ++++++
 drivers/hid/hid-sony.c   | 12 ++++++++++++
 3 files changed, 26 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 91319aa6516d..9678145c4a6a 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -389,6 +389,10 @@
 #define USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_DONGLE 0x5500
 #define USB_DEVICE_ID_CRKD_PS5_GIBSON_SG        0x1600
 #define USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_DONGLE	0x5600
+#define USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_2026	0x8500
+#define USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_2026_DONGLE	0x8510
+#define USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_2026	0x8600
+#define USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_2026_DONGLE	0x8610
 
 #define USB_VENDOR_ID_CVTOUCH		0x1ff7
 #define USB_DEVICE_ID_CVTOUCH_SCREEN	0x0013
@@ -1269,6 +1273,10 @@
 #define USB_DEVICE_ID_REDOCTANE_GUITAR_DONGLE	0x474c
 #define USB_DEVICE_ID_REDOCTANE_PS4_GHLIVE_DONGLE	0x07bb
 
+#define USB_VENDOR_ID_REDOCTANE_GAMES	0x3958
+#define USB_DEVICE_ID_REDOCTANE_PS4_KRAMER	0x5500
+#define USB_DEVICE_ID_REDOCTANE_PS5_KRAMER	0x5600
+
 #define USB_VENDOR_ID_RETROUSB		0xf000
 #define USB_DEVICE_ID_RETROUSB_SNES_RETROPAD	0x0003
 #define USB_DEVICE_ID_RETROUSB_SNES_RETROPORT	0x00f1
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 793db001a62b..a0a41dbe3545 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -705,6 +705,12 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_DONGLE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_DONGLE) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_2026) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_2026_DONGLE) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_2026) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_2026_DONGLE) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS4_KRAMER) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS5_KRAMER) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB1_DRUMS) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB1_GUITAR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB2_DRUMS) },
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 1f1152575ae4..a59470f80645 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2611,6 +2611,12 @@ static const struct hid_device_id sony_devices[] = {
 		.driver_data = RB4_GUITAR_PS4_USB | INSTRUMENT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_DONGLE),
 		.driver_data = RB4_GUITAR_PS4_USB | INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_2026),
+		.driver_data = RB4_GUITAR_PS4_USB | INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS4_GIBSON_SG_2026_DONGLE),
+		.driver_data = RB4_GUITAR_PS4_USB | INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS4_KRAMER),
+		.driver_data = RB4_GUITAR_PS4_USB | INSTRUMENT },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS4_JAGUAR),
 		.driver_data = RB4_GUITAR_PS4_BT | INSTRUMENT },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_PS4_STRATOCASTER),
@@ -2622,6 +2628,12 @@ static const struct hid_device_id sony_devices[] = {
 		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_DONGLE),
 		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_2026),
+		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_2026_DONGLE),
+		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS5_KRAMER),
+		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, sony_devices);
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] HID: sony: add support for the Stage Tour drum kit
  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 ` Sanjay Govind
  2026-12-01  2:09 ` [PATCH 3/4] HID: sony: add support for the PDP and MadCatz Rock Band 4 PS4 drums Sanjay Govind
  2026-12-01  2:09 ` [PATCH 4/4] HID: sony: report the battery of Rock Band 4 PS5 drums Sanjay Govind
  3 siblings, 0 replies; 5+ messages in thread
From: Sanjay Govind @ 2026-12-01  2:09 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input; +Cc: linux-kernel, Sanjay Govind

The RedOctane Games Stage Tour drum kit has PS4 (3958:d500) and PS5
(3958:d600) modes, in which it emulates a Rock Band 4 drum kit.

Each pad and cymbal hit sets the face button of its colour, so a pad
and the cymbal of the same colour cannot be told apart from the buttons
alone. The kit also reports a velocity for each pad and cymbal, at byte
43 onwards on PS4 and byte 40 onwards on PS5, which hid-core does not
map because the report descriptor declares them as vendor defined.

Report these velocities on the hat axes, as hid-wiimote does for its
drums, using the same axes as hid-wiimote for the red, blue, yellow and
green pads. The cymbals are reported on the remaining hat axes. As the
hat axes are now used for the velocities, decode the D-pad into
BTN_DPAD_* buttons instead. The kick pedals are L1 and R1, and are
already mapped by the instrument mapping.

These events are not synced by the raw event handler, so that hid-input
reports them in the same frame as the face buttons of the same report.

Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
---

Notes:
    The report layouts come from the PlasticBand PS4 4-lane drums
    documentation and the Santroller PS5 drum report definition.
    
    Built hid-sony.ko with W=1 against the 7.3.6 headers, no warnings;
    checkpatch clean.
    
    Tested on a Stage Tour drum kit over USB in both modes:
    - PS5 (3958:d600): input report 0x01 is 64 bytes with the hat in the
      low nibble of byte 8 and the velocities at bytes 40-46.
    - PS4 (3958:d500): input report 0x01 is 64 bytes with the hat in the
      low nibble of byte 5 and the velocities at bytes 43-49.
    In both modes the report descriptor declares the velocities as vendor
    defined. Each pad and cymbal moves only its own hat axis with the
    expected velocity (0-255) together with its face button, the kick pedal
    reports BTN_TL, and the D-pad reports BTN_DPAD_*. Each hit reports its
    velocity and face button in the same frame.
    
    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   | 95 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 9678145c4a6a..ae543eb43a6b 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1276,6 +1276,8 @@
 #define USB_VENDOR_ID_REDOCTANE_GAMES	0x3958
 #define USB_DEVICE_ID_REDOCTANE_PS4_KRAMER	0x5500
 #define USB_DEVICE_ID_REDOCTANE_PS5_KRAMER	0x5600
+#define USB_DEVICE_ID_REDOCTANE_PS4_STAGE_TOUR	0xd500
+#define USB_DEVICE_ID_REDOCTANE_PS5_STAGE_TOUR	0xd600
 
 #define USB_VENDOR_ID_RETROUSB		0xf000
 #define USB_DEVICE_ID_RETROUSB_SNES_RETROPAD	0x0003
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index a0a41dbe3545..1ee79d77c917 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -711,6 +711,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG_2026_DONGLE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS4_KRAMER) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS5_KRAMER) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS4_STAGE_TOUR) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS5_STAGE_TOUR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB1_DRUMS) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB1_GUITAR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB2_DRUMS) },
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index a59470f80645..8f95df362850 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -71,6 +71,8 @@
 #define RB4_GUITAR_PS5            BIT(20)
 #define RB3_PRO_INSTRUMENT        BIT(21)
 #define DJH_TURNTABLE             BIT(22)
+#define RB4_DRUMS_PS4_USB         BIT(23)
+#define RB4_DRUMS_PS5             BIT(24)
 
 #define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)
 #define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT)
@@ -84,6 +86,8 @@
 #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 (RB4_DRUMS_PS4 | RB4_DRUMS_PS5)
 
 #define MAX_LEDS 4
 #define NSG_MRXU_MAX_X 1667
@@ -444,6 +448,21 @@ static const unsigned int ps3_turntable_absmap[] = {
 	[0x35] = ABS_Y,
 };
 
+/*
+ * Rock Band 4 drum kits report a velocity for each pad and cymbal. These
+ * are reported on the hat axes, following the hid-wiimote drums, in the
+ * order the velocities appear in the input report.
+ */
+static const unsigned int rb4_drums_velocity_absmap[] = {
+	ABS_HAT0X, /* Red pad */
+	ABS_HAT0Y, /* Blue pad */
+	ABS_HAT2X, /* Yellow pad */
+	ABS_HAT1X, /* Green pad */
+	ABS_HAT3Y, /* Yellow cymbal */
+	ABS_HAT1Y, /* Blue cymbal */
+	ABS_HAT2Y, /* Green cymbal */
+};
+
 static const unsigned int instrument_keymap[] = {
 	[0x1] = BTN_WEST,
 	[0x2] = BTN_SOUTH,
@@ -744,6 +763,20 @@ static int rb4_guitar_mapping(struct hid_device *hdev, struct hid_input *hi,
 	return 0;
 }
 
+static int rb4_drums_mapping(struct hid_device *hdev, struct hid_input *hi,
+			  struct hid_field *field, struct hid_usage *usage,
+			  unsigned long **bit, int *max)
+{
+	/*
+	 * The hat axes carry the pad and cymbal velocities, so the D-pad is
+	 * decoded into buttons by rb4_drums_raw_event() instead.
+	 */
+	if (usage->hid == HID_GD_HATSWITCH)
+		return -1;
+
+	return 0;
+}
+
 static const u8 *motion_fixup(struct hid_device *hdev, u8 *rdesc,
 			      unsigned int *rsize)
 {
@@ -1199,6 +1232,56 @@ static int rb4_ps5_guitar_raw_event(struct sony_sc *sc, u8 *rd, int size)
 	return 0;
 }
 
+static int rb4_drums_raw_event(struct sony_sc *sc, u8 *rd, int size)
+{
+	struct input_dev *input = sc->input_dev;
+	int hat_offset, velocity_offset;
+	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;
+	} else {
+		hat_offset = 5;
+		velocity_offset = 43;
+	}
+
+	/* 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);
+	input_report_key(input, BTN_DPAD_RIGHT, hat >= 1 && hat <= 3);
+	input_report_key(input, BTN_DPAD_DOWN, hat >= 3 && hat <= 5);
+	input_report_key(input, BTN_DPAD_LEFT, hat >= 5 && hat <= 7);
+
+	for (i = 0; i < ARRAY_SIZE(rb4_drums_velocity_absmap); i++)
+		input_report_abs(input, rb4_drums_velocity_absmap[i],
+				 rd[velocity_offset + i]);
+
+	/*
+	 * hid-input syncs these events together with the buttons of the same
+	 * report, so that each hit arrives as a single frame.
+	 */
+	return 0;
+}
+
+static void rb4_drums_setup_input(struct input_dev *input)
+{
+	int i;
+
+	input_set_capability(input, EV_KEY, BTN_DPAD_UP);
+	input_set_capability(input, EV_KEY, BTN_DPAD_DOWN);
+	input_set_capability(input, EV_KEY, BTN_DPAD_LEFT);
+	input_set_capability(input, EV_KEY, BTN_DPAD_RIGHT);
+
+	for (i = 0; i < ARRAY_SIZE(rb4_drums_velocity_absmap); i++)
+		input_set_abs_params(input, rb4_drums_velocity_absmap[i],
+				     0, 255, 0, 0);
+}
+
 static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
 		u8 *rd, int size)
 {
@@ -1277,6 +1360,9 @@ static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
 	if (sc->quirks & RB4_GUITAR_PS5)
 		return rb4_guitar_mapping(hdev, hi, field, usage, bit, max);
 
+	if (sc->quirks & RB4_DRUMS)
+		return rb4_drums_mapping(hdev, hi, field, usage, bit, max);
+
 	/* Let hid-core decide for the others */
 	return 0;
 }
@@ -2308,6 +2394,9 @@ static int sony_input_configured(struct hid_device *hdev,
 		sony_init_raw_event_handler(sc, rb4_ps4_guitar_raw_event);
 	} else if (sc->quirks & RB4_GUITAR_PS5) {
 		sony_init_raw_event_handler(sc, rb4_ps5_guitar_raw_event);
+	} else if (sc->quirks & RB4_DRUMS) {
+		rb4_drums_setup_input(sc->input_dev);
+		sony_init_raw_event_handler(sc, rb4_drums_raw_event);
 	}
 
 	if (sc->quirks & SONY_LED_SUPPORT) {
@@ -2634,6 +2723,12 @@ static const struct hid_device_id sony_devices[] = {
 		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE_GAMES, USB_DEVICE_ID_REDOCTANE_PS5_KRAMER),
 		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
+	/* 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 },
+	/* 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 },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, sony_devices);
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] HID: sony: add support for the PDP and MadCatz Rock Band 4 PS4 drums
  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
  2026-12-01  2:09 ` [PATCH 4/4] HID: sony: report the battery of Rock Band 4 PS5 drums Sanjay Govind
  3 siblings, 0 replies; 5+ messages in thread
From: Sanjay Govind @ 2026-12-01  2:09 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input; +Cc: linux-kernel, Sanjay Govind

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] HID: sony: report the battery of Rock Band 4 PS5 drums
  2026-12-01  2:09 [PATCH 0/4] HID: sony: add support for new CRKD and RedOctane Games instruments Sanjay Govind
                   ` (2 preceding siblings ...)
  2026-12-01  2:09 ` [PATCH 3/4] HID: sony: add support for the PDP and MadCatz Rock Band 4 PS4 drums Sanjay Govind
@ 2026-12-01  2:09 ` Sanjay Govind
  3 siblings, 0 replies; 5+ messages in thread
From: Sanjay Govind @ 2026-12-01  2:09 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input; +Cc: linux-kernel, Sanjay Govind

Rock Band 4 PS5 drum kits report their battery state in byte 30 of
their input report, encoded the same way as on Rock Band 4 PS5
guitars. The Stage Tour drum kit reports its battery level there, for
example 0x19 (charging, level 9) when connected over USB.

Move the decoding of this byte out of the PS5 guitar handler into a
helper, and use it for PS5 drum kits as well. Like the guitars, these
kits have no MAC address, so give them a device ID to keep the name of
their battery unique.

Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
---

Notes:
    Depends on the series fixing the RB4 PS5 guitar battery reporting
    ("HID: sony: handle RB4 PS5 guitars that do not report a battery
    level" and "HID: sony: fix battery name clash between RB4 PS5
    guitars").
    
    Tested on a Stage Tour drum kit in PS5 mode (3958:d600):
    - Over USB, it reports 0x19 in byte 30 and its battery is reported as
      charging at 95%.
    - Through its wireless dongle, which uses the same USB ID, it reports
      0x08 and its battery is reported as discharging at 85%.
    
    Built hid-sony.ko with W=1 against the 7.3.6 headers, no warnings;
    checkpatch clean.
    
    The patch and changelog were written with the help of an AI coding
    assistant (Claude Opus 5.5).

 drivers/hid/hid-sony.c | 67 ++++++++++++++++++++++++------------------
 1 file changed, 38 insertions(+), 29 deletions(-)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 4e68eb11c418..55662d163f57 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -82,7 +82,7 @@
 #define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER | BUZZ_CONTROLLER |\
 				MOTION_CONTROLLER | NAVIGATION_CONTROLLER)
 #define SONY_BATTERY_SUPPORT (SIXAXIS_CONTROLLER | MOTION_CONTROLLER_BT | NAVIGATION_CONTROLLER |\
-				RB4_GUITAR_PS5)
+				RB4_GUITAR_PS5 | RB4_DRUMS_PS5)
 #define SONY_FF_SUPPORT (SIXAXIS_CONTROLLER | MOTION_CONTROLLER)
 #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)
@@ -1165,38 +1165,24 @@ static int rb4_ps4_guitar_raw_event(struct sony_sc *sc, u8 *rd, int size)
 	return 0;
 }
 
-static int rb4_ps5_guitar_raw_event(struct sony_sc *sc, u8 *rd, int size)
+/*
+ * Rock Band 4 PS5 instruments report the battery status and level at byte 30
+ * of their input report.
+ */
+static void rb4_ps5_parse_battery(struct sony_sc *sc, u8 data)
 {
 	u8 charging_status;
 	u8 battery_data;
 	u8 battery_capacity;
 	u8 battery_status;
 
-	if (unlikely(size != 64 || rd[0] != 0x01))
-		return 0;
-
-	/*
-	 * Rock Band 4 PS5 guitars have whammy and
-	 * tilt functionality, they're located at
-	 * byte 41 and 42 respectively.
-	 *
-	 * We will map these values to the triggers
-	 * because the guitars don't have anything
-	 * mapped there.
-	 */
-	input_report_abs(sc->input_dev, ABS_Z, rd[41]);
-	input_report_abs(sc->input_dev, ABS_RZ, rd[42]);
-
-	/*
-	 * Rock Band 4 PS5 guitars also report the
-	 * battery status and level at byte 30.
-	 */
-	charging_status = (rd[30] >> 4) & 0x0F;
-	battery_data = rd[30] & 0x0F;
+	charging_status = (data >> 4) & 0x0F;
+	battery_data = data & 0x0F;
 
 	/*
-	 * A level of 0x0c means that the guitar does not report its battery
-	 * level. Keep the capacity at 100% to avoid low battery warnings.
+	 * A level of 0x0c means that the instrument does not report its
+	 * battery level. Keep the capacity at 100% to avoid low battery
+	 * warnings.
 	 */
 	if (battery_data == 0x0c) {
 		battery_capacity = 100;
@@ -1228,6 +1214,26 @@ static int rb4_ps5_guitar_raw_event(struct sony_sc *sc, u8 *rd, int size)
 		sc->battery_capacity = battery_capacity;
 		sc->battery_status = battery_status;
 	}
+}
+
+static int rb4_ps5_guitar_raw_event(struct sony_sc *sc, u8 *rd, int size)
+{
+	if (unlikely(size != 64 || rd[0] != 0x01))
+		return 0;
+
+	/*
+	 * Rock Band 4 PS5 guitars have whammy and
+	 * tilt functionality, they're located at
+	 * byte 41 and 42 respectively.
+	 *
+	 * We will map these values to the triggers
+	 * because the guitars don't have anything
+	 * mapped there.
+	 */
+	input_report_abs(sc->input_dev, ABS_Z, rd[41]);
+	input_report_abs(sc->input_dev, ABS_RZ, rd[42]);
+
+	rb4_ps5_parse_battery(sc, rd[30]);
 
 	input_sync(sc->input_dev);
 	return 0;
@@ -1267,6 +1273,9 @@ static int rb4_drums_raw_event(struct sony_sc *sc, u8 *rd, int size)
 		input_report_abs(input, rb4_drums_velocity_absmap[i],
 				 rd[velocity_offset + i]);
 
+	if (sc->quirks & RB4_DRUMS_PS5)
+		rb4_ps5_parse_battery(sc, rd[30]);
+
 	/*
 	 * hid-input syncs these events together with the buttons of the same
 	 * report, so that each hit arrives as a single frame.
@@ -2005,7 +2014,7 @@ static int sony_battery_probe(struct sony_sc *sc, int append_dev_id)
 	int ret;
 
 	/*
-	 * Devices without a MAC address, such as Rock Band 4 PS5 guitars,
+	 * Devices without a MAC address, such as Rock Band 4 PS5 instruments,
 	 * would all get the same name, so use the device ID to tell them
 	 * apart.
 	 */
@@ -2186,10 +2195,10 @@ static int sony_set_device_id(struct sony_sc *sc)
 	int ret;
 
 	/*
-	 * Only Sixaxis controllers, and Rock Band 4 PS5 guitars which need it
-	 * to name their battery, get an id. All others are set to -1.
+	 * Only Sixaxis controllers, and Rock Band 4 PS5 instruments which need
+	 * it to name their battery, get an id. All others are set to -1.
 	 */
-	if (sc->quirks & (SIXAXIS_CONTROLLER | RB4_GUITAR_PS5)) {
+	if (sc->quirks & (SIXAXIS_CONTROLLER | RB4_GUITAR_PS5 | RB4_DRUMS_PS5)) {
 		ret = ida_alloc(&sony_device_id_allocator, GFP_KERNEL);
 		if (ret < 0) {
 			sc->device_id = -1;
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-01  2:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 3/4] HID: sony: add support for the PDP and MadCatz Rock Band 4 PS4 drums Sanjay Govind
2026-12-01  2:09 ` [PATCH 4/4] HID: sony: report the battery of Rock Band 4 PS5 drums Sanjay Govind

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox