[PATCH] [UBUNTU:sound/usb/] Add multichannel support for Turtle Beach Roadie

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Tue Oct 10 08:03:06 UTC 2006


From 729b60998c52c0ff98dc9b8615b19dd2ad687617 Mon Sep 17 00:00:00 2001
From: Daniel T. Chen <crimsun at garnish.localdomain>
Date: Tue, 10 Oct 2006 04:00:53 -0400
Subject: [PATCH] [UBUNTU:sound/usb/] Add multichannel support for Turtle Beach Roadie

UpstreamStatus: Added in upstream pci/ac97/ac97_patch.c r1.104

This patch adds 5.1 output mode support at probe time for the
Turtle Beach Roadie, which is otherwise limited to solely 2
channels with the headphone jack. Freely available documentation
exists noting 8-channel output or 6-channel output with the
headphone jack following the front pair, toggled by setting one
of its registers. The 5.1 mode works with Sam's device.

This commit is applicable to both Dapper and Edgy linux-source.

Signed-off-by: Sam Revitch <sam.revitch at gmail.com>
Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>
---
 sound/usb/usbaudio.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 6e74244..d8fd066 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3144,6 +3144,32 @@ static int snd_usb_audigy2nx_boot_quirk(
 }
 
 /*
+ * C-Media CM106/CM106+ have four 16-bit internal registers that are nicely
+ * documented in the device's data sheet.
+ */
+static int snd_usb_cm106_write_int_reg(struct usb_device *dev, int reg, u16 value)
+{
+	u8 buf[4];
+	buf[0] = 0x20;
+	buf[1] = value & 0xff;
+	buf[2] = (value >> 8) & 0xff;
+	buf[3] = reg;
+	return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION,
+			       USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT,
+			       0, 0, &buf, 4, 1000);
+}
+
+static int snd_usb_cm106_boot_quirk(struct usb_device *dev)
+{
+	/*
+	 * Enable line-out driver mode, set headphone source to front
+	 * channels, enable stereo mic.
+	 */
+	return snd_usb_cm106_write_int_reg(dev, 2, 0x8004);
+}
+
+
+/*
  * Setup quirks
  */
 #define AUDIOPHILE_SET			0x01 /* if set, parse device_setup */
@@ -3413,6 +3439,12 @@ static void *snd_usb_audio_probe(struct 
 			goto __err_val;
 	}
 
+	/* C-Media CM106 / Turtle Beach Audio Advantage Roadie */
+	if (id == USB_ID(0x10f5, 0x0200)) {
+		if (snd_usb_cm106_boot_quirk(dev) < 0)
+			goto __err_val;
+	}
+
 	/*
 	 * found a config.  now register to ALSA
 	 */
-- 
1.4.1


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:  0xC88ABDA3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20061010/0bb66a92/attachment.sig>


More information about the kernel-team mailing list