diff options
author | Daniel Mack <zonque@gmail.com> | 2011-05-25 09:09:02 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-25 09:36:59 +0200 |
commit | 014950b013b7966b7e4a3ae6931c75e3c115296f (patch) | |
tree | 2b1f0b8f92bec82244e92e2d1c72499875d3ff0c /sound | |
parent | 9e38658f703732cb69936553cef4bdb4e5294f3f (diff) | |
download | op-kernel-dev-014950b013b7966b7e4a3ae6931c75e3c115296f.zip op-kernel-dev-014950b013b7966b7e4a3ae6931c75e3c115296f.tar.gz |
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.c | 17 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 2546dc8..2e969cb 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, } /* + * Create a standard mixer for the specified interface. + */ +static int create_standard_mixer_quirk(struct snd_usb_audio *chip, + struct usb_interface *iface, + struct usb_driver *driver, + const struct snd_usb_audio_quirk *quirk) +{ + if (quirk->ifnum < 0) + return 0; + + return snd_usb_create_mixer(chip, quirk->ifnum, 0); +} + +/* * audio-interface quirks * * returns zero if no standard audio/MIDI parsing is needed. @@ -295,7 +309,8 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip, [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk, - [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk + [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk, + [QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk, }; if (quirk->type < QUIRK_TYPE_COUNT) { diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 32f2a97..1e79986 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h @@ -84,6 +84,7 @@ enum quirk_type { QUIRK_AUDIO_FIXED_ENDPOINT, QUIRK_AUDIO_EDIROL_UAXX, QUIRK_AUDIO_ALIGN_TRANSFER, + QUIRK_AUDIO_STANDARD_MIXER, QUIRK_TYPE_COUNT }; |