aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/usb/usbaudio.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 627de9525a32..d32d83d970cc 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3096,6 +3096,32 @@ static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev)
3096} 3096}
3097 3097
3098/* 3098/*
3099 * C-Media CM106/CM106+ have four 16-bit internal registers that are nicely
3100 * documented in the device's data sheet.
3101 */
3102static int snd_usb_cm106_write_int_reg(struct usb_device *dev, int reg, u16 value)
3103{
3104 u8 buf[4];
3105 buf[0] = 0x20;
3106 buf[1] = value & 0xff;
3107 buf[2] = (value >> 8) & 0xff;
3108 buf[3] = reg;
3109 return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION,
3110 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT,
3111 0, 0, &buf, 4, 1000);
3112}
3113
3114static int snd_usb_cm106_boot_quirk(struct usb_device *dev)
3115{
3116 /*
3117 * Enable line-out driver mode, set headphone source to front
3118 * channels, enable stereo mic.
3119 */
3120 return snd_usb_cm106_write_int_reg(dev, 2, 0x8004);
3121}
3122
3123
3124/*
3099 * Setup quirks 3125 * Setup quirks
3100 */ 3126 */
3101#define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */ 3127#define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */
@@ -3365,6 +3391,12 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
3365 goto __err_val; 3391 goto __err_val;
3366 } 3392 }
3367 3393
3394 /* C-Media CM106 / Turtle Beach Audio Advantage Roadie */
3395 if (id == USB_ID(0x10f5, 0x0200)) {
3396 if (snd_usb_cm106_boot_quirk(dev) < 0)
3397 goto __err_val;
3398 }
3399
3368 /* 3400 /*
3369 * found a config. now register to ALSA 3401 * found a config. now register to ALSA
3370 */ 3402 */