aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2011-05-25 03:09:02 -0400
committerTakashi Iwai <tiwai@suse.de>2011-05-25 03:36:59 -0400
commit014950b013b7966b7e4a3ae6931c75e3c115296f (patch)
tree2b1f0b8f92bec82244e92e2d1c72499875d3ff0c /sound
parent9e38658f703732cb69936553cef4bdb4e5294f3f (diff)
ALSA: usb-audio: add new quirk type QUIRK_AUDIO_STANDARD_MIXER
This quirk type will let the driver assume that there is a standard mixer on a given interface, or that a specific mixer quirks will handle the device. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/quirks.c17
-rw-r--r--sound/usb/usbaudio.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 2546dc808e43..2e969cbb393b 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -264,6 +264,20 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip,
264} 264}
265 265
266/* 266/*
267 * Create a standard mixer for the specified interface.
268 */
269static int create_standard_mixer_quirk(struct snd_usb_audio *chip,
270 struct usb_interface *iface,
271 struct usb_driver *driver,
272 const struct snd_usb_audio_quirk *quirk)
273{
274 if (quirk->ifnum < 0)
275 return 0;
276
277 return snd_usb_create_mixer(chip, quirk->ifnum, 0);
278}
279
280/*
267 * audio-interface quirks 281 * audio-interface quirks
268 * 282 *
269 * returns zero if no standard audio/MIDI parsing is needed. 283 * returns zero if no standard audio/MIDI parsing is needed.
@@ -295,7 +309,8 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
295 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, 309 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
296 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, 310 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
297 [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk, 311 [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk,
298 [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk 312 [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk,
313 [QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk,
299 }; 314 };
300 315
301 if (quirk->type < QUIRK_TYPE_COUNT) { 316 if (quirk->type < QUIRK_TYPE_COUNT) {
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 32f2a97f2f14..1e79986b5777 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -84,6 +84,7 @@ enum quirk_type {
84 QUIRK_AUDIO_FIXED_ENDPOINT, 84 QUIRK_AUDIO_FIXED_ENDPOINT,
85 QUIRK_AUDIO_EDIROL_UAXX, 85 QUIRK_AUDIO_EDIROL_UAXX,
86 QUIRK_AUDIO_ALIGN_TRANSFER, 86 QUIRK_AUDIO_ALIGN_TRANSFER,
87 QUIRK_AUDIO_STANDARD_MIXER,
87 88
88 QUIRK_TYPE_COUNT 89 QUIRK_TYPE_COUNT
89}; 90};