xref: /openbmc/linux/sound/pci/au88x0/au88x0_mixer.c (revision fa2eb005ebcbac89745a1f9a9f0c8678ba63f61a)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  * Vortex Mixer support.
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  * There is much more than just the AC97 mixer...
51da177e4SLinus Torvalds  *
61da177e4SLinus Torvalds  */
71da177e4SLinus Torvalds 
81da177e4SLinus Torvalds #include <linux/time.h>
91da177e4SLinus Torvalds #include <linux/init.h>
101da177e4SLinus Torvalds #include <sound/core.h>
111da177e4SLinus Torvalds #include "au88x0.h"
121da177e4SLinus Torvalds 
131da177e4SLinus Torvalds static int __devinit snd_vortex_mixer(vortex_t * vortex)
141da177e4SLinus Torvalds {
152fd16874STakashi Iwai 	struct snd_ac97_bus *pbus;
162fd16874STakashi Iwai 	struct snd_ac97_template ac97;
171da177e4SLinus Torvalds 	int err;
182fd16874STakashi Iwai 	static struct snd_ac97_bus_ops ops = {
191da177e4SLinus Torvalds 		.write = vortex_codec_write,
201da177e4SLinus Torvalds 		.read = vortex_codec_read,
211da177e4SLinus Torvalds 	};
221da177e4SLinus Torvalds 
231da177e4SLinus Torvalds 	if ((err = snd_ac97_bus(vortex->card, 0, &ops, NULL, &pbus)) < 0)
241da177e4SLinus Torvalds 		return err;
251da177e4SLinus Torvalds 	memset(&ac97, 0, sizeof(ac97));
26*fa2eb005SAndrea Gelmini 	// Initialize AC97 codec stuff.
271da177e4SLinus Torvalds 	ac97.private_data = vortex;
281da177e4SLinus Torvalds 	ac97.scaps = AC97_SCAP_NO_SPDIF;
291da177e4SLinus Torvalds 	err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
301da177e4SLinus Torvalds 	vortex->isquad = ((vortex->codec == NULL) ?  0 : (vortex->codec->ext_id&0x80));
311da177e4SLinus Torvalds 	return err;
321da177e4SLinus Torvalds }
33