summaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 10:10:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 10:10:51 -0700
commit09cefbb605ccb07c65f313253268a634e0dcd283 (patch)
treee7be04bdf5dca8c3e2205f44f06b8f09b99bb025 /sound/usb/mixer.c
parentdc7acbb2518f250050179c8581a972df3b6a24f1 (diff)
parentcf73df1e2975ae8f88e573e5f593761339a65def (diff)
downloadlinux-09cefbb605ccb07c65f313253268a634e0dcd283.tar.gz
linux-09cefbb605ccb07c65f313253268a634e0dcd283.tar.bz2
linux-09cefbb605ccb07c65f313253268a634e0dcd283.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (26 commits) ASoC: Fix power down for widgetless per-card DAPM context case ASoC: wm1250-ev1: Define "WM1250 Output" with SND_SOC_DAPM_OUTPUT ASoC: Remove duplicate linux/delay.h inclusion. ASoC: sam9g20_wm8731: use the proper SYSCKL value ASoC: wm8731: fix wm8731_check_osc() connected condition ALSA: hda - Reorganize controller quriks with bit flags ALSA: hda - Use snd_printd() in snd_hda_parse_pin_def_config() ALSA: core: remove unused variables. ALSA: HDA: Increase MAX_HDMI_PINS ALSA: PCM - Don't check DMA time-out too shortly MAINTAINERS: add FireWire audio maintainer ALSA: usb-audio: more control quirks for M-Audio FastTrack devices ALSA: usb-audio: add new quirk type QUIRK_AUDIO_STANDARD_MIXER ALSA: usb-audio: export snd_usb_feature_unit_ctl ALSA: usb-audio: rework add_control_to_empty() ALSA: usb-audio: move assignment of chip->ctrl_intf ALSA: hda - Use model=auto for Lenovo G555 ALSA: HDA: Unify HDMI hotplug handling. ALSA: hda - Force AD1988_6STACK_DIG for Asus M3N-HT Deluxe ASoC: core - remove superfluous new line. ...
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r--sound/usb/mixer.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index eab06edcc9b7..c22fa76e363a 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -86,16 +86,6 @@ struct mixer_build {
const struct usbmix_selector_map *selector_map;
};
-enum {
- USB_MIXER_BOOLEAN,
- USB_MIXER_INV_BOOLEAN,
- USB_MIXER_S8,
- USB_MIXER_U8,
- USB_MIXER_S16,
- USB_MIXER_U16,
-};
-
-
/*E-mu 0202/0404/0204 eXtension Unit(XU) control*/
enum {
USB_XU_CLOCK_RATE = 0xe301,
@@ -535,20 +525,21 @@ static int check_matrix_bitmap(unsigned char *bmap, int ich, int och, int num_ou
* if failed, give up and free the control instance.
*/
-static int add_control_to_empty(struct mixer_build *state, struct snd_kcontrol *kctl)
+int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer,
+ struct snd_kcontrol *kctl)
{
struct usb_mixer_elem_info *cval = kctl->private_data;
int err;
- while (snd_ctl_find_id(state->chip->card, &kctl->id))
+ while (snd_ctl_find_id(mixer->chip->card, &kctl->id))
kctl->id.index++;
- if ((err = snd_ctl_add(state->chip->card, kctl)) < 0) {
+ if ((err = snd_ctl_add(mixer->chip->card, kctl)) < 0) {
snd_printd(KERN_ERR "cannot add control (err = %d)\n", err);
return err;
}
cval->elem_id = &kctl->id;
- cval->next_id_elem = state->mixer->id_elems[cval->id];
- state->mixer->id_elems[cval->id] = cval;
+ cval->next_id_elem = mixer->id_elems[cval->id];
+ mixer->id_elems[cval->id] = cval;
return 0;
}
@@ -984,6 +975,9 @@ static struct snd_kcontrol_new usb_feature_unit_ctl_ro = {
.put = NULL,
};
+/* This symbol is exported in order to allow the mixer quirks to
+ * hook up to the standard feature unit control mechanism */
+struct snd_kcontrol_new *snd_usb_feature_unit_ctl = &usb_feature_unit_ctl;
/*
* build a feature control
@@ -1176,7 +1170,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
cval->id, kctl->id.name, cval->channels, cval->min, cval->max, cval->res);
- add_control_to_empty(state, kctl);
+ snd_usb_mixer_add_control(state->mixer, kctl);
}
@@ -1340,7 +1334,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state,
snd_printdd(KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n",
cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
- add_control_to_empty(state, kctl);
+ snd_usb_mixer_add_control(state->mixer, kctl);
}
@@ -1641,7 +1635,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw
snd_printdd(KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n",
cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
- if ((err = add_control_to_empty(state, kctl)) < 0)
+ if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0)
return err;
}
return 0;
@@ -1858,7 +1852,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void
snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n",
cval->id, kctl->id.name, desc->bNrInPins);
- if ((err = add_control_to_empty(state, kctl)) < 0)
+ if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0)
return err;
return 0;