diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 72 |
1 files changed, 18 insertions, 54 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 9cb14b42dfff..7143393927da 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -82,6 +82,7 @@ struct ad198x_spec { | |||
82 | unsigned int inv_jack_detect: 1;/* inverted jack-detection */ | 82 | unsigned int inv_jack_detect: 1;/* inverted jack-detection */ |
83 | unsigned int inv_eapd: 1; /* inverted EAPD implementation */ | 83 | unsigned int inv_eapd: 1; /* inverted EAPD implementation */ |
84 | unsigned int analog_beep: 1; /* analog beep input present */ | 84 | unsigned int analog_beep: 1; /* analog beep input present */ |
85 | unsigned int avoid_init_slave_vol:1; | ||
85 | 86 | ||
86 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 87 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
87 | struct hda_loopback_check loopback; | 88 | struct hda_loopback_check loopback; |
@@ -137,51 +138,17 @@ static int ad198x_init(struct hda_codec *codec) | |||
137 | return 0; | 138 | return 0; |
138 | } | 139 | } |
139 | 140 | ||
140 | static const char * const ad_slave_vols[] = { | 141 | static const char * const ad_slave_pfxs[] = { |
141 | "Front Playback Volume", | 142 | "Front", "Surround", "Center", "LFE", "Side", |
142 | "Surround Playback Volume", | 143 | "Headphone", "Mono", "Speaker", "IEC958", |
143 | "Center Playback Volume", | ||
144 | "LFE Playback Volume", | ||
145 | "Side Playback Volume", | ||
146 | "Headphone Playback Volume", | ||
147 | "Mono Playback Volume", | ||
148 | "Speaker Playback Volume", | ||
149 | "IEC958 Playback Volume", | ||
150 | NULL | 144 | NULL |
151 | }; | 145 | }; |
152 | 146 | ||
153 | static const char * const ad_slave_sws[] = { | 147 | static const char * const ad1988_6stack_fp_slave_pfxs[] = { |
154 | "Front Playback Switch", | 148 | "Front", "Surround", "Center", "LFE", "Side", "IEC958", |
155 | "Surround Playback Switch", | ||
156 | "Center Playback Switch", | ||
157 | "LFE Playback Switch", | ||
158 | "Side Playback Switch", | ||
159 | "Headphone Playback Switch", | ||
160 | "Mono Playback Switch", | ||
161 | "Speaker Playback Switch", | ||
162 | "IEC958 Playback Switch", | ||
163 | NULL | 149 | NULL |
164 | }; | 150 | }; |
165 | 151 | ||
166 | static const char * const ad1988_6stack_fp_slave_vols[] = { | ||
167 | "Front Playback Volume", | ||
168 | "Surround Playback Volume", | ||
169 | "Center Playback Volume", | ||
170 | "LFE Playback Volume", | ||
171 | "Side Playback Volume", | ||
172 | "IEC958 Playback Volume", | ||
173 | NULL | ||
174 | }; | ||
175 | |||
176 | static const char * const ad1988_6stack_fp_slave_sws[] = { | ||
177 | "Front Playback Switch", | ||
178 | "Surround Playback Switch", | ||
179 | "Center Playback Switch", | ||
180 | "LFE Playback Switch", | ||
181 | "Side Playback Switch", | ||
182 | "IEC958 Playback Switch", | ||
183 | NULL | ||
184 | }; | ||
185 | static void ad198x_free_kctls(struct hda_codec *codec); | 152 | static void ad198x_free_kctls(struct hda_codec *codec); |
186 | 153 | ||
187 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 154 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
@@ -257,10 +224,12 @@ static int ad198x_build_controls(struct hda_codec *codec) | |||
257 | unsigned int vmaster_tlv[4]; | 224 | unsigned int vmaster_tlv[4]; |
258 | snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid, | 225 | snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid, |
259 | HDA_OUTPUT, vmaster_tlv); | 226 | HDA_OUTPUT, vmaster_tlv); |
260 | err = snd_hda_add_vmaster(codec, "Master Playback Volume", | 227 | err = __snd_hda_add_vmaster(codec, "Master Playback Volume", |
261 | vmaster_tlv, | 228 | vmaster_tlv, |
262 | (spec->slave_vols ? | 229 | (spec->slave_vols ? |
263 | spec->slave_vols : ad_slave_vols)); | 230 | spec->slave_vols : ad_slave_pfxs), |
231 | "Playback Volume", | ||
232 | !spec->avoid_init_slave_vol, NULL); | ||
264 | if (err < 0) | 233 | if (err < 0) |
265 | return err; | 234 | return err; |
266 | } | 235 | } |
@@ -268,7 +237,8 @@ static int ad198x_build_controls(struct hda_codec *codec) | |||
268 | err = snd_hda_add_vmaster(codec, "Master Playback Switch", | 237 | err = snd_hda_add_vmaster(codec, "Master Playback Switch", |
269 | NULL, | 238 | NULL, |
270 | (spec->slave_sws ? | 239 | (spec->slave_sws ? |
271 | spec->slave_sws : ad_slave_sws)); | 240 | spec->slave_sws : ad_slave_pfxs), |
241 | "Playback Switch"); | ||
272 | if (err < 0) | 242 | if (err < 0) |
273 | return err; | 243 | return err; |
274 | } | 244 | } |
@@ -3385,8 +3355,8 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3385 | 3355 | ||
3386 | if (spec->autocfg.hp_pins[0]) { | 3356 | if (spec->autocfg.hp_pins[0]) { |
3387 | spec->mixers[spec->num_mixers++] = ad1988_hp_mixers; | 3357 | spec->mixers[spec->num_mixers++] = ad1988_hp_mixers; |
3388 | spec->slave_vols = ad1988_6stack_fp_slave_vols; | 3358 | spec->slave_vols = ad1988_6stack_fp_slave_pfxs; |
3389 | spec->slave_sws = ad1988_6stack_fp_slave_sws; | 3359 | spec->slave_sws = ad1988_6stack_fp_slave_pfxs; |
3390 | spec->alt_dac_nid = ad1988_alt_dac_nid; | 3360 | spec->alt_dac_nid = ad1988_alt_dac_nid; |
3391 | spec->stream_analog_alt_playback = | 3361 | spec->stream_analog_alt_playback = |
3392 | &ad198x_pcm_analog_alt_playback; | 3362 | &ad198x_pcm_analog_alt_playback; |
@@ -3594,16 +3564,8 @@ static const struct hda_amp_list ad1884_loopbacks[] = { | |||
3594 | #endif | 3564 | #endif |
3595 | 3565 | ||
3596 | static const char * const ad1884_slave_vols[] = { | 3566 | static const char * const ad1884_slave_vols[] = { |
3597 | "PCM Playback Volume", | 3567 | "PCM", "Mic", "Mono", "Front Mic", "Mic", "CD", |
3598 | "Mic Playback Volume", | 3568 | "Internal Mic", "Docking Mic", /* "Beep", */ "IEC958", |
3599 | "Mono Playback Volume", | ||
3600 | "Front Mic Playback Volume", | ||
3601 | "Mic Playback Volume", | ||
3602 | "CD Playback Volume", | ||
3603 | "Internal Mic Playback Volume", | ||
3604 | "Docking Mic Playback Volume", | ||
3605 | /* "Beep Playback Volume", */ | ||
3606 | "IEC958 Playback Volume", | ||
3607 | NULL | 3569 | NULL |
3608 | }; | 3570 | }; |
3609 | 3571 | ||
@@ -3644,6 +3606,8 @@ static int patch_ad1884(struct hda_codec *codec) | |||
3644 | spec->vmaster_nid = 0x04; | 3606 | spec->vmaster_nid = 0x04; |
3645 | /* we need to cover all playback volumes */ | 3607 | /* we need to cover all playback volumes */ |
3646 | spec->slave_vols = ad1884_slave_vols; | 3608 | spec->slave_vols = ad1884_slave_vols; |
3609 | /* slaves may contain input volumes, so we can't raise to 0dB blindly */ | ||
3610 | spec->avoid_init_slave_vol = 1; | ||
3647 | 3611 | ||
3648 | codec->patch_ops = ad198x_patch_ops; | 3612 | codec->patch_ops = ad198x_patch_ops; |
3649 | 3613 | ||