diff options
Diffstat (limited to 'sound/drivers/pcsp/pcsp_mixer.c')
-rw-r--r-- | sound/drivers/pcsp/pcsp_mixer.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/sound/drivers/pcsp/pcsp_mixer.c b/sound/drivers/pcsp/pcsp_mixer.c index 903bc846763f..6f633f4f3b96 100644 --- a/sound/drivers/pcsp/pcsp_mixer.c +++ b/sound/drivers/pcsp/pcsp_mixer.c | |||
@@ -119,24 +119,43 @@ static int pcsp_pcspkr_put(struct snd_kcontrol *kcontrol, | |||
119 | .put = pcsp_##ctl_type##_put, \ | 119 | .put = pcsp_##ctl_type##_put, \ |
120 | } | 120 | } |
121 | 121 | ||
122 | static struct snd_kcontrol_new __devinitdata snd_pcsp_controls[] = { | 122 | static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_pcm[] = { |
123 | PCSP_MIXER_CONTROL(enable, "Master Playback Switch"), | 123 | PCSP_MIXER_CONTROL(enable, "Master Playback Switch"), |
124 | PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"), | 124 | PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"), |
125 | PCSP_MIXER_CONTROL(pcspkr, "PC Speaker Playback Switch"), | ||
126 | }; | 125 | }; |
127 | 126 | ||
128 | int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip) | 127 | static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_spkr[] = { |
128 | PCSP_MIXER_CONTROL(pcspkr, "Beep Playback Switch"), | ||
129 | }; | ||
130 | |||
131 | static int __devinit snd_pcsp_ctls_add(struct snd_pcsp *chip, | ||
132 | struct snd_kcontrol_new *ctls, int num) | ||
129 | { | 133 | { |
130 | struct snd_card *card = chip->card; | ||
131 | int i, err; | 134 | int i, err; |
135 | struct snd_card *card = chip->card; | ||
136 | for (i = 0; i < num; i++) { | ||
137 | err = snd_ctl_add(card, snd_ctl_new1(ctls + i, chip)); | ||
138 | if (err < 0) | ||
139 | return err; | ||
140 | } | ||
141 | return 0; | ||
142 | } | ||
143 | |||
144 | int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm) | ||
145 | { | ||
146 | int err; | ||
147 | struct snd_card *card = chip->card; | ||
132 | 148 | ||
133 | for (i = 0; i < ARRAY_SIZE(snd_pcsp_controls); i++) { | 149 | if (!nopcm) { |
134 | err = snd_ctl_add(card, | 150 | err = snd_pcsp_ctls_add(chip, snd_pcsp_controls_pcm, |
135 | snd_ctl_new1(snd_pcsp_controls + i, | 151 | ARRAY_SIZE(snd_pcsp_controls_pcm)); |
136 | chip)); | ||
137 | if (err < 0) | 152 | if (err < 0) |
138 | return err; | 153 | return err; |
139 | } | 154 | } |
155 | err = snd_pcsp_ctls_add(chip, snd_pcsp_controls_spkr, | ||
156 | ARRAY_SIZE(snd_pcsp_controls_spkr)); | ||
157 | if (err < 0) | ||
158 | return err; | ||
140 | 159 | ||
141 | strcpy(card->mixername, "PC-Speaker"); | 160 | strcpy(card->mixername, "PC-Speaker"); |
142 | 161 | ||