diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-11-16 09:35:59 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-16 09:35:59 -0500 |
commit | 67d634c07afd8f70973d925463e775fdb89ad536 (patch) | |
tree | 21096af1e9253d6143b03fe3049578871059b6b9 /sound | |
parent | 9bb1fe390de3e1def0dd162dbdaf62e0981105fa (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')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 8 |
4 files changed, 24 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e344235da491..2be61b31fb3c 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1959,6 +1959,7 @@ int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, | |||
1959 | } | 1959 | } |
1960 | EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put); | 1960 | EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put); |
1961 | 1961 | ||
1962 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
1962 | /** | 1963 | /** |
1963 | * snd_hda_mixer_amp_switch_put_beep - Put callback for a beep AMP switch | 1964 | * snd_hda_mixer_amp_switch_put_beep - Put callback for a beep AMP switch |
1964 | * | 1965 | * |
@@ -1975,6 +1976,7 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, | |||
1975 | return snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | 1976 | return snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
1976 | } | 1977 | } |
1977 | EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put_beep); | 1978 | EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put_beep); |
1979 | #endif /* CONFIG_SND_HDA_INPUT_BEEP */ | ||
1978 | 1980 | ||
1979 | /* | 1981 | /* |
1980 | * bound volume controls | 1982 | * bound volume controls |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 7c049839ea26..d4a3d0942c00 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -77,6 +77,7 @@ | |||
77 | /* stereo mute switch */ | 77 | /* stereo mute switch */ |
78 | #define HDA_CODEC_MUTE(xname, nid, xindex, direction) \ | 78 | #define HDA_CODEC_MUTE(xname, nid, xindex, direction) \ |
79 | HDA_CODEC_MUTE_MONO(xname, nid, 3, xindex, direction) | 79 | HDA_CODEC_MUTE_MONO(xname, nid, 3, xindex, direction) |
80 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
80 | /* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */ | 81 | /* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */ |
81 | #define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ | 82 | #define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ |
82 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ | 83 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ |
@@ -85,6 +86,11 @@ | |||
85 | .get = snd_hda_mixer_amp_switch_get, \ | 86 | .get = snd_hda_mixer_amp_switch_get, \ |
86 | .put = snd_hda_mixer_amp_switch_put_beep, \ | 87 | .put = snd_hda_mixer_amp_switch_put_beep, \ |
87 | .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } | 88 | .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } |
89 | #else | ||
90 | /* no digital beep - just the standard one */ | ||
91 | #define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, ch, xidx, dir) \ | ||
92 | HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, ch, xidx, dir) | ||
93 | #endif /* CONFIG_SND_HDA_INPUT_BEEP */ | ||
88 | /* special beep mono mute switch */ | 94 | /* special beep mono mute switch */ |
89 | #define HDA_CODEC_MUTE_BEEP_MONO(xname, nid, channel, xindex, direction) \ | 95 | #define HDA_CODEC_MUTE_BEEP_MONO(xname, nid, channel, xindex, direction) \ |
90 | HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, 0, nid, channel, xindex, direction) | 96 | HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, 0, nid, channel, xindex, direction) |
@@ -108,8 +114,10 @@ int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, | |||
108 | struct snd_ctl_elem_value *ucontrol); | 114 | struct snd_ctl_elem_value *ucontrol); |
109 | int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, | 115 | int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, |
110 | struct snd_ctl_elem_value *ucontrol); | 116 | struct snd_ctl_elem_value *ucontrol); |
117 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
111 | int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, | 118 | int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, |
112 | struct snd_ctl_elem_value *ucontrol); | 119 | struct snd_ctl_elem_value *ucontrol); |
120 | #endif | ||
113 | /* lowlevel accessor with caching; use carefully */ | 121 | /* lowlevel accessor with caching; use carefully */ |
114 | int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, | 122 | int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, |
115 | int direction, int index); | 123 | int direction, int index); |
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 | ||
157 | static void ad198x_free_kctls(struct hda_codec *codec); | 157 | static 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 */ |
160 | static struct snd_kcontrol_new ad_beep_mixer[] = { | 161 | static 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 | ||
169 | static int ad198x_build_controls(struct hda_codec *codec) | 173 | static 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")) { |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index eee3143eef75..ef7d21097eeb 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2410,12 +2410,14 @@ static const char *alc_slave_sws[] = { | |||
2410 | 2410 | ||
2411 | static void alc_free_kctls(struct hda_codec *codec); | 2411 | static void alc_free_kctls(struct hda_codec *codec); |
2412 | 2412 | ||
2413 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
2413 | /* additional beep mixers; the actual parameters are overwritten at build */ | 2414 | /* additional beep mixers; the actual parameters are overwritten at build */ |
2414 | static struct snd_kcontrol_new alc_beep_mixer[] = { | 2415 | static struct snd_kcontrol_new alc_beep_mixer[] = { |
2415 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), | 2416 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
2416 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), | 2417 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
2417 | { } /* end */ | 2418 | { } /* end */ |
2418 | }; | 2419 | }; |
2420 | #endif | ||
2419 | 2421 | ||
2420 | static int alc_build_controls(struct hda_codec *codec) | 2422 | static int alc_build_controls(struct hda_codec *codec) |
2421 | { | 2423 | { |
@@ -2452,6 +2454,7 @@ static int alc_build_controls(struct hda_codec *codec) | |||
2452 | return err; | 2454 | return err; |
2453 | } | 2455 | } |
2454 | 2456 | ||
2457 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
2455 | /* create beep controls if needed */ | 2458 | /* create beep controls if needed */ |
2456 | if (spec->beep_amp) { | 2459 | if (spec->beep_amp) { |
2457 | struct snd_kcontrol_new *knew; | 2460 | struct snd_kcontrol_new *knew; |
@@ -2467,6 +2470,7 @@ static int alc_build_controls(struct hda_codec *codec) | |||
2467 | return err; | 2470 | return err; |
2468 | } | 2471 | } |
2469 | } | 2472 | } |
2473 | #endif | ||
2470 | 2474 | ||
2471 | /* if we have no master control, let's create it */ | 2475 | /* if we have no master control, let's create it */ |
2472 | if (!spec->no_analog && | 2476 | if (!spec->no_analog && |
@@ -4780,8 +4784,12 @@ static void set_capture_mixer(struct hda_codec *codec) | |||
4780 | } | 4784 | } |
4781 | } | 4785 | } |
4782 | 4786 | ||
4787 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
4783 | #define set_beep_amp(spec, nid, idx, dir) \ | 4788 | #define set_beep_amp(spec, nid, idx, dir) \ |
4784 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) | 4789 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
4790 | #else | ||
4791 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ | ||
4792 | #endif | ||
4785 | 4793 | ||
4786 | /* | 4794 | /* |
4787 | * OK, here we have finally the patch for ALC880 | 4795 | * OK, here we have finally the patch for ALC880 |