2 * Mixer Interface - AC97 simple abstact module
3 * Copyright (c) 2005 by Jaroslav Kysela <perex@perex.cz>
6 * This library is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <sys/ioctl.h>
29 #include "asoundlib.h"
30 #include "mixer_abst.h"
33 static struct sm_elem_ops simple_ac97_ops;
35 struct melem_sids sids[] = {
42 .sops = &simple_ac97_ops,
46 #define SELECTORS (sizeof(selectors)/sizeof(selectors[0]))
48 struct helem_selector selectors[] = {
50 .iface = SND_CTL_ELEM_IFACE_MIXER,
51 .name = "Master Playback Volume",
54 .purpose = PURPOSE_VOLUME,
55 .caps = SM_CAP_PVOLUME,
58 .iface = SND_CTL_ELEM_IFACE_MIXER,
59 .name = "Master Playback Switch",
62 .purpose = PURPOSE_SWITCH,
63 .caps = SM_CAP_PSWITCH,
67 int alsa_mixer_simple_event(snd_mixer_class_t *class, unsigned int mask,
68 snd_hctl_elem_t *helem, snd_mixer_elem_t *melem)
70 struct bclass_private *priv = snd_mixer_sbasic_get_private(class);
71 return priv->ops.event(class, mask, helem, melem);
74 int alsa_mixer_simple_init(snd_mixer_class_t *class)
76 struct bclass_base_ops *ops;
79 err = mixer_simple_basic_dlopen(class, &ops);
82 err = ops->selreg(class, selectors, SELECTORS);
85 err = ops->sidreg(class, sids, SELECTORS);