Merge tag 'please-pull-misc-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6.git] / sound / pci / au88x0 / au88x0_mixer.c
bloba58298cfe7e04f03ce681b4d73540ef688929b9d
1 /*
2 * Vortex Mixer support.
4 * There is much more than just the AC97 mixer...
6 */
8 #include <linux/time.h>
9 #include <linux/init.h>
10 #include <sound/core.h>
11 #include "au88x0.h"
13 static int remove_ctl(struct snd_card *card, const char *name)
15 struct snd_ctl_elem_id id;
16 memset(&id, 0, sizeof(id));
17 strcpy(id.name, name);
18 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
19 return snd_ctl_remove_id(card, &id);
22 static int snd_vortex_mixer(vortex_t *vortex)
24 struct snd_ac97_bus *pbus;
25 struct snd_ac97_template ac97;
26 int err;
27 static struct snd_ac97_bus_ops ops = {
28 .write = vortex_codec_write,
29 .read = vortex_codec_read,
32 if ((err = snd_ac97_bus(vortex->card, 0, &ops, NULL, &pbus)) < 0)
33 return err;
34 memset(&ac97, 0, sizeof(ac97));
35 // Initialize AC97 codec stuff.
36 ac97.private_data = vortex;
37 ac97.scaps = AC97_SCAP_NO_SPDIF;
38 err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
39 vortex->isquad = ((vortex->codec == NULL) ? 0 : (vortex->codec->ext_id&0x80));
40 remove_ctl(vortex->card, "Master Mono Playback Volume");
41 remove_ctl(vortex->card, "Master Mono Playback Switch");
42 return err;