public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] HID: sony: add support for more instruments
@ 2026-04-07 19:46 Rosalie Wanders
  2026-04-08 20:41 ` Jiri Kosina
  0 siblings, 1 reply; 8+ messages in thread
From: Rosalie Wanders @ 2026-04-07 19:46 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: Rosalie Wanders, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

This patch adds support for the following instruments:

* Rock Band 1/2/3 Wii/PS3 instruments
* Rock Band 3 PS3 Pro instruments
* DJ Hero Turntable

Wii and PS3 instruments are the same besides the vendor and product ID.

This patch also fixes the mappings for the existing Guitar Hero
instruments.

Co-developed-by: Sanjay Govind <sanjay.govind9@gmail.com>
Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
Co-developed-by: Brenton Simpson <appsforartists@google.com>
Signed-off-by: Brenton Simpson <appsforartists@google.com>
Signed-off-by: Rosalie Wanders <rosalie@mailbox.org>
---
changes:
v2: correct squier device name and remove non-existent squier usb device

 drivers/hid/hid-ids.h  |  26 +++-
 drivers/hid/hid-sony.c | 274 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 253 insertions(+), 47 deletions(-)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 3e299a30dcde..3dab8b910831 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -664,6 +664,18 @@
 #define USB_DEVICE_ID_UGCI_FLYING	0x0020
 #define USB_DEVICE_ID_UGCI_FIGHTING	0x0030
 
+#define USB_VENDOR_ID_HARMONIX		0x1bad
+#define USB_DEVICE_ID_HARMONIX_WII_RB1_GUITAR	0x0004
+#define USB_DEVICE_ID_HARMONIX_WII_RB2_GUITAR	0x3010
+#define USB_DEVICE_ID_HARMONIX_WII_RB1_DRUMS	    0x0005
+#define USB_DEVICE_ID_HARMONIX_WII_RB2_DRUMS	    0x3110
+#define USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_DRUMS_MODE	0x3138
+#define USB_DEVICE_ID_HARMONIX_WII_RB3_MUSTANG_GUITAR	0x3430
+#define USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_MUSTANG_MODE	0x3438
+#define USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_SQUIER_MODE	0x3538
+#define USB_DEVICE_ID_HARMONIX_WII_RB3_KEYBOARD	        0x3330
+#define USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_KEYBOARD_MODE	0x3338
+
 #define USB_VENDOR_ID_HP		0x03f0
 #define USB_PRODUCT_ID_HP_ELITE_PRESENTER_MOUSE_464A		0x464a
 #define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A	0x0a4a
@@ -1298,8 +1310,18 @@
 #define USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER	0x1000
 
 #define USB_VENDOR_ID_SONY_RHYTHM	0x12ba
-#define USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE_DONGLE	0x074b
-#define USB_DEVICE_ID_SONY_PS3_GUITAR_DONGLE	0x0100
+#define USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE	0x074b
+#define USB_DEVICE_ID_SONY_PS3_GH_GUITAR	0x0100
+#define USB_DEVICE_ID_SONY_PS3_GH_DRUMS		0x0120
+#define USB_DEVICE_ID_SONY_PS3_DJH_TURNTABLE	0x0140
+#define USB_DEVICE_ID_SONY_PS3_RB_GUITAR	0x0200
+#define USB_DEVICE_ID_SONY_PS3_RB_DRUMS		0x0210
+#define USB_DEVICE_ID_SONY_PS3_RB3_MPA_DRUMS_MODE	0x0218
+#define USB_DEVICE_ID_SONY_PS3_RB3_MUSTANG_GUITAR	0x2430
+#define USB_DEVICE_ID_SONY_PS3_RB3_MPA_MUSTANG_MODE	0x2438
+#define USB_DEVICE_ID_SONY_PS3_RB3_MPA_SQUIER_MODE	0x2538
+#define USB_DEVICE_ID_SONY_PS3_RB3_KEYBOARD	        0x2330
+#define USB_DEVICE_ID_SONY_PS3_RB3_MPA_KEYBOARD_MODE	0x2338
 
 #define USB_VENDOR_ID_SINO_LITE			0x1345
 #define USB_DEVICE_ID_SINO_LITE_CONTROLLER	0x3008
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index a89af14e4acc..a14e730318ce 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *  HID driver for Sony / PS2 / PS3 / PS4 BD devices.
+ *  HID driver for Sony / PS2 / PS3 / PS4 / PS5 BD devices.
  *
  *  Copyright (c) 1999 Andreas Gal
  *  Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
@@ -12,9 +12,10 @@
  *  Copyright (c) 2014-2016 Frank Praznik <frank.praznik@gmail.com>
  *  Copyright (c) 2018 Todd Kelner
  *  Copyright (c) 2020-2021 Pascal Giard <pascal.giard@etsmtl.ca>
- *  Copyright (c) 2020 Sanjay Govind <sanjay.govind9@gmail.com>
+ *  Copyright (c) 2020-2026 Sanjay Govind <sanjay.govind9@gmail.com>
  *  Copyright (c) 2021 Daniel Nguyen <daniel.nguyen.1@ens.etsmtl.ca>
  *  Copyright (c) 2026 Rosalie Wanders <rosalie@mailbox.org>
+ *  Copyright (c) 2026 Brenton Simpson <appsforartists@google.com>
  */
 
 /*
@@ -59,12 +60,15 @@
 #define NSG_MR5U_REMOTE_BT        BIT(11)
 #define NSG_MR7U_REMOTE_BT        BIT(12)
 #define SHANWAN_GAMEPAD           BIT(13)
-#define GH_GUITAR_CONTROLLER      BIT(14)
-#define GHL_GUITAR_PS3WIIU        BIT(15)
-#define GHL_GUITAR_PS4            BIT(16)
-#define RB4_GUITAR_PS4_USB        BIT(17)
-#define RB4_GUITAR_PS4_BT         BIT(18)
-#define RB4_GUITAR_PS5            BIT(19)
+#define INSTRUMENT                BIT(14)
+#define GH_GUITAR_TILT            BIT(15)
+#define GHL_GUITAR_PS3WIIU        BIT(16)
+#define GHL_GUITAR_PS4            BIT(17)
+#define RB4_GUITAR_PS4_USB        BIT(18)
+#define RB4_GUITAR_PS4_BT         BIT(19)
+#define RB4_GUITAR_PS5            BIT(20)
+#define RB3_PS3_PRO_INSTRUMENT    BIT(21)
+#define PS3_DJH_TURNTABLE		  BIT(22)
 
 #define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)
 #define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT)
@@ -87,6 +91,10 @@
 #define GHL_GUITAR_POKE_INTERVAL 8 /* In seconds */
 #define GUITAR_TILT_USAGE 44
 
+#define TURNTABLE_EFFECTS_KNOB_USAGE 44
+#define TURNTABLE_PLATTER_BUTTONS_USAGE 45
+#define TURNTABLE_CROSS_FADER_USAGE 46
+
 /* Magic data taken from GHLtarUtility:
  * https://github.com/ghlre/GHLtarUtility/blob/master/PS3Guitar.cs
  * Note: The Wii U and PS3 dongles happen to share the same!
@@ -102,6 +110,13 @@ static const char ghl_ps4_magic_data[] = {
 	0x30, 0x02, 0x08, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
+/* Rock Band 3 PS3 Pro Instruments require sending a report
+ * once an instrument is connected to its dongle.
+ * We need to retry sending these reports,
+ * but to avoid doing this too often we delay the retries
+ */
+#define RB3_PRO_INSTRUMENT_POKE_RETRY_INTERVAL 8 /* In seconds */
+
 /* PS/3 Motion controller */
 static const u8 motion_rdesc[] = {
 	0x05, 0x01,         /*  Usage Page (Desktop),               */
@@ -427,20 +442,25 @@ static const unsigned int rb4_absmap[] = {
 	[0x31] = ABS_Y,
 };
 
-static const unsigned int rb4_keymap[] = {
-	[0x1] = BTN_WEST, /* Square */
-	[0x2] = BTN_SOUTH, /* Cross */
-	[0x3] = BTN_EAST, /* Circle */
-	[0x4] = BTN_NORTH, /* Triangle */
-	[0x5] = BTN_TL, /* L1 */
-	[0x6] = BTN_TR, /* R1 */
-	[0x7] = BTN_TL2, /* L2 */
-	[0x8] = BTN_TR2, /* R2 */
-	[0x9] = BTN_SELECT, /* Share */
-	[0xa] = BTN_START, /* Options */
-	[0xb] = BTN_THUMBL, /* L3 */
-	[0xc] = BTN_THUMBR, /* R3 */
-	[0xd] = BTN_MODE, /* PS */
+static const unsigned int ps3_turntable_absmap[] = {
+	[0x32] = ABS_X,
+	[0x35] = ABS_Y,
+};
+
+static const unsigned int instrument_keymap[] = {
+	[0x1] = BTN_WEST,
+	[0x2] = BTN_SOUTH,
+	[0x3] = BTN_EAST,
+	[0x4] = BTN_NORTH,
+	[0x5] = BTN_TL,
+	[0x6] = BTN_TR,
+	[0x7] = BTN_TL2,
+	[0x8] = BTN_TR2,
+	[0x9] = BTN_SELECT,
+	[0xa] = BTN_START,
+	[0xb] = BTN_THUMBL,
+	[0xc] = BTN_THUMBR,
+	[0xd] = BTN_MODE,
 };
 
 static enum power_supply_property sony_battery_props[] = {
@@ -490,6 +510,7 @@ struct motion_output_report_02 {
 #define SIXAXIS_REPORT_0xF2_SIZE 17
 #define SIXAXIS_REPORT_0xF5_SIZE 8
 #define MOTION_REPORT_0x02_SIZE 49
+#define PRO_INSTRUMENT_0x00_SIZE 8
 
 #define SENSOR_SUFFIX " Motion Sensors"
 #define TOUCHPAD_SUFFIX " Touchpad"
@@ -539,6 +560,9 @@ struct sony_sc {
 	/* GH Live */
 	struct urb *ghl_urb;
 	struct timer_list ghl_poke_timer;
+
+	/* Rock Band 3 Pro Instruments */
+	unsigned long rb3_pro_poke_jiffies;
 };
 
 static void sony_set_leds(struct sony_sc *sc);
@@ -610,35 +634,108 @@ static int ghl_init_urb(struct sony_sc *sc, struct usb_device *usbdev,
 	return 0;
 }
 
-static int gh_guitar_mapping(struct hid_device *hdev, struct hid_input *hi,
+
+
+/*
+ * Sending HID_REQ_SET_REPORT enables the full report. Without this
+ * Rock Band 3 Pro instruments only report navigation events
+ */
+static int rb3_pro_instrument_enable_full_report(struct sony_sc *sc)
+{
+	struct hid_device *hdev = sc->hdev;
+	static const u8 report[] = { 0x00, 0xE9, 0x00, 0x89, 0x1B,
+								 0x00, 0x00, 0x00, 0x02, 0x00,
+								 0x00, 0x00, 0x00, 0x00, 0x00,
+								 0x00, 0x00, 0x00, 0x00, 0x00,
+								 0x00, 0x00, 0x80, 0x00, 0x00,
+								 0x00, 0x00, 0x89, 0x00, 0x00,
+								 0x00, 0x00, 0x00, 0xE9, 0x01,
+								 0x00, 0x00, 0x00, 0x00, 0x00,
+								 0x00 };
+	u8 *buf;
+	int ret;
+
+	buf = kmemdup(report, sizeof(report), GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(report),
+				  HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
+
+	kfree(buf);
+
+	return ret;
+}
+
+static int djh_turntable_mapping(struct hid_device *hdev, struct hid_input *hi,
 			  struct hid_field *field, struct hid_usage *usage,
 			  unsigned long **bit, int *max)
 {
 	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR) {
 		unsigned int abs = usage->hid & HID_USAGE;
 
-		if (abs == GUITAR_TILT_USAGE) {
+		if (abs == TURNTABLE_CROSS_FADER_USAGE) {
+			hid_map_usage_clear(hi, usage, bit, max, EV_ABS, ABS_RX);
+			return 1;
+		} else if (abs == TURNTABLE_EFFECTS_KNOB_USAGE) {
 			hid_map_usage_clear(hi, usage, bit, max, EV_ABS, ABS_RY);
 			return 1;
+		} else if (abs == TURNTABLE_PLATTER_BUTTONS_USAGE) {
+			hid_map_usage_clear(hi, usage, bit, max, EV_ABS, ABS_RZ);
+			return 1;
 		}
+	} else if ((usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK) {
+		unsigned int abs = usage->hid & HID_USAGE;
+
+		if (abs >= ARRAY_SIZE(ps3_turntable_absmap))
+			return -1;
+
+		abs = ps3_turntable_absmap[abs];
+
+		hid_map_usage_clear(hi, usage, bit, max, EV_ABS, abs);
+		return 1;
 	}
 	return 0;
 }
 
-static int rb4_guitar_mapping(struct hid_device *hdev, struct hid_input *hi,
+static int instrument_mapping(struct hid_device *hdev, struct hid_input *hi,
 			  struct hid_field *field, struct hid_usage *usage,
 			  unsigned long **bit, int *max)
 {
 	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
 		unsigned int key = usage->hid & HID_USAGE;
 
-		if (key >= ARRAY_SIZE(rb4_keymap))
+		if (key >= ARRAY_SIZE(instrument_keymap))
 			return 0;
 
-		key = rb4_keymap[key];
+		key = instrument_keymap[key];
 		hid_map_usage_clear(hi, usage, bit, max, EV_KEY, key);
 		return 1;
-	} else if ((usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK) {
+	}
+
+	return 0;
+}
+
+static int gh_guitar_mapping(struct hid_device *hdev, struct hid_input *hi,
+			  struct hid_field *field, struct hid_usage *usage,
+			  unsigned long **bit, int *max)
+{
+	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR) {
+		unsigned int abs = usage->hid & HID_USAGE;
+
+		if (abs == GUITAR_TILT_USAGE) {
+			hid_map_usage_clear(hi, usage, bit, max, EV_ABS, ABS_RY);
+			return 1;
+		}
+	}
+	return 0;
+}
+
+static int rb4_guitar_mapping(struct hid_device *hdev, struct hid_input *hi,
+			  struct hid_field *field, struct hid_usage *usage,
+			  unsigned long **bit, int *max)
+{
+	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK) {
 		unsigned int abs = usage->hid & HID_USAGE;
 
 		/* Let the HID parser deal with the HAT. */
@@ -1052,6 +1149,18 @@ static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
 		return 1;
 	}
 
+	/* Rock Band 3 PS3 Pro instruments set rd[24] to 0xE0 when they're
+	 * sending full reports, and 0x02 when only sending navigation.
+	 */
+	if ((sc->quirks & RB3_PS3_PRO_INSTRUMENT) && rd[24] == 0x02) {
+		/* Only attempt to enable report every 8 seconds */
+		if (time_after(jiffies, sc->rb3_pro_poke_jiffies)) {
+			sc->rb3_pro_poke_jiffies = jiffies +
+				(RB3_PRO_INSTRUMENT_POKE_RETRY_INTERVAL * HZ);
+			rb3_pro_instrument_enable_full_report(sc);
+		}
+	}
+
 	if (sc->defer_initialization) {
 		sc->defer_initialization = 0;
 		sony_schedule_work(sc, SONY_WORKER_STATE);
@@ -1065,6 +1174,7 @@ static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
 			unsigned long **bit, int *max)
 {
 	struct sony_sc *sc = hid_get_drvdata(hdev);
+	int ret;
 
 	if (sc->quirks & BUZZ_CONTROLLER) {
 		unsigned int key = usage->hid & HID_USAGE;
@@ -1098,9 +1208,19 @@ static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
 	if (sc->quirks & SIXAXIS_CONTROLLER)
 		return sixaxis_mapping(hdev, hi, field, usage, bit, max);
 
-	if (sc->quirks & GH_GUITAR_CONTROLLER)
+	/* INSTRUMENT quirk is used as a base mapping for instruments */
+	if (sc->quirks & INSTRUMENT) {
+		ret = instrument_mapping(hdev, hi, field, usage, bit, max);
+		if (ret != 0)
+			return ret;
+	}
+
+	if (sc->quirks & GH_GUITAR_TILT)
 		return gh_guitar_mapping(hdev, hi, field, usage, bit, max);
 
+	if (sc->quirks & PS3_DJH_TURNTABLE)
+		return djh_turntable_mapping(hdev, hi, field, usage, bit, max);
+
 	if (sc->quirks & (RB4_GUITAR_PS4_USB | RB4_GUITAR_PS4_BT))
 		return rb4_guitar_mapping(hdev, hi, field, usage, bit, max);
 
@@ -2060,6 +2180,19 @@ static int sony_input_configured(struct hid_device *hdev,
 		}
 
 		sony_init_output_report(sc, sixaxis_send_output_report);
+	} else if (sc->quirks & RB3_PS3_PRO_INSTRUMENT) {
+		/*
+		 * Rock Band 3 PS3 Pro Instruments also do not handle HID Output
+		 * Reports on the interrupt EP like they should, so we need to force
+		 * HID output reports to use HID_REQ_SET_REPORT on the Control EP.
+		 *
+		 * There is also another issue about HID Output Reports via USB,
+		 * these instruments do not want the report_id as part of the data
+		 * packet, so we have to discard buf[0] when sending the actual
+		 * control message, even for numbered reports.
+		 */
+		hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP;
+		hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID;
 	} else if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
 		/*
 		 * The Sony Sixaxis does not handle HID Output Reports on the
@@ -2227,6 +2360,10 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		goto err;
 	}
 
+	if (sc->quirks & RB3_PS3_PRO_INSTRUMENT) {
+		sc->rb3_pro_poke_jiffies = 0;
+	}
+
 	if (sc->quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4)) {
 		if (!hid_is_usb(hdev)) {
 			ret = -EINVAL;
@@ -2364,35 +2501,82 @@ static const struct hid_device_id sony_devices[] = {
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SMK, USB_DEVICE_ID_SMK_NSG_MR7U_REMOTE),
 		.driver_data = NSG_MR7U_REMOTE_BT },
 	/* Guitar Hero Live PS3 and Wii U guitar dongles */
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE_DONGLE),
-		.driver_data = GHL_GUITAR_PS3WIIU | GH_GUITAR_CONTROLLER },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE),
+		.driver_data = GHL_GUITAR_PS3WIIU | GH_GUITAR_TILT | INSTRUMENT },
 	/* Guitar Hero PC Guitar Dongle */
 	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE, USB_DEVICE_ID_REDOCTANE_GUITAR_DONGLE),
-		.driver_data = GH_GUITAR_CONTROLLER },
-	/* Guitar Hero PS3 World Tour Guitar Dongle */
-	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_GUITAR_DONGLE),
-		.driver_data = GH_GUITAR_CONTROLLER },
+		.driver_data = GH_GUITAR_TILT | INSTRUMENT },
+	/* Guitar Hero PS3 Guitar Dongle */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_GH_GUITAR),
+		.driver_data = GH_GUITAR_TILT | INSTRUMENT },
+	/* Guitar Hero PS3 Drum Dongle */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_GH_DRUMS),
+		.driver_data = INSTRUMENT },
+	/* DJ Hero PS3 Guitar Dongle */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_DJH_TURNTABLE),
+		.driver_data = PS3_DJH_TURNTABLE | INSTRUMENT },
 	/* Guitar Hero Live PS4 guitar dongles */
 	{ HID_USB_DEVICE(USB_VENDOR_ID_REDOCTANE, USB_DEVICE_ID_REDOCTANE_PS4_GHLIVE_DONGLE),
-		.driver_data = GHL_GUITAR_PS4 | GH_GUITAR_CONTROLLER },
+		.driver_data = GHL_GUITAR_PS4 | GH_GUITAR_TILT | INSTRUMENT },
+	/* Rock Band 1 Wii instruments */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB1_GUITAR),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB1_DRUMS),
+		.driver_data = INSTRUMENT },
+	/* Rock Band 2 Wii instruments */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB2_GUITAR),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB2_DRUMS),
+		.driver_data = INSTRUMENT },
+	/* Rock Band 3 Wii instruments */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_DRUMS_MODE),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB3_MUSTANG_GUITAR),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_MUSTANG_MODE),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_SQUIER_MODE),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB3_KEYBOARD),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HARMONIX, USB_DEVICE_ID_HARMONIX_WII_RB3_MPA_KEYBOARD_MODE),
+		.driver_data = INSTRUMENT },
+	/* Rock Band 3 PS3 instruments */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB_GUITAR),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB_DRUMS),
+		.driver_data = INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB3_MPA_DRUMS_MODE),
+		.driver_data = INSTRUMENT },
+	/* Rock Band 3 PS3 Pro instruments */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB3_MUSTANG_GUITAR),
+		.driver_data = INSTRUMENT | RB3_PS3_PRO_INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB3_MPA_MUSTANG_MODE),
+		.driver_data = INSTRUMENT | RB3_PS3_PRO_INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB3_MPA_SQUIER_MODE),
+		.driver_data = INSTRUMENT | RB3_PS3_PRO_INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB3_KEYBOARD),
+		.driver_data = INSTRUMENT | RB3_PS3_PRO_INSTRUMENT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_RB3_MPA_KEYBOARD_MODE),
+		.driver_data = INSTRUMENT | RB3_PS3_PRO_INSTRUMENT },
 	/* Rock Band 4 PS4 guitars */
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS4_RIFFMASTER),
-		.driver_data = RB4_GUITAR_PS4_USB },
+		.driver_data = RB4_GUITAR_PS4_USB | INSTRUMENT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS4_GIBSON_SG),
-		.driver_data = RB4_GUITAR_PS4_USB },
+		.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 },
+		.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 },
+		.driver_data = RB4_GUITAR_PS4_BT | INSTRUMENT },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_PS4_STRATOCASTER),
-		.driver_data = RB4_GUITAR_PS4_BT },
+		.driver_data = RB4_GUITAR_PS4_BT | INSTRUMENT },
 	/* Rock Band 4 PS5 guitars */
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PDP, USB_DEVICE_ID_PDP_PS5_RIFFMASTER),
-		.driver_data = RB4_GUITAR_PS5 },
+		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CRKD, USB_DEVICE_ID_CRKD_PS5_GIBSON_SG),
-		.driver_data = RB4_GUITAR_PS5 },
+		.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 },
+		.driver_data = RB4_GUITAR_PS5 | INSTRUMENT },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, sony_devices);
@@ -2428,5 +2612,5 @@ static void __exit sony_exit(void)
 module_init(sony_init);
 module_exit(sony_exit);
 
-MODULE_DESCRIPTION("HID driver for Sony / PS2 / PS3 / PS4 BD devices");
+MODULE_DESCRIPTION("HID driver for Sony / PS2 / PS3 / PS4 / PS5 BD devices");
 MODULE_LICENSE("GPL");
-- 
2.53.0


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

* Re: [PATCH v2] HID: sony: add support for more instruments
  2026-04-07 19:46 [PATCH v2] HID: sony: add support for more instruments Rosalie Wanders
@ 2026-04-08 20:41 ` Jiri Kosina
  2026-04-08 22:01   ` Rosalie
  0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2026-04-08 20:41 UTC (permalink / raw)
  To: Rosalie Wanders
  Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

On Tue, 7 Apr 2026, Rosalie Wanders wrote:

> This patch adds support for the following instruments:
> 
> * Rock Band 1/2/3 Wii/PS3 instruments
> * Rock Band 3 PS3 Pro instruments
> * DJ Hero Turntable
> 
> Wii and PS3 instruments are the same besides the vendor and product ID.
> 
> This patch also fixes the mappings for the existing Guitar Hero
> instruments.
> 
> Co-developed-by: Sanjay Govind <sanjay.govind9@gmail.com>
> Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
> Co-developed-by: Brenton Simpson <appsforartists@google.com>
> Signed-off-by: Brenton Simpson <appsforartists@google.com>
> Signed-off-by: Rosalie Wanders <rosalie@mailbox.org>
> ---
> changes:
> v2: correct squier device name and remove non-existent squier usb device

Rosalie,

as v1 is already sitting in hid.git#for-7.1/sony for some time, could you 
please send this as a followup fix instead? 

Thanks,

-- 
Jiri Kosina
SUSE Labs


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

* Re: [PATCH v2] HID: sony: add support for more instruments
  2026-04-08 20:41 ` Jiri Kosina
@ 2026-04-08 22:01   ` Rosalie
  2026-04-08 22:08     ` Jiri Kosina
  0 siblings, 1 reply; 8+ messages in thread
From: Rosalie @ 2026-04-08 22:01 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

Hello,

I've sent 'HID: sony: fix incorrect Squier name and remove non-existent 
device', though I will mention you didn't apply 'HID: quirks: update 
hid-sony supported devices' cleanly because it duplicated the vendor and 
device ID defines in hid-ids.h for the Wii instruments so it will not 
compile, I'd advise you apply the patches in the following order to 
prevent issues:

1) v1 of 'HID: sony: add support for more instruments'
2) 'HID: sony: fix incorrect Squier name and remove non-existent device'
3) v2 of 'HID: quirks: update hid-sony supported devices' but without 
changing hid-ids.h
4) v2 of 'HID: sony: fix style issues' (if you want this patch to be 
included that is)

alternatively you could also do:

1) v2 of 'HID: sony: add support for more instruments'
2) v2 of 'HID: quirks: update hid-sony supported devices'
3) v2 of 'HID: sony: fix style issues'

I hope this doesn't cause too much hassle,
Rosalie

On 4/8/26 22:41, Jiri Kosina wrote:
> On Tue, 7 Apr 2026, Rosalie Wanders wrote:
> 
>> This patch adds support for the following instruments:
>>
>> * Rock Band 1/2/3 Wii/PS3 instruments
>> * Rock Band 3 PS3 Pro instruments
>> * DJ Hero Turntable
>>
>> Wii and PS3 instruments are the same besides the vendor and product ID.
>>
>> This patch also fixes the mappings for the existing Guitar Hero
>> instruments.
>>
>> Co-developed-by: Sanjay Govind <sanjay.govind9@gmail.com>
>> Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
>> Co-developed-by: Brenton Simpson <appsforartists@google.com>
>> Signed-off-by: Brenton Simpson <appsforartists@google.com>
>> Signed-off-by: Rosalie Wanders <rosalie@mailbox.org>
>> ---
>> changes:
>> v2: correct squier device name and remove non-existent squier usb device
> 
> Rosalie,
> 
> as v1 is already sitting in hid.git#for-7.1/sony for some time, could you
> please send this as a followup fix instead?
> 
> Thanks,
> 


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

* Re: [PATCH v2] HID: sony: add support for more instruments
  2026-04-08 22:01   ` Rosalie
@ 2026-04-08 22:08     ` Jiri Kosina
  2026-04-08 22:12       ` Rosalie
  0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2026-04-08 22:08 UTC (permalink / raw)
  To: Rosalie
  Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

On Thu, 9 Apr 2026, Rosalie wrote:

> Hello,
> 
> I've sent 'HID: sony: fix incorrect Squier name and remove non-existent
> device', though I will mention you didn't apply 'HID: quirks: update hid-sony
> supported devices' cleanly because it duplicated the vendor and device ID
> defines in hid-ids.h for the Wii instruments so it will not compile, I'd
> advise you apply the patches in the following order to prevent issues:
> 
> 1) v1 of 'HID: sony: add support for more instruments'
> 2) 'HID: sony: fix incorrect Squier name and remove non-existent device'
> 3) v2 of 'HID: quirks: update hid-sony supported devices' but without changing
> hid-ids.h
> 4) v2 of 'HID: sony: fix style issues' (if you want this patch to be included
> that is)
> 
> alternatively you could also do:
> 
> 1) v2 of 'HID: sony: add support for more instruments'
> 2) v2 of 'HID: quirks: update hid-sony supported devices'
> 3) v2 of 'HID: sony: fix style issues'
> 
> I hope this doesn't cause too much hassle,

Thanks, I will look into it. But going forward, you really should either 
send this as series, or clearly mark the dependencies. Sending it as a 
followup fix in the same thread also works.

Or, even better, send a pull request against a git branch if the 
interdependencies are tricky.

Imagine you're getting higher tens of patches a day (including e.g. quite 
often v1->v5 within a timeframe of a few hours), and you are somehow 
magically expected to untangle all this.

Thanks,

-- 
Jiri Kosina
SUSE Labs


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

* Re: [PATCH v2] HID: sony: add support for more instruments
  2026-04-08 22:08     ` Jiri Kosina
@ 2026-04-08 22:12       ` Rosalie
  2026-04-08 22:19         ` Jiri Kosina
  0 siblings, 1 reply; 8+ messages in thread
From: Rosalie @ 2026-04-08 22:12 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

Hello,

Yes I do apologize, and I'll be mindful of either doing a series, mark 
dependencies clearly or do a pull request.

I didn't expect to be sending this many patches at all in the first 
place, but one minor annoyance of the code bothers me one day and then 
another day someone else mentions that e.g a device name is incorrect, 
so that kinda led to this chaos.

Apologies and I'll try preventing it in the future, and thanks for the 
advice,
Rosalie

On 4/9/26 00:08, Jiri Kosina wrote:
> On Thu, 9 Apr 2026, Rosalie wrote:
> 
>> Hello,
>>
>> I've sent 'HID: sony: fix incorrect Squier name and remove non-existent
>> device', though I will mention you didn't apply 'HID: quirks: update hid-sony
>> supported devices' cleanly because it duplicated the vendor and device ID
>> defines in hid-ids.h for the Wii instruments so it will not compile, I'd
>> advise you apply the patches in the following order to prevent issues:
>>
>> 1) v1 of 'HID: sony: add support for more instruments'
>> 2) 'HID: sony: fix incorrect Squier name and remove non-existent device'
>> 3) v2 of 'HID: quirks: update hid-sony supported devices' but without changing
>> hid-ids.h
>> 4) v2 of 'HID: sony: fix style issues' (if you want this patch to be included
>> that is)
>>
>> alternatively you could also do:
>>
>> 1) v2 of 'HID: sony: add support for more instruments'
>> 2) v2 of 'HID: quirks: update hid-sony supported devices'
>> 3) v2 of 'HID: sony: fix style issues'
>>
>> I hope this doesn't cause too much hassle,
> 
> Thanks, I will look into it. But going forward, you really should either
> send this as series, or clearly mark the dependencies. Sending it as a
> followup fix in the same thread also works.
> 
> Or, even better, send a pull request against a git branch if the
> interdependencies are tricky.
> 
> Imagine you're getting higher tens of patches a day (including e.g. quite
> often v1->v5 within a timeframe of a few hours), and you are somehow
> magically expected to untangle all this.
> 
> Thanks,
> 


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

* Re: [PATCH v2] HID: sony: add support for more instruments
  2026-04-08 22:12       ` Rosalie
@ 2026-04-08 22:19         ` Jiri Kosina
  2026-04-08 22:41           ` Rosalie
  0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2026-04-08 22:19 UTC (permalink / raw)
  To: Rosalie
  Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

On Thu, 9 Apr 2026, Rosalie wrote:

> Yes I do apologize, and I'll be mindful of either doing a series, mark
> dependencies clearly or do a pull request.
> 
> I didn't expect to be sending this many patches at all in the first place, but
> one minor annoyance of the code bothers me one day and then another day
> someone else mentions that e.g a device name is incorrect, so that kinda led
> to this chaos.
> 
> Apologies and I'll try preventing it in the future, and thanks for the advice,

No worries. I've just update hid.git#for-7.1/sony and I believe it's now 
in proper state with all the patch dependencies correctly captured. If you 
see any issue there, please let me know.

Thanks,

-- 
Jiri Kosina
SUSE Labs


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

* Re: [PATCH v2] HID: sony: add support for more instruments
  2026-04-08 22:19         ` Jiri Kosina
@ 2026-04-08 22:41           ` Rosalie
  2026-04-08 22:44             ` Jiri Kosina
  0 siblings, 1 reply; 8+ messages in thread
From: Rosalie @ 2026-04-08 22:41 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

On 4/9/26 00:19, Jiri Kosina wrote:
> On Thu, 9 Apr 2026, Rosalie wrote:
> 
>> Yes I do apologize, and I'll be mindful of either doing a series, mark
>> dependencies clearly or do a pull request.
>>
>> I didn't expect to be sending this many patches at all in the first place, but
>> one minor annoyance of the code bothers me one day and then another day
>> someone else mentions that e.g a device name is incorrect, so that kinda led
>> to this chaos.
>>
>> Apologies and I'll try preventing it in the future, and thanks for the advice,
> 
> No worries. I've just update hid.git#for-7.1/sony and I believe it's now
> in proper state with all the patch dependencies correctly captured. If you
> see any issue there, please let me know.
> 
> Thanks,
> 

It looks fine to me code wise, and it compiles! but you forgot to apply 
a patch you applied earlier to the for-7.1/sony branch, namely 'HID: 
sony: update module description'

Other than that, it's fine, and again I apologize for the chaos,
Rosalie


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

* Re: [PATCH v2] HID: sony: add support for more instruments
  2026-04-08 22:41           ` Rosalie
@ 2026-04-08 22:44             ` Jiri Kosina
  0 siblings, 0 replies; 8+ messages in thread
From: Jiri Kosina @ 2026-04-08 22:44 UTC (permalink / raw)
  To: Rosalie
  Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
	linux-kernel

On Thu, 9 Apr 2026, Rosalie wrote:

> It looks fine to me code wise, and it compiles! but you forgot to apply a
> patch you applied earlier to the for-7.1/sony branch, namely 'HID: sony:
> update module description'

Thanks for checking.

Yes, I am aware of that one missing for now, it's in the queue for next 
time.

> Other than that, it's fine, and again I apologize for the chaos,

Np. Thanks,

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2026-04-08 22:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 19:46 [PATCH v2] HID: sony: add support for more instruments Rosalie Wanders
2026-04-08 20:41 ` Jiri Kosina
2026-04-08 22:01   ` Rosalie
2026-04-08 22:08     ` Jiri Kosina
2026-04-08 22:12       ` Rosalie
2026-04-08 22:19         ` Jiri Kosina
2026-04-08 22:41           ` Rosalie
2026-04-08 22:44             ` Jiri Kosina

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