]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - sound/pci/au88x0/au88x0_mixer.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[mirror_ubuntu-artful-kernel.git] / sound / pci / au88x0 / au88x0_mixer.c
CommitLineData
1da177e4
LT
1/*
2 * Vortex Mixer support.
3 *
4 * There is much more than just the AC97 mixer...
5 *
6 */
7
1da177e4
LT
8#include <linux/time.h>
9#include <linux/init.h>
10#include <sound/core.h>
11#include "au88x0.h"
12
223f18e4
RY
13static int remove_ctl(struct snd_card *card, const char *name)
14{
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);
20}
21
e23e7a14 22static int snd_vortex_mixer(vortex_t *vortex)
1da177e4 23{
2fd16874
TI
24 struct snd_ac97_bus *pbus;
25 struct snd_ac97_template ac97;
1da177e4 26 int err;
2fd16874 27 static struct snd_ac97_bus_ops ops = {
1da177e4
LT
28 .write = vortex_codec_write,
29 .read = vortex_codec_read,
30 };
31
32 if ((err = snd_ac97_bus(vortex->card, 0, &ops, NULL, &pbus)) < 0)
33 return err;
34 memset(&ac97, 0, sizeof(ac97));
fa2eb005 35 // Initialize AC97 codec stuff.
1da177e4
LT
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));
223f18e4
RY
40 remove_ctl(vortex->card, "Master Mono Playback Volume");
41 remove_ctl(vortex->card, "Master Mono Playback Switch");
1da177e4
LT
42 return err;
43}