aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-11-16 09:35:59 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-16 09:35:59 -0500
commit67d634c07afd8f70973d925463e775fdb89ad536 (patch)
tree21096af1e9253d6143b03fe3049578871059b6b9 /sound/pci/hda/patch_analog.c
parent9bb1fe390de3e1def0dd162dbdaf62e0981105fa (diff)
ALSA: hda - Fix build errors with CONFIG_SND_HDA_INPUT_BEEP=n
Disable beep-related codes when CONFIG_SND_HDA_INPUT_BEEP isn't set. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index ceb0c603da04..8a1064bdf4c6 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -156,6 +156,7 @@ static const char *ad_slave_sws[] = {
156 156
157static void ad198x_free_kctls(struct hda_codec *codec); 157static void ad198x_free_kctls(struct hda_codec *codec);
158 158
159#ifdef CONFIG_SND_HDA_INPUT_BEEP
159/* additional beep mixers; the actual parameters are overwritten at build */ 160/* additional beep mixers; the actual parameters are overwritten at build */
160static struct snd_kcontrol_new ad_beep_mixer[] = { 161static struct snd_kcontrol_new ad_beep_mixer[] = {
161 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_OUTPUT), 162 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_OUTPUT),
@@ -165,6 +166,9 @@ static struct snd_kcontrol_new ad_beep_mixer[] = {
165 166
166#define set_beep_amp(spec, nid, idx, dir) \ 167#define set_beep_amp(spec, nid, idx, dir) \
167 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir)) /* mono */ 168 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir)) /* mono */
169#else
170#define set_beep_amp(spec, nid, idx, dir) /* NOP */
171#endif
168 172
169static int ad198x_build_controls(struct hda_codec *codec) 173static int ad198x_build_controls(struct hda_codec *codec)
170{ 174{
@@ -194,6 +198,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
194 } 198 }
195 199
196 /* create beep controls if needed */ 200 /* create beep controls if needed */
201#ifdef CONFIG_SND_HDA_INPUT_BEEP
197 if (spec->beep_amp) { 202 if (spec->beep_amp) {
198 struct snd_kcontrol_new *knew; 203 struct snd_kcontrol_new *knew;
199 for (knew = ad_beep_mixer; knew->name; knew++) { 204 for (knew = ad_beep_mixer; knew->name; knew++) {
@@ -209,6 +214,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
209 return err; 214 return err;
210 } 215 }
211 } 216 }
217#endif
212 218
213 /* if we have no master control, let's create it */ 219 /* if we have no master control, let's create it */
214 if (!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) { 220 if (!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {