pcsp_mixer.c (e87a3dd33eab30b4db539500064a9584867e4f2c) | pcsp_mixer.c (bcc2c6b7cb320d10c7fcccd87dce87f4384b4332) |
---|---|
1/* 2 * PC-Speaker driver for Linux 3 * 4 * Mixer implementation. 5 * Copyright (C) 2001-2008 Stas Sergeev 6 */ 7 8#include <sound/core.h> --- 105 unchanged lines hidden (view full) --- 114{ \ 115 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 116 .name = ctl_name, \ 117 .info = pcsp_##ctl_type##_info, \ 118 .get = pcsp_##ctl_type##_get, \ 119 .put = pcsp_##ctl_type##_put, \ 120} 121 | 1/* 2 * PC-Speaker driver for Linux 3 * 4 * Mixer implementation. 5 * Copyright (C) 2001-2008 Stas Sergeev 6 */ 7 8#include <sound/core.h> --- 105 unchanged lines hidden (view full) --- 114{ \ 115 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 116 .name = ctl_name, \ 117 .info = pcsp_##ctl_type##_info, \ 118 .get = pcsp_##ctl_type##_get, \ 119 .put = pcsp_##ctl_type##_put, \ 120} 121 |
122static struct snd_kcontrol_new __devinitdata snd_pcsp_controls[] = { | 122static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_pcm[] = { |
123 PCSP_MIXER_CONTROL(enable, "Master Playback Switch"), 124 PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"), | 123 PCSP_MIXER_CONTROL(enable, "Master Playback Switch"), 124 PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"), |
125}; 126 127static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_spkr[] = { |
|
125 PCSP_MIXER_CONTROL(pcspkr, "PC Speaker Playback Switch"), 126}; 127 | 128 PCSP_MIXER_CONTROL(pcspkr, "PC Speaker Playback Switch"), 129}; 130 |
128int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip) | 131static 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} |
|
132 | 143 |
133 for (i = 0; i < ARRAY_SIZE(snd_pcsp_controls); i++) { 134 err = snd_ctl_add(card, 135 snd_ctl_new1(snd_pcsp_controls + i, 136 chip)); | 144int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm) 145{ 146 int err; 147 struct snd_card *card = chip->card; 148 149 if (!nopcm) { 150 err = snd_pcsp_ctls_add(chip, snd_pcsp_controls_pcm, 151 ARRAY_SIZE(snd_pcsp_controls_pcm)); |
137 if (err < 0) 138 return err; 139 } | 152 if (err < 0) 153 return err; 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 141 strcpy(card->mixername, "PC-Speaker"); 142 143 return 0; 144} | 159 160 strcpy(card->mixername, "PC-Speaker"); 161 162 return 0; 163} |