diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-01-18 01:44:55 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-01-18 01:44:55 -0500 |
commit | 321051f5daf059e7290aa7d60af55482c8bb896a (patch) | |
tree | 03705bf5ea28fc2f284228a9a621193cc9a5bb66 /sound/pci/hda | |
parent | d9ab344336f74c012f6643ed3d1ad8ca0136de3b (diff) | |
parent | cbbf50b22f9693218f9f0d460432266b04fc960d (diff) |
Merge branch 'fix/hda' into for-linus
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 10 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.c | 7 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 6 | ||||
-rw-r--r-- | sound/pci/hda/hda_proc.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 208 | ||||
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_cmedia.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 14 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 12 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 367 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 89 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 28 |
13 files changed, 497 insertions, 254 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 05e5ec88c2d9..ae5c5d5e4b7c 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2134,10 +2134,10 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
2134 | * This function returns zero if successful or a negative error code. | 2134 | * This function returns zero if successful or a negative error code. |
2135 | */ | 2135 | */ |
2136 | int snd_hda_add_vmaster(struct hda_codec *codec, char *name, | 2136 | int snd_hda_add_vmaster(struct hda_codec *codec, char *name, |
2137 | unsigned int *tlv, const char **slaves) | 2137 | unsigned int *tlv, const char * const *slaves) |
2138 | { | 2138 | { |
2139 | struct snd_kcontrol *kctl; | 2139 | struct snd_kcontrol *kctl; |
2140 | const char **s; | 2140 | const char * const *s; |
2141 | int err; | 2141 | int err; |
2142 | 2142 | ||
2143 | for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++) | 2143 | for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++) |
@@ -3689,7 +3689,7 @@ EXPORT_SYMBOL_HDA(snd_hda_build_pcms); | |||
3689 | * If no entries are matching, the function returns a negative value. | 3689 | * If no entries are matching, the function returns a negative value. |
3690 | */ | 3690 | */ |
3691 | int snd_hda_check_board_config(struct hda_codec *codec, | 3691 | int snd_hda_check_board_config(struct hda_codec *codec, |
3692 | int num_configs, const char **models, | 3692 | int num_configs, const char * const *models, |
3693 | const struct snd_pci_quirk *tbl) | 3693 | const struct snd_pci_quirk *tbl) |
3694 | { | 3694 | { |
3695 | if (codec->modelname && models) { | 3695 | if (codec->modelname && models) { |
@@ -3753,7 +3753,7 @@ EXPORT_SYMBOL_HDA(snd_hda_check_board_config); | |||
3753 | * If no entries are matching, the function returns a negative value. | 3753 | * If no entries are matching, the function returns a negative value. |
3754 | */ | 3754 | */ |
3755 | int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, | 3755 | int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, |
3756 | int num_configs, const char **models, | 3756 | int num_configs, const char * const *models, |
3757 | const struct snd_pci_quirk *tbl) | 3757 | const struct snd_pci_quirk *tbl) |
3758 | { | 3758 | { |
3759 | const struct snd_pci_quirk *q; | 3759 | const struct snd_pci_quirk *q; |
@@ -4690,7 +4690,7 @@ const char *hda_get_input_pin_label(struct hda_codec *codec, hda_nid_t pin, | |||
4690 | int check_location) | 4690 | int check_location) |
4691 | { | 4691 | { |
4692 | unsigned int def_conf; | 4692 | unsigned int def_conf; |
4693 | static const char *mic_names[] = { | 4693 | static const char * const mic_names[] = { |
4694 | "Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic", | 4694 | "Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic", |
4695 | }; | 4695 | }; |
4696 | int attr; | 4696 | int attr; |
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index fb0582f8d725..a63c54d9d767 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -762,7 +762,8 @@ static int check_existing_control(struct hda_codec *codec, const char *type, con | |||
762 | /* | 762 | /* |
763 | * build output mixer controls | 763 | * build output mixer controls |
764 | */ | 764 | */ |
765 | static int create_output_mixers(struct hda_codec *codec, const char **names) | 765 | static int create_output_mixers(struct hda_codec *codec, |
766 | const char * const *names) | ||
766 | { | 767 | { |
767 | struct hda_gspec *spec = codec->spec; | 768 | struct hda_gspec *spec = codec->spec; |
768 | int i, err; | 769 | int i, err; |
@@ -780,8 +781,8 @@ static int create_output_mixers(struct hda_codec *codec, const char **names) | |||
780 | static int build_output_controls(struct hda_codec *codec) | 781 | static int build_output_controls(struct hda_codec *codec) |
781 | { | 782 | { |
782 | struct hda_gspec *spec = codec->spec; | 783 | struct hda_gspec *spec = codec->spec; |
783 | static const char *types_speaker[] = { "Speaker", "Headphone" }; | 784 | static const char * const types_speaker[] = { "Speaker", "Headphone" }; |
784 | static const char *types_line[] = { "Front", "Headphone" }; | 785 | static const char * const types_line[] = { "Front", "Headphone" }; |
785 | 786 | ||
786 | switch (spec->pcm_vol_nodes) { | 787 | switch (spec->pcm_vol_nodes) { |
787 | case 1: | 788 | case 1: |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index d3d18be483e1..2e91a991eb15 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2809,6 +2809,8 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
2809 | #endif | 2809 | #endif |
2810 | /* Vortex86MX */ | 2810 | /* Vortex86MX */ |
2811 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, | 2811 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, |
2812 | /* VMware HDAudio */ | ||
2813 | { PCI_DEVICE(0x15ad, 0x1977), .driver_data = AZX_DRIVER_GENERIC }, | ||
2812 | /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */ | 2814 | /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */ |
2813 | { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID), | 2815 | { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID), |
2814 | .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, | 2816 | .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 46bbefe2e4a9..3ab5e7a303db 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -140,7 +140,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, | |||
140 | struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, | 140 | struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, |
141 | const char *name); | 141 | const char *name); |
142 | int snd_hda_add_vmaster(struct hda_codec *codec, char *name, | 142 | int snd_hda_add_vmaster(struct hda_codec *codec, char *name, |
143 | unsigned int *tlv, const char **slaves); | 143 | unsigned int *tlv, const char * const *slaves); |
144 | int snd_hda_codec_reset(struct hda_codec *codec); | 144 | int snd_hda_codec_reset(struct hda_codec *codec); |
145 | 145 | ||
146 | /* amp value bits */ | 146 | /* amp value bits */ |
@@ -341,10 +341,10 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen); | |||
341 | * Misc | 341 | * Misc |
342 | */ | 342 | */ |
343 | int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, | 343 | int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, |
344 | const char **modelnames, | 344 | const char * const *modelnames, |
345 | const struct snd_pci_quirk *pci_list); | 345 | const struct snd_pci_quirk *pci_list); |
346 | int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, | 346 | int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, |
347 | int num_configs, const char **models, | 347 | int num_configs, const char * const *models, |
348 | const struct snd_pci_quirk *tbl); | 348 | const struct snd_pci_quirk *tbl); |
349 | int snd_hda_add_new_ctls(struct hda_codec *codec, | 349 | int snd_hda_add_new_ctls(struct hda_codec *codec, |
350 | struct snd_kcontrol_new *knew); | 350 | struct snd_kcontrol_new *knew); |
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index f025200f2a62..bfe74c2fb079 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -418,7 +418,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer, | |||
418 | 418 | ||
419 | static const char *get_pwr_state(u32 state) | 419 | static const char *get_pwr_state(u32 state) |
420 | { | 420 | { |
421 | static const char *buf[4] = { | 421 | static const char * const buf[4] = { |
422 | "D0", "D1", "D2", "D3" | 422 | "D0", "D1", "D2", "D3" |
423 | }; | 423 | }; |
424 | if (state < 4) | 424 | if (state < 4) |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 46780670162b..8dabab798689 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -46,6 +46,9 @@ struct ad198x_spec { | |||
46 | unsigned int cur_eapd; | 46 | unsigned int cur_eapd; |
47 | unsigned int need_dac_fix; | 47 | unsigned int need_dac_fix; |
48 | 48 | ||
49 | hda_nid_t *alt_dac_nid; | ||
50 | struct hda_pcm_stream *stream_analog_alt_playback; | ||
51 | |||
49 | /* capture */ | 52 | /* capture */ |
50 | unsigned int num_adc_nids; | 53 | unsigned int num_adc_nids; |
51 | hda_nid_t *adc_nids; | 54 | hda_nid_t *adc_nids; |
@@ -81,8 +84,8 @@ struct ad198x_spec { | |||
81 | #endif | 84 | #endif |
82 | /* for virtual master */ | 85 | /* for virtual master */ |
83 | hda_nid_t vmaster_nid; | 86 | hda_nid_t vmaster_nid; |
84 | const char **slave_vols; | 87 | const char * const *slave_vols; |
85 | const char **slave_sws; | 88 | const char * const *slave_sws; |
86 | }; | 89 | }; |
87 | 90 | ||
88 | /* | 91 | /* |
@@ -130,7 +133,7 @@ static int ad198x_init(struct hda_codec *codec) | |||
130 | return 0; | 133 | return 0; |
131 | } | 134 | } |
132 | 135 | ||
133 | static const char *ad_slave_vols[] = { | 136 | static const char * const ad_slave_vols[] = { |
134 | "Front Playback Volume", | 137 | "Front Playback Volume", |
135 | "Surround Playback Volume", | 138 | "Surround Playback Volume", |
136 | "Center Playback Volume", | 139 | "Center Playback Volume", |
@@ -143,7 +146,7 @@ static const char *ad_slave_vols[] = { | |||
143 | NULL | 146 | NULL |
144 | }; | 147 | }; |
145 | 148 | ||
146 | static const char *ad_slave_sws[] = { | 149 | static const char * const ad_slave_sws[] = { |
147 | "Front Playback Switch", | 150 | "Front Playback Switch", |
148 | "Surround Playback Switch", | 151 | "Surround Playback Switch", |
149 | "Center Playback Switch", | 152 | "Center Playback Switch", |
@@ -156,6 +159,25 @@ static const char *ad_slave_sws[] = { | |||
156 | NULL | 159 | NULL |
157 | }; | 160 | }; |
158 | 161 | ||
162 | static const char * const ad1988_6stack_fp_slave_vols[] = { | ||
163 | "Front Playback Volume", | ||
164 | "Surround Playback Volume", | ||
165 | "Center Playback Volume", | ||
166 | "LFE Playback Volume", | ||
167 | "Side Playback Volume", | ||
168 | "IEC958 Playback Volume", | ||
169 | NULL | ||
170 | }; | ||
171 | |||
172 | static const char * const ad1988_6stack_fp_slave_sws[] = { | ||
173 | "Front Playback Switch", | ||
174 | "Surround Playback Switch", | ||
175 | "Center Playback Switch", | ||
176 | "LFE Playback Switch", | ||
177 | "Side Playback Switch", | ||
178 | "IEC958 Playback Switch", | ||
179 | NULL | ||
180 | }; | ||
159 | static void ad198x_free_kctls(struct hda_codec *codec); | 181 | static void ad198x_free_kctls(struct hda_codec *codec); |
160 | 182 | ||
161 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 183 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
@@ -309,6 +331,38 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, | |||
309 | return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); | 331 | return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); |
310 | } | 332 | } |
311 | 333 | ||
334 | static int ad198x_alt_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | ||
335 | struct hda_codec *codec, | ||
336 | unsigned int stream_tag, | ||
337 | unsigned int format, | ||
338 | struct snd_pcm_substream *substream) | ||
339 | { | ||
340 | struct ad198x_spec *spec = codec->spec; | ||
341 | snd_hda_codec_setup_stream(codec, spec->alt_dac_nid[0], stream_tag, | ||
342 | 0, format); | ||
343 | return 0; | ||
344 | } | ||
345 | |||
346 | static int ad198x_alt_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, | ||
347 | struct hda_codec *codec, | ||
348 | struct snd_pcm_substream *substream) | ||
349 | { | ||
350 | struct ad198x_spec *spec = codec->spec; | ||
351 | snd_hda_codec_cleanup_stream(codec, spec->alt_dac_nid[0]); | ||
352 | return 0; | ||
353 | } | ||
354 | |||
355 | static struct hda_pcm_stream ad198x_pcm_analog_alt_playback = { | ||
356 | .substreams = 1, | ||
357 | .channels_min = 2, | ||
358 | .channels_max = 2, | ||
359 | /* NID is set in ad198x_build_pcms */ | ||
360 | .ops = { | ||
361 | .prepare = ad198x_alt_playback_pcm_prepare, | ||
362 | .cleanup = ad198x_alt_playback_pcm_cleanup | ||
363 | }, | ||
364 | }; | ||
365 | |||
312 | /* | 366 | /* |
313 | * Digital out | 367 | * Digital out |
314 | */ | 368 | */ |
@@ -446,6 +500,17 @@ static int ad198x_build_pcms(struct hda_codec *codec) | |||
446 | } | 500 | } |
447 | } | 501 | } |
448 | 502 | ||
503 | if (spec->alt_dac_nid && spec->stream_analog_alt_playback) { | ||
504 | codec->num_pcms++; | ||
505 | info = spec->pcm_rec + 2; | ||
506 | info->name = "AD198x Headphone"; | ||
507 | info->pcm_type = HDA_PCM_TYPE_AUDIO; | ||
508 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = | ||
509 | *spec->stream_analog_alt_playback; | ||
510 | info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = | ||
511 | spec->alt_dac_nid[0]; | ||
512 | } | ||
513 | |||
449 | return 0; | 514 | return 0; |
450 | } | 515 | } |
451 | 516 | ||
@@ -1069,7 +1134,7 @@ enum { | |||
1069 | AD1986A_MODELS | 1134 | AD1986A_MODELS |
1070 | }; | 1135 | }; |
1071 | 1136 | ||
1072 | static const char *ad1986a_models[AD1986A_MODELS] = { | 1137 | static const char * const ad1986a_models[AD1986A_MODELS] = { |
1073 | [AD1986A_6STACK] = "6stack", | 1138 | [AD1986A_6STACK] = "6stack", |
1074 | [AD1986A_3STACK] = "3stack", | 1139 | [AD1986A_3STACK] = "3stack", |
1075 | [AD1986A_LAPTOP] = "laptop", | 1140 | [AD1986A_LAPTOP] = "laptop", |
@@ -1813,7 +1878,7 @@ enum { | |||
1813 | AD1981_MODELS | 1878 | AD1981_MODELS |
1814 | }; | 1879 | }; |
1815 | 1880 | ||
1816 | static const char *ad1981_models[AD1981_MODELS] = { | 1881 | static const char * const ad1981_models[AD1981_MODELS] = { |
1817 | [AD1981_HP] = "hp", | 1882 | [AD1981_HP] = "hp", |
1818 | [AD1981_THINKPAD] = "thinkpad", | 1883 | [AD1981_THINKPAD] = "thinkpad", |
1819 | [AD1981_BASIC] = "basic", | 1884 | [AD1981_BASIC] = "basic", |
@@ -2015,6 +2080,7 @@ static int patch_ad1981(struct hda_codec *codec) | |||
2015 | enum { | 2080 | enum { |
2016 | AD1988_6STACK, | 2081 | AD1988_6STACK, |
2017 | AD1988_6STACK_DIG, | 2082 | AD1988_6STACK_DIG, |
2083 | AD1988_6STACK_DIG_FP, | ||
2018 | AD1988_3STACK, | 2084 | AD1988_3STACK, |
2019 | AD1988_3STACK_DIG, | 2085 | AD1988_3STACK_DIG, |
2020 | AD1988_LAPTOP, | 2086 | AD1988_LAPTOP, |
@@ -2047,6 +2113,10 @@ static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { | |||
2047 | 0x04, 0x05, 0x0a, 0x06 | 2113 | 0x04, 0x05, 0x0a, 0x06 |
2048 | }; | 2114 | }; |
2049 | 2115 | ||
2116 | static hda_nid_t ad1988_alt_dac_nid[1] = { | ||
2117 | 0x03 | ||
2118 | }; | ||
2119 | |||
2050 | static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { | 2120 | static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { |
2051 | 0x04, 0x0a, 0x06 | 2121 | 0x04, 0x0a, 0x06 |
2052 | }; | 2122 | }; |
@@ -2166,6 +2236,35 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { | |||
2166 | { } /* end */ | 2236 | { } /* end */ |
2167 | }; | 2237 | }; |
2168 | 2238 | ||
2239 | static struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = { | ||
2240 | HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), | ||
2241 | |||
2242 | HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), | ||
2243 | HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT), | ||
2244 | HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT), | ||
2245 | HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x27, 2, 2, HDA_INPUT), | ||
2246 | HDA_BIND_MUTE("Side Playback Switch", 0x28, 2, HDA_INPUT), | ||
2247 | HDA_BIND_MUTE("Headphone Playback Switch", 0x22, 2, HDA_INPUT), | ||
2248 | HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT), | ||
2249 | |||
2250 | HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x6, HDA_INPUT), | ||
2251 | HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x6, HDA_INPUT), | ||
2252 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x0, HDA_INPUT), | ||
2253 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x0, HDA_INPUT), | ||
2254 | HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x1, HDA_INPUT), | ||
2255 | HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x1, HDA_INPUT), | ||
2256 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x4, HDA_INPUT), | ||
2257 | HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x4, HDA_INPUT), | ||
2258 | |||
2259 | HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT), | ||
2260 | HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), | ||
2261 | |||
2262 | HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT), | ||
2263 | HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT), | ||
2264 | |||
2265 | { } /* end */ | ||
2266 | }; | ||
2267 | |||
2169 | /* 3-stack mode */ | 2268 | /* 3-stack mode */ |
2170 | static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { | 2269 | static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { |
2171 | HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), | 2270 | HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), |
@@ -2445,6 +2544,68 @@ static struct hda_verb ad1988_6stack_init_verbs[] = { | |||
2445 | { } | 2544 | { } |
2446 | }; | 2545 | }; |
2447 | 2546 | ||
2547 | static struct hda_verb ad1988_6stack_fp_init_verbs[] = { | ||
2548 | /* Front, Surround, CLFE, side DAC; unmute as default */ | ||
2549 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2550 | {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2551 | {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2552 | {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2553 | /* Headphone; unmute as default */ | ||
2554 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2555 | /* Port-A front headphon path */ | ||
2556 | {0x37, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC0:03h */ | ||
2557 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
2558 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
2559 | {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2560 | {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
2561 | /* Port-D line-out path */ | ||
2562 | {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
2563 | {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
2564 | {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2565 | {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
2566 | /* Port-F surround path */ | ||
2567 | {0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
2568 | {0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
2569 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2570 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
2571 | /* Port-G CLFE path */ | ||
2572 | {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
2573 | {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
2574 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2575 | {0x24, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
2576 | /* Port-H side path */ | ||
2577 | {0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
2578 | {0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
2579 | {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2580 | {0x25, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
2581 | /* Mono out path */ | ||
2582 | {0x36, AC_VERB_SET_CONNECT_SEL, 0x1}, /* DAC1:04h */ | ||
2583 | {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
2584 | {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
2585 | {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
2586 | {0x13, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f}, /* unmute, 0dB */ | ||
2587 | /* Port-B front mic-in path */ | ||
2588 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
2589 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | ||
2590 | {0x39, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
2591 | /* Port-C line-in path */ | ||
2592 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
2593 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
2594 | {0x3a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
2595 | {0x33, AC_VERB_SET_CONNECT_SEL, 0x0}, | ||
2596 | /* Port-E mic-in path */ | ||
2597 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
2598 | {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | ||
2599 | {0x3c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
2600 | {0x34, AC_VERB_SET_CONNECT_SEL, 0x0}, | ||
2601 | /* Analog CD Input */ | ||
2602 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
2603 | /* Analog Mix output amp */ | ||
2604 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */ | ||
2605 | |||
2606 | { } | ||
2607 | }; | ||
2608 | |||
2448 | static struct hda_verb ad1988_capture_init_verbs[] = { | 2609 | static struct hda_verb ad1988_capture_init_verbs[] = { |
2449 | /* mute analog mix */ | 2610 | /* mute analog mix */ |
2450 | {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | 2611 | {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, |
@@ -2792,7 +2953,9 @@ static int ad1988_auto_create_multi_out_ctls(struct ad198x_spec *spec, | |||
2792 | const struct auto_pin_cfg *cfg) | 2953 | const struct auto_pin_cfg *cfg) |
2793 | { | 2954 | { |
2794 | char name[32]; | 2955 | char name[32]; |
2795 | static const char *chname[4] = { "Front", "Surround", NULL /*CLFE*/, "Side" }; | 2956 | static const char * const chname[4] = { |
2957 | "Front", "Surround", NULL /*CLFE*/, "Side" | ||
2958 | }; | ||
2796 | hda_nid_t nid; | 2959 | hda_nid_t nid; |
2797 | int i, err; | 2960 | int i, err; |
2798 | 2961 | ||
@@ -3074,13 +3237,13 @@ static int ad1988_auto_init(struct hda_codec *codec) | |||
3074 | return 0; | 3237 | return 0; |
3075 | } | 3238 | } |
3076 | 3239 | ||
3077 | |||
3078 | /* | 3240 | /* |
3079 | */ | 3241 | */ |
3080 | 3242 | ||
3081 | static const char *ad1988_models[AD1988_MODEL_LAST] = { | 3243 | static const char * const ad1988_models[AD1988_MODEL_LAST] = { |
3082 | [AD1988_6STACK] = "6stack", | 3244 | [AD1988_6STACK] = "6stack", |
3083 | [AD1988_6STACK_DIG] = "6stack-dig", | 3245 | [AD1988_6STACK_DIG] = "6stack-dig", |
3246 | [AD1988_6STACK_DIG_FP] = "6stack-dig-fp", | ||
3084 | [AD1988_3STACK] = "3stack", | 3247 | [AD1988_3STACK] = "3stack", |
3085 | [AD1988_3STACK_DIG] = "3stack-dig", | 3248 | [AD1988_3STACK_DIG] = "3stack-dig", |
3086 | [AD1988_LAPTOP] = "laptop", | 3249 | [AD1988_LAPTOP] = "laptop", |
@@ -3140,6 +3303,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3140 | switch (board_config) { | 3303 | switch (board_config) { |
3141 | case AD1988_6STACK: | 3304 | case AD1988_6STACK: |
3142 | case AD1988_6STACK_DIG: | 3305 | case AD1988_6STACK_DIG: |
3306 | case AD1988_6STACK_DIG_FP: | ||
3143 | spec->multiout.max_channels = 8; | 3307 | spec->multiout.max_channels = 8; |
3144 | spec->multiout.num_dacs = 4; | 3308 | spec->multiout.num_dacs = 4; |
3145 | if (is_rev2(codec)) | 3309 | if (is_rev2(codec)) |
@@ -3152,10 +3316,22 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3152 | spec->mixers[0] = ad1988_6stack_mixers1_rev2; | 3316 | spec->mixers[0] = ad1988_6stack_mixers1_rev2; |
3153 | else | 3317 | else |
3154 | spec->mixers[0] = ad1988_6stack_mixers1; | 3318 | spec->mixers[0] = ad1988_6stack_mixers1; |
3155 | spec->mixers[1] = ad1988_6stack_mixers2; | 3319 | if (board_config == AD1988_6STACK_DIG_FP) { |
3320 | spec->mixers[1] = ad1988_6stack_fp_mixers; | ||
3321 | spec->slave_vols = ad1988_6stack_fp_slave_vols; | ||
3322 | spec->slave_sws = ad1988_6stack_fp_slave_sws; | ||
3323 | spec->alt_dac_nid = ad1988_alt_dac_nid; | ||
3324 | spec->stream_analog_alt_playback = | ||
3325 | &ad198x_pcm_analog_alt_playback; | ||
3326 | } else | ||
3327 | spec->mixers[1] = ad1988_6stack_mixers2; | ||
3156 | spec->num_init_verbs = 1; | 3328 | spec->num_init_verbs = 1; |
3157 | spec->init_verbs[0] = ad1988_6stack_init_verbs; | 3329 | if (board_config == AD1988_6STACK_DIG_FP) |
3158 | if (board_config == AD1988_6STACK_DIG) { | 3330 | spec->init_verbs[0] = ad1988_6stack_fp_init_verbs; |
3331 | else | ||
3332 | spec->init_verbs[0] = ad1988_6stack_init_verbs; | ||
3333 | if ((board_config == AD1988_6STACK_DIG) || | ||
3334 | (board_config == AD1988_6STACK_DIG_FP)) { | ||
3159 | spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; | 3335 | spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; |
3160 | spec->dig_in_nid = AD1988_SPDIF_IN; | 3336 | spec->dig_in_nid = AD1988_SPDIF_IN; |
3161 | } | 3337 | } |
@@ -3399,7 +3575,7 @@ static struct hda_amp_list ad1884_loopbacks[] = { | |||
3399 | }; | 3575 | }; |
3400 | #endif | 3576 | #endif |
3401 | 3577 | ||
3402 | static const char *ad1884_slave_vols[] = { | 3578 | static const char * const ad1884_slave_vols[] = { |
3403 | "PCM Playback Volume", | 3579 | "PCM Playback Volume", |
3404 | "Mic Playback Volume", | 3580 | "Mic Playback Volume", |
3405 | "Mono Playback Volume", | 3581 | "Mono Playback Volume", |
@@ -3637,7 +3813,7 @@ enum { | |||
3637 | AD1984_MODELS | 3813 | AD1984_MODELS |
3638 | }; | 3814 | }; |
3639 | 3815 | ||
3640 | static const char *ad1984_models[AD1984_MODELS] = { | 3816 | static const char * const ad1984_models[AD1984_MODELS] = { |
3641 | [AD1984_BASIC] = "basic", | 3817 | [AD1984_BASIC] = "basic", |
3642 | [AD1984_THINKPAD] = "thinkpad", | 3818 | [AD1984_THINKPAD] = "thinkpad", |
3643 | [AD1984_DELL_DESKTOP] = "dell_desktop", | 3819 | [AD1984_DELL_DESKTOP] = "dell_desktop", |
@@ -4308,7 +4484,7 @@ enum { | |||
4308 | AD1884A_MODELS | 4484 | AD1884A_MODELS |
4309 | }; | 4485 | }; |
4310 | 4486 | ||
4311 | static const char *ad1884a_models[AD1884A_MODELS] = { | 4487 | static const char * const ad1884a_models[AD1884A_MODELS] = { |
4312 | [AD1884A_DESKTOP] = "desktop", | 4488 | [AD1884A_DESKTOP] = "desktop", |
4313 | [AD1884A_LAPTOP] = "laptop", | 4489 | [AD1884A_LAPTOP] = "laptop", |
4314 | [AD1884A_MOBILE] = "mobile", | 4490 | [AD1884A_MOBILE] = "mobile", |
@@ -4696,7 +4872,7 @@ enum { | |||
4696 | AD1882_MODELS | 4872 | AD1882_MODELS |
4697 | }; | 4873 | }; |
4698 | 4874 | ||
4699 | static const char *ad1882_models[AD1986A_MODELS] = { | 4875 | static const char * const ad1882_models[AD1986A_MODELS] = { |
4700 | [AD1882_3STACK] = "3stack", | 4876 | [AD1882_3STACK] = "3stack", |
4701 | [AD1882_6STACK] = "6stack", | 4877 | [AD1882_6STACK] = "6stack", |
4702 | }; | 4878 | }; |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 18af38ebf757..a07b031090d8 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -490,7 +490,7 @@ static int parse_digital_input(struct hda_codec *codec) | |||
490 | * create mixer controls | 490 | * create mixer controls |
491 | */ | 491 | */ |
492 | 492 | ||
493 | static const char *dir_sfx[2] = { "Playback", "Capture" }; | 493 | static const char * const dir_sfx[2] = { "Playback", "Capture" }; |
494 | 494 | ||
495 | static int add_mute(struct hda_codec *codec, const char *name, int index, | 495 | static int add_mute(struct hda_codec *codec, const char *name, int index, |
496 | unsigned int pval, int dir, struct snd_kcontrol **kctlp) | 496 | unsigned int pval, int dir, struct snd_kcontrol **kctlp) |
@@ -1156,7 +1156,7 @@ static int cs_parse_auto_config(struct hda_codec *codec) | |||
1156 | return 0; | 1156 | return 0; |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static const char *cs420x_models[CS420X_MODELS] = { | 1159 | static const char * const cs420x_models[CS420X_MODELS] = { |
1160 | [CS420X_MBP53] = "mbp53", | 1160 | [CS420X_MBP53] = "mbp53", |
1161 | [CS420X_MBP55] = "mbp55", | 1161 | [CS420X_MBP55] = "mbp55", |
1162 | [CS420X_IMAC27] = "imac27", | 1162 | [CS420X_IMAC27] = "imac27", |
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index ff60908f4554..1f8bbcd0f802 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c | |||
@@ -608,7 +608,7 @@ static void cmi9880_free(struct hda_codec *codec) | |||
608 | /* | 608 | /* |
609 | */ | 609 | */ |
610 | 610 | ||
611 | static const char *cmi9880_models[CMI_MODELS] = { | 611 | static const char * const cmi9880_models[CMI_MODELS] = { |
612 | [CMI_MINIMAL] = "minimal", | 612 | [CMI_MINIMAL] = "minimal", |
613 | [CMI_MIN_FP] = "min_fp", | 613 | [CMI_MIN_FP] = "min_fp", |
614 | [CMI_FULL] = "full", | 614 | [CMI_FULL] = "full", |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index e96581fcdbdb..9bb030a469cd 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -537,13 +537,13 @@ static struct snd_kcontrol_new cxt_beep_mixer[] = { | |||
537 | }; | 537 | }; |
538 | #endif | 538 | #endif |
539 | 539 | ||
540 | static const char *slave_vols[] = { | 540 | static const char * const slave_vols[] = { |
541 | "Headphone Playback Volume", | 541 | "Headphone Playback Volume", |
542 | "Speaker Playback Volume", | 542 | "Speaker Playback Volume", |
543 | NULL | 543 | NULL |
544 | }; | 544 | }; |
545 | 545 | ||
546 | static const char *slave_sws[] = { | 546 | static const char * const slave_sws[] = { |
547 | "Headphone Playback Switch", | 547 | "Headphone Playback Switch", |
548 | "Speaker Playback Switch", | 548 | "Speaker Playback Switch", |
549 | NULL | 549 | NULL |
@@ -1134,7 +1134,7 @@ enum { | |||
1134 | CXT5045_MODELS | 1134 | CXT5045_MODELS |
1135 | }; | 1135 | }; |
1136 | 1136 | ||
1137 | static const char *cxt5045_models[CXT5045_MODELS] = { | 1137 | static const char * const cxt5045_models[CXT5045_MODELS] = { |
1138 | [CXT5045_LAPTOP_HPSENSE] = "laptop-hpsense", | 1138 | [CXT5045_LAPTOP_HPSENSE] = "laptop-hpsense", |
1139 | [CXT5045_LAPTOP_MICSENSE] = "laptop-micsense", | 1139 | [CXT5045_LAPTOP_MICSENSE] = "laptop-micsense", |
1140 | [CXT5045_LAPTOP_HPMICSENSE] = "laptop-hpmicsense", | 1140 | [CXT5045_LAPTOP_HPMICSENSE] = "laptop-hpmicsense", |
@@ -1579,7 +1579,7 @@ enum { | |||
1579 | CXT5047_MODELS | 1579 | CXT5047_MODELS |
1580 | }; | 1580 | }; |
1581 | 1581 | ||
1582 | static const char *cxt5047_models[CXT5047_MODELS] = { | 1582 | static const char * const cxt5047_models[CXT5047_MODELS] = { |
1583 | [CXT5047_LAPTOP] = "laptop", | 1583 | [CXT5047_LAPTOP] = "laptop", |
1584 | [CXT5047_LAPTOP_HP] = "laptop-hp", | 1584 | [CXT5047_LAPTOP_HP] = "laptop-hp", |
1585 | [CXT5047_LAPTOP_EAPD] = "laptop-eapd", | 1585 | [CXT5047_LAPTOP_EAPD] = "laptop-eapd", |
@@ -1995,7 +1995,7 @@ enum { | |||
1995 | CXT5051_MODELS | 1995 | CXT5051_MODELS |
1996 | }; | 1996 | }; |
1997 | 1997 | ||
1998 | static const char *cxt5051_models[CXT5051_MODELS] = { | 1998 | static const char *const cxt5051_models[CXT5051_MODELS] = { |
1999 | [CXT5051_LAPTOP] = "laptop", | 1999 | [CXT5051_LAPTOP] = "laptop", |
2000 | [CXT5051_HP] = "hp", | 2000 | [CXT5051_HP] = "hp", |
2001 | [CXT5051_HP_DV6736] = "hp-dv6736", | 2001 | [CXT5051_HP_DV6736] = "hp-dv6736", |
@@ -3084,7 +3084,7 @@ enum { | |||
3084 | CXT5066_MODELS | 3084 | CXT5066_MODELS |
3085 | }; | 3085 | }; |
3086 | 3086 | ||
3087 | static const char *cxt5066_models[CXT5066_MODELS] = { | 3087 | static const char * const cxt5066_models[CXT5066_MODELS] = { |
3088 | [CXT5066_LAPTOP] = "laptop", | 3088 | [CXT5066_LAPTOP] = "laptop", |
3089 | [CXT5066_DELL_LAPTOP] = "dell-laptop", | 3089 | [CXT5066_DELL_LAPTOP] = "dell-laptop", |
3090 | [CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5", | 3090 | [CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5", |
@@ -3746,7 +3746,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec) | |||
3746 | struct conexant_spec *spec = codec->spec; | 3746 | struct conexant_spec *spec = codec->spec; |
3747 | int i, err; | 3747 | int i, err; |
3748 | int num_line = 0, num_hp = 0, num_spk = 0; | 3748 | int num_line = 0, num_hp = 0, num_spk = 0; |
3749 | static const char *texts[3] = { "Front", "Surround", "CLFE" }; | 3749 | static const char * const texts[3] = { "Front", "Surround", "CLFE" }; |
3750 | 3750 | ||
3751 | if (spec->dac_info_filled == 1) | 3751 | if (spec->dac_info_filled == 1) |
3752 | return cx_auto_add_pb_volume(codec, spec->dac_info[0].dac, | 3752 | return cx_auto_add_pb_volume(codec, spec->dac_info[0].dac, |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index f29b97b5de8f..2d5b83fa8d24 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -817,6 +817,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | |||
817 | struct hdmi_spec *spec = codec->spec; | 817 | struct hdmi_spec *spec = codec->spec; |
818 | struct hdmi_eld *eld; | 818 | struct hdmi_eld *eld; |
819 | struct hda_pcm_stream *codec_pars; | 819 | struct hda_pcm_stream *codec_pars; |
820 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
820 | unsigned int idx; | 821 | unsigned int idx; |
821 | 822 | ||
822 | for (idx = 0; idx < spec->num_cvts; idx++) | 823 | for (idx = 0; idx < spec->num_cvts; idx++) |
@@ -844,6 +845,14 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | |||
844 | hinfo->formats = codec_pars->formats; | 845 | hinfo->formats = codec_pars->formats; |
845 | hinfo->maxbps = codec_pars->maxbps; | 846 | hinfo->maxbps = codec_pars->maxbps; |
846 | } | 847 | } |
848 | /* store the updated parameters */ | ||
849 | runtime->hw.channels_min = hinfo->channels_min; | ||
850 | runtime->hw.channels_max = hinfo->channels_max; | ||
851 | runtime->hw.formats = hinfo->formats; | ||
852 | runtime->hw.rates = hinfo->rates; | ||
853 | |||
854 | snd_pcm_hw_constraint_step(substream->runtime, 0, | ||
855 | SNDRV_PCM_HW_PARAM_CHANNELS, 2); | ||
847 | return 0; | 856 | return 0; |
848 | } | 857 | } |
849 | 858 | ||
@@ -1238,6 +1247,9 @@ static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo, | |||
1238 | snd_pcm_hw_constraint_list(substream->runtime, 0, | 1247 | snd_pcm_hw_constraint_list(substream->runtime, 0, |
1239 | SNDRV_PCM_HW_PARAM_CHANNELS, | 1248 | SNDRV_PCM_HW_PARAM_CHANNELS, |
1240 | hw_constraints_channels); | 1249 | hw_constraints_channels); |
1250 | } else { | ||
1251 | snd_pcm_hw_constraint_step(substream->runtime, 0, | ||
1252 | SNDRV_PCM_HW_PARAM_CHANNELS, 2); | ||
1241 | } | 1253 | } |
1242 | 1254 | ||
1243 | return snd_hda_multi_out_dig_open(codec, &spec->multiout); | 1255 | return snd_hda_multi_out_dig_open(codec, &spec->multiout); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 51c08edd7563..269dbff70b92 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -303,6 +303,8 @@ struct alc_customize_define { | |||
303 | unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ | 303 | unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ |
304 | }; | 304 | }; |
305 | 305 | ||
306 | struct alc_fixup; | ||
307 | |||
306 | struct alc_spec { | 308 | struct alc_spec { |
307 | /* codec parameterization */ | 309 | /* codec parameterization */ |
308 | struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ | 310 | struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ |
@@ -404,6 +406,11 @@ struct alc_spec { | |||
404 | /* for PLL fix */ | 406 | /* for PLL fix */ |
405 | hda_nid_t pll_nid; | 407 | hda_nid_t pll_nid; |
406 | unsigned int pll_coef_idx, pll_coef_bit; | 408 | unsigned int pll_coef_idx, pll_coef_bit; |
409 | |||
410 | /* fix-up list */ | ||
411 | int fixup_id; | ||
412 | const struct alc_fixup *fixup_list; | ||
413 | const char *fixup_name; | ||
407 | }; | 414 | }; |
408 | 415 | ||
409 | /* | 416 | /* |
@@ -1683,88 +1690,131 @@ struct alc_model_fixup { | |||
1683 | }; | 1690 | }; |
1684 | 1691 | ||
1685 | struct alc_fixup { | 1692 | struct alc_fixup { |
1686 | unsigned int sku; | 1693 | int type; |
1687 | const struct alc_pincfg *pins; | 1694 | bool chained; |
1688 | const struct hda_verb *verbs; | 1695 | int chain_id; |
1689 | void (*func)(struct hda_codec *codec, const struct alc_fixup *fix, | 1696 | union { |
1690 | int pre_init); | 1697 | unsigned int sku; |
1698 | const struct alc_pincfg *pins; | ||
1699 | const struct hda_verb *verbs; | ||
1700 | void (*func)(struct hda_codec *codec, | ||
1701 | const struct alc_fixup *fix, | ||
1702 | int action); | ||
1703 | } v; | ||
1691 | }; | 1704 | }; |
1692 | 1705 | ||
1693 | static void __alc_pick_fixup(struct hda_codec *codec, | 1706 | enum { |
1694 | const struct alc_fixup *fix, | 1707 | ALC_FIXUP_INVALID, |
1695 | const char *modelname, | 1708 | ALC_FIXUP_SKU, |
1696 | int pre_init) | 1709 | ALC_FIXUP_PINS, |
1710 | ALC_FIXUP_VERBS, | ||
1711 | ALC_FIXUP_FUNC, | ||
1712 | }; | ||
1713 | |||
1714 | enum { | ||
1715 | ALC_FIXUP_ACT_PRE_PROBE, | ||
1716 | ALC_FIXUP_ACT_PROBE, | ||
1717 | ALC_FIXUP_ACT_INIT, | ||
1718 | }; | ||
1719 | |||
1720 | static void alc_apply_fixup(struct hda_codec *codec, int action) | ||
1697 | { | 1721 | { |
1698 | const struct alc_pincfg *cfg; | 1722 | struct alc_spec *spec = codec->spec; |
1699 | struct alc_spec *spec; | 1723 | int id = spec->fixup_id; |
1724 | const char *modelname = spec->fixup_name; | ||
1725 | int depth = 0; | ||
1700 | 1726 | ||
1701 | cfg = fix->pins; | 1727 | if (!spec->fixup_list) |
1702 | if (pre_init && fix->sku) { | 1728 | return; |
1703 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 1729 | |
1704 | snd_printdd(KERN_INFO "hda_codec: %s: Apply sku override for %s\n", | 1730 | while (id >= 0) { |
1705 | codec->chip_name, modelname); | 1731 | const struct alc_fixup *fix = spec->fixup_list + id; |
1706 | #endif | 1732 | const struct alc_pincfg *cfg; |
1707 | spec = codec->spec; | 1733 | |
1708 | spec->cdefine.sku_cfg = fix->sku; | 1734 | switch (fix->type) { |
1709 | spec->cdefine.fixup = 1; | 1735 | case ALC_FIXUP_SKU: |
1710 | } | 1736 | if (action != ALC_FIXUP_ACT_PRE_PROBE || !fix->v.sku) |
1711 | if (pre_init && cfg) { | 1737 | break;; |
1712 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 1738 | snd_printdd(KERN_INFO "hda_codec: %s: " |
1713 | snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n", | 1739 | "Apply sku override for %s\n", |
1714 | codec->chip_name, modelname); | 1740 | codec->chip_name, modelname); |
1715 | #endif | 1741 | spec->cdefine.sku_cfg = fix->v.sku; |
1716 | for (; cfg->nid; cfg++) | 1742 | spec->cdefine.fixup = 1; |
1717 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); | 1743 | break; |
1718 | } | 1744 | case ALC_FIXUP_PINS: |
1719 | if (!pre_init && fix->verbs) { | 1745 | cfg = fix->v.pins; |
1720 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 1746 | if (action != ALC_FIXUP_ACT_PRE_PROBE || !cfg) |
1721 | snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n", | 1747 | break; |
1722 | codec->chip_name, modelname); | 1748 | snd_printdd(KERN_INFO "hda_codec: %s: " |
1723 | #endif | 1749 | "Apply pincfg for %s\n", |
1724 | add_verb(codec->spec, fix->verbs); | 1750 | codec->chip_name, modelname); |
1725 | } | 1751 | for (; cfg->nid; cfg++) |
1726 | if (fix->func) { | 1752 | snd_hda_codec_set_pincfg(codec, cfg->nid, |
1727 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 1753 | cfg->val); |
1728 | snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-func for %s\n", | 1754 | break; |
1729 | codec->chip_name, modelname); | 1755 | case ALC_FIXUP_VERBS: |
1730 | #endif | 1756 | if (action != ALC_FIXUP_ACT_PROBE || !fix->v.verbs) |
1731 | fix->func(codec, fix, pre_init); | 1757 | break; |
1758 | snd_printdd(KERN_INFO "hda_codec: %s: " | ||
1759 | "Apply fix-verbs for %s\n", | ||
1760 | codec->chip_name, modelname); | ||
1761 | add_verb(codec->spec, fix->v.verbs); | ||
1762 | break; | ||
1763 | case ALC_FIXUP_FUNC: | ||
1764 | if (!fix->v.func) | ||
1765 | break; | ||
1766 | snd_printdd(KERN_INFO "hda_codec: %s: " | ||
1767 | "Apply fix-func for %s\n", | ||
1768 | codec->chip_name, modelname); | ||
1769 | fix->v.func(codec, fix, action); | ||
1770 | break; | ||
1771 | default: | ||
1772 | snd_printk(KERN_ERR "hda_codec: %s: " | ||
1773 | "Invalid fixup type %d\n", | ||
1774 | codec->chip_name, fix->type); | ||
1775 | break; | ||
1776 | } | ||
1777 | if (!fix[id].chained) | ||
1778 | break; | ||
1779 | if (++depth > 10) | ||
1780 | break; | ||
1781 | id = fix[id].chain_id; | ||
1732 | } | 1782 | } |
1733 | } | 1783 | } |
1734 | 1784 | ||
1735 | static void alc_pick_fixup(struct hda_codec *codec, | 1785 | static void alc_pick_fixup(struct hda_codec *codec, |
1736 | const struct snd_pci_quirk *quirk, | 1786 | const struct alc_model_fixup *models, |
1737 | const struct alc_fixup *fix, | 1787 | const struct snd_pci_quirk *quirk, |
1738 | int pre_init) | 1788 | const struct alc_fixup *fixlist) |
1739 | { | 1789 | { |
1740 | quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); | 1790 | struct alc_spec *spec = codec->spec; |
1741 | if (quirk) { | 1791 | int id = -1; |
1742 | fix += quirk->value; | 1792 | const char *name = NULL; |
1743 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
1744 | __alc_pick_fixup(codec, fix, quirk->name, pre_init); | ||
1745 | #else | ||
1746 | __alc_pick_fixup(codec, fix, NULL, pre_init); | ||
1747 | #endif | ||
1748 | } | ||
1749 | } | ||
1750 | 1793 | ||
1751 | static void alc_pick_fixup_model(struct hda_codec *codec, | ||
1752 | const struct alc_model_fixup *models, | ||
1753 | const struct snd_pci_quirk *quirk, | ||
1754 | const struct alc_fixup *fix, | ||
1755 | int pre_init) | ||
1756 | { | ||
1757 | if (codec->modelname && models) { | 1794 | if (codec->modelname && models) { |
1758 | while (models->name) { | 1795 | while (models->name) { |
1759 | if (!strcmp(codec->modelname, models->name)) { | 1796 | if (!strcmp(codec->modelname, models->name)) { |
1760 | fix += models->id; | 1797 | id = models->id; |
1798 | name = models->name; | ||
1761 | break; | 1799 | break; |
1762 | } | 1800 | } |
1763 | models++; | 1801 | models++; |
1764 | } | 1802 | } |
1765 | __alc_pick_fixup(codec, fix, codec->modelname, pre_init); | 1803 | } |
1766 | } else { | 1804 | if (id < 0) { |
1767 | alc_pick_fixup(codec, quirk, fix, pre_init); | 1805 | quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); |
1806 | if (quirk) { | ||
1807 | id = quirk->value; | ||
1808 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
1809 | name = quirk->name; | ||
1810 | #endif | ||
1811 | } | ||
1812 | } | ||
1813 | |||
1814 | spec->fixup_id = id; | ||
1815 | if (id >= 0) { | ||
1816 | spec->fixup_list = fixlist; | ||
1817 | spec->fixup_name = name; | ||
1768 | } | 1818 | } |
1769 | } | 1819 | } |
1770 | 1820 | ||
@@ -2866,7 +2916,7 @@ static struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = { | |||
2866 | /* | 2916 | /* |
2867 | * slave controls for virtual master | 2917 | * slave controls for virtual master |
2868 | */ | 2918 | */ |
2869 | static const char *alc_slave_vols[] = { | 2919 | static const char * const alc_slave_vols[] = { |
2870 | "Front Playback Volume", | 2920 | "Front Playback Volume", |
2871 | "Surround Playback Volume", | 2921 | "Surround Playback Volume", |
2872 | "Center Playback Volume", | 2922 | "Center Playback Volume", |
@@ -2880,7 +2930,7 @@ static const char *alc_slave_vols[] = { | |||
2880 | NULL, | 2930 | NULL, |
2881 | }; | 2931 | }; |
2882 | 2932 | ||
2883 | static const char *alc_slave_sws[] = { | 2933 | static const char * const alc_slave_sws[] = { |
2884 | "Front Playback Switch", | 2934 | "Front Playback Switch", |
2885 | "Surround Playback Switch", | 2935 | "Surround Playback Switch", |
2886 | "Center Playback Switch", | 2936 | "Center Playback Switch", |
@@ -3861,6 +3911,8 @@ static int alc_init(struct hda_codec *codec) | |||
3861 | if (spec->init_hook) | 3911 | if (spec->init_hook) |
3862 | spec->init_hook(codec); | 3912 | spec->init_hook(codec); |
3863 | 3913 | ||
3914 | alc_apply_fixup(codec, ALC_FIXUP_ACT_INIT); | ||
3915 | |||
3864 | hda_call_check_power_status(codec, 0x01); | 3916 | hda_call_check_power_status(codec, 0x01); |
3865 | return 0; | 3917 | return 0; |
3866 | } | 3918 | } |
@@ -4559,7 +4611,7 @@ static struct hda_verb alc880_test_init_verbs[] = { | |||
4559 | /* | 4611 | /* |
4560 | */ | 4612 | */ |
4561 | 4613 | ||
4562 | static const char *alc880_models[ALC880_MODEL_LAST] = { | 4614 | static const char * const alc880_models[ALC880_MODEL_LAST] = { |
4563 | [ALC880_3ST] = "3stack", | 4615 | [ALC880_3ST] = "3stack", |
4564 | [ALC880_TCL_S700] = "tcl", | 4616 | [ALC880_TCL_S700] = "tcl", |
4565 | [ALC880_3ST_DIG] = "3stack-digout", | 4617 | [ALC880_3ST_DIG] = "3stack-digout", |
@@ -5092,7 +5144,7 @@ static const char *alc_get_line_out_pfx(const struct auto_pin_cfg *cfg, | |||
5092 | static int alc880_auto_create_multi_out_ctls(struct alc_spec *spec, | 5144 | static int alc880_auto_create_multi_out_ctls(struct alc_spec *spec, |
5093 | const struct auto_pin_cfg *cfg) | 5145 | const struct auto_pin_cfg *cfg) |
5094 | { | 5146 | { |
5095 | static const char *chname[4] = { | 5147 | static const char * const chname[4] = { |
5096 | "Front", "Surround", NULL /*CLFE*/, "Side" | 5148 | "Front", "Surround", NULL /*CLFE*/, "Side" |
5097 | }; | 5149 | }; |
5098 | const char *pfx = alc_get_line_out_pfx(cfg, false); | 5150 | const char *pfx = alc_get_line_out_pfx(cfg, false); |
@@ -7090,7 +7142,8 @@ enum { | |||
7090 | 7142 | ||
7091 | static const struct alc_fixup alc260_fixups[] = { | 7143 | static const struct alc_fixup alc260_fixups[] = { |
7092 | [PINFIX_HP_DC5750] = { | 7144 | [PINFIX_HP_DC5750] = { |
7093 | .pins = (const struct alc_pincfg[]) { | 7145 | .type = ALC_FIXUP_PINS, |
7146 | .v.pins = (const struct alc_pincfg[]) { | ||
7094 | { 0x11, 0x90130110 }, /* speaker */ | 7147 | { 0x11, 0x90130110 }, /* speaker */ |
7095 | { } | 7148 | { } |
7096 | } | 7149 | } |
@@ -7105,7 +7158,7 @@ static struct snd_pci_quirk alc260_fixup_tbl[] = { | |||
7105 | /* | 7158 | /* |
7106 | * ALC260 configurations | 7159 | * ALC260 configurations |
7107 | */ | 7160 | */ |
7108 | static const char *alc260_models[ALC260_MODEL_LAST] = { | 7161 | static const char * const alc260_models[ALC260_MODEL_LAST] = { |
7109 | [ALC260_BASIC] = "basic", | 7162 | [ALC260_BASIC] = "basic", |
7110 | [ALC260_HP] = "hp", | 7163 | [ALC260_HP] = "hp", |
7111 | [ALC260_HP_3013] = "hp-3013", | 7164 | [ALC260_HP_3013] = "hp-3013", |
@@ -7301,8 +7354,10 @@ static int patch_alc260(struct hda_codec *codec) | |||
7301 | board_config = ALC260_AUTO; | 7354 | board_config = ALC260_AUTO; |
7302 | } | 7355 | } |
7303 | 7356 | ||
7304 | if (board_config == ALC260_AUTO) | 7357 | if (board_config == ALC260_AUTO) { |
7305 | alc_pick_fixup(codec, alc260_fixup_tbl, alc260_fixups, 1); | 7358 | alc_pick_fixup(codec, NULL, alc260_fixup_tbl, alc260_fixups); |
7359 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | ||
7360 | } | ||
7306 | 7361 | ||
7307 | if (board_config == ALC260_AUTO) { | 7362 | if (board_config == ALC260_AUTO) { |
7308 | /* automatic parse from the BIOS config */ | 7363 | /* automatic parse from the BIOS config */ |
@@ -7350,8 +7405,7 @@ static int patch_alc260(struct hda_codec *codec) | |||
7350 | set_capture_mixer(codec); | 7405 | set_capture_mixer(codec); |
7351 | set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); | 7406 | set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
7352 | 7407 | ||
7353 | if (board_config == ALC260_AUTO) | 7408 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); |
7354 | alc_pick_fixup(codec, alc260_fixup_tbl, alc260_fixups, 0); | ||
7355 | 7409 | ||
7356 | spec->vmaster_nid = 0x08; | 7410 | spec->vmaster_nid = 0x08; |
7357 | 7411 | ||
@@ -9727,7 +9781,7 @@ static hda_nid_t alc1200_slave_dig_outs[] = { | |||
9727 | /* | 9781 | /* |
9728 | * configuration and preset | 9782 | * configuration and preset |
9729 | */ | 9783 | */ |
9730 | static const char *alc882_models[ALC882_MODEL_LAST] = { | 9784 | static const char * const alc882_models[ALC882_MODEL_LAST] = { |
9731 | [ALC882_3ST_DIG] = "3stack-dig", | 9785 | [ALC882_3ST_DIG] = "3stack-dig", |
9732 | [ALC882_6ST_DIG] = "6stack-dig", | 9786 | [ALC882_6ST_DIG] = "6stack-dig", |
9733 | [ALC882_ARIMA] = "arima", | 9787 | [ALC882_ARIMA] = "arima", |
@@ -10678,7 +10732,8 @@ enum { | |||
10678 | 10732 | ||
10679 | static const struct alc_fixup alc882_fixups[] = { | 10733 | static const struct alc_fixup alc882_fixups[] = { |
10680 | [PINFIX_ABIT_AW9D_MAX] = { | 10734 | [PINFIX_ABIT_AW9D_MAX] = { |
10681 | .pins = (const struct alc_pincfg[]) { | 10735 | .type = ALC_FIXUP_PINS, |
10736 | .v.pins = (const struct alc_pincfg[]) { | ||
10682 | { 0x15, 0x01080104 }, /* side */ | 10737 | { 0x15, 0x01080104 }, /* side */ |
10683 | { 0x16, 0x01011012 }, /* rear */ | 10738 | { 0x16, 0x01011012 }, /* rear */ |
10684 | { 0x17, 0x01016011 }, /* clfe */ | 10739 | { 0x17, 0x01016011 }, /* clfe */ |
@@ -10686,13 +10741,15 @@ static const struct alc_fixup alc882_fixups[] = { | |||
10686 | } | 10741 | } |
10687 | }, | 10742 | }, |
10688 | [PINFIX_PB_M5210] = { | 10743 | [PINFIX_PB_M5210] = { |
10689 | .verbs = (const struct hda_verb[]) { | 10744 | .type = ALC_FIXUP_VERBS, |
10745 | .v.verbs = (const struct hda_verb[]) { | ||
10690 | { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, | 10746 | { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, |
10691 | {} | 10747 | {} |
10692 | } | 10748 | } |
10693 | }, | 10749 | }, |
10694 | [PINFIX_ACER_ASPIRE_7736] = { | 10750 | [PINFIX_ACER_ASPIRE_7736] = { |
10695 | .sku = ALC_FIXUP_SKU_IGNORE, | 10751 | .type = ALC_FIXUP_SKU, |
10752 | .v.sku = ALC_FIXUP_SKU_IGNORE, | ||
10696 | }, | 10753 | }, |
10697 | }; | 10754 | }; |
10698 | 10755 | ||
@@ -10984,8 +11041,10 @@ static int patch_alc882(struct hda_codec *codec) | |||
10984 | board_config = ALC882_AUTO; | 11041 | board_config = ALC882_AUTO; |
10985 | } | 11042 | } |
10986 | 11043 | ||
10987 | if (board_config == ALC882_AUTO) | 11044 | if (board_config == ALC882_AUTO) { |
10988 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1); | 11045 | alc_pick_fixup(codec, NULL, alc882_fixup_tbl, alc882_fixups); |
11046 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | ||
11047 | } | ||
10989 | 11048 | ||
10990 | alc_auto_parse_customize_define(codec); | 11049 | alc_auto_parse_customize_define(codec); |
10991 | 11050 | ||
@@ -11061,8 +11120,7 @@ static int patch_alc882(struct hda_codec *codec) | |||
11061 | if (has_cdefine_beep(codec)) | 11120 | if (has_cdefine_beep(codec)) |
11062 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 11121 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
11063 | 11122 | ||
11064 | if (board_config == ALC882_AUTO) | 11123 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); |
11065 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0); | ||
11066 | 11124 | ||
11067 | spec->vmaster_nid = 0x0c; | 11125 | spec->vmaster_nid = 0x0c; |
11068 | 11126 | ||
@@ -12452,19 +12510,14 @@ enum { | |||
12452 | 12510 | ||
12453 | static const struct alc_fixup alc262_fixups[] = { | 12511 | static const struct alc_fixup alc262_fixups[] = { |
12454 | [PINFIX_FSC_H270] = { | 12512 | [PINFIX_FSC_H270] = { |
12455 | .pins = (const struct alc_pincfg[]) { | 12513 | .type = ALC_FIXUP_PINS, |
12514 | .v.pins = (const struct alc_pincfg[]) { | ||
12456 | { 0x14, 0x99130110 }, /* speaker */ | 12515 | { 0x14, 0x99130110 }, /* speaker */ |
12457 | { 0x15, 0x0221142f }, /* front HP */ | 12516 | { 0x15, 0x0221142f }, /* front HP */ |
12458 | { 0x1b, 0x0121141f }, /* rear HP */ | 12517 | { 0x1b, 0x0121141f }, /* rear HP */ |
12459 | { } | 12518 | { } |
12460 | } | 12519 | } |
12461 | }, | 12520 | }, |
12462 | [PINFIX_PB_M5210] = { | ||
12463 | .verbs = (const struct hda_verb[]) { | ||
12464 | { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, | ||
12465 | {} | ||
12466 | } | ||
12467 | }, | ||
12468 | }; | 12521 | }; |
12469 | 12522 | ||
12470 | static struct snd_pci_quirk alc262_fixup_tbl[] = { | 12523 | static struct snd_pci_quirk alc262_fixup_tbl[] = { |
@@ -12554,7 +12607,7 @@ static void alc262_auto_init(struct hda_codec *codec) | |||
12554 | /* | 12607 | /* |
12555 | * configuration and preset | 12608 | * configuration and preset |
12556 | */ | 12609 | */ |
12557 | static const char *alc262_models[ALC262_MODEL_LAST] = { | 12610 | static const char * const alc262_models[ALC262_MODEL_LAST] = { |
12558 | [ALC262_BASIC] = "basic", | 12611 | [ALC262_BASIC] = "basic", |
12559 | [ALC262_HIPPO] = "hippo", | 12612 | [ALC262_HIPPO] = "hippo", |
12560 | [ALC262_HIPPO_1] = "hippo_1", | 12613 | [ALC262_HIPPO_1] = "hippo_1", |
@@ -12895,8 +12948,10 @@ static int patch_alc262(struct hda_codec *codec) | |||
12895 | board_config = ALC262_AUTO; | 12948 | board_config = ALC262_AUTO; |
12896 | } | 12949 | } |
12897 | 12950 | ||
12898 | if (board_config == ALC262_AUTO) | 12951 | if (board_config == ALC262_AUTO) { |
12899 | alc_pick_fixup(codec, alc262_fixup_tbl, alc262_fixups, 1); | 12952 | alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); |
12953 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | ||
12954 | } | ||
12900 | 12955 | ||
12901 | if (board_config == ALC262_AUTO) { | 12956 | if (board_config == ALC262_AUTO) { |
12902 | /* automatic parse from the BIOS config */ | 12957 | /* automatic parse from the BIOS config */ |
@@ -12966,8 +13021,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12966 | if (!spec->no_analog && has_cdefine_beep(codec)) | 13021 | if (!spec->no_analog && has_cdefine_beep(codec)) |
12967 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 13022 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
12968 | 13023 | ||
12969 | if (board_config == ALC262_AUTO) | 13024 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); |
12970 | alc_pick_fixup(codec, alc262_fixup_tbl, alc262_fixups, 0); | ||
12971 | 13025 | ||
12972 | spec->vmaster_nid = 0x0c; | 13026 | spec->vmaster_nid = 0x0c; |
12973 | 13027 | ||
@@ -13741,7 +13795,7 @@ static void alc268_auto_init(struct hda_codec *codec) | |||
13741 | /* | 13795 | /* |
13742 | * configuration and preset | 13796 | * configuration and preset |
13743 | */ | 13797 | */ |
13744 | static const char *alc268_models[ALC268_MODEL_LAST] = { | 13798 | static const char * const alc268_models[ALC268_MODEL_LAST] = { |
13745 | [ALC267_QUANTA_IL1] = "quanta-il1", | 13799 | [ALC267_QUANTA_IL1] = "quanta-il1", |
13746 | [ALC268_3ST] = "3stack", | 13800 | [ALC268_3ST] = "3stack", |
13747 | [ALC268_TOSHIBA] = "toshiba", | 13801 | [ALC268_TOSHIBA] = "toshiba", |
@@ -14822,17 +14876,19 @@ static int alc269_resume(struct hda_codec *codec) | |||
14822 | #endif /* SND_HDA_NEEDS_RESUME */ | 14876 | #endif /* SND_HDA_NEEDS_RESUME */ |
14823 | 14877 | ||
14824 | static void alc269_fixup_hweq(struct hda_codec *codec, | 14878 | static void alc269_fixup_hweq(struct hda_codec *codec, |
14825 | const struct alc_fixup *fix, int pre_init) | 14879 | const struct alc_fixup *fix, int action) |
14826 | { | 14880 | { |
14827 | int coef; | 14881 | int coef; |
14828 | 14882 | ||
14883 | if (action != ALC_FIXUP_ACT_INIT) | ||
14884 | return; | ||
14829 | coef = alc_read_coef_idx(codec, 0x1e); | 14885 | coef = alc_read_coef_idx(codec, 0x1e); |
14830 | alc_write_coef_idx(codec, 0x1e, coef | 0x80); | 14886 | alc_write_coef_idx(codec, 0x1e, coef | 0x80); |
14831 | } | 14887 | } |
14832 | 14888 | ||
14833 | enum { | 14889 | enum { |
14834 | ALC269_FIXUP_SONY_VAIO, | 14890 | ALC269_FIXUP_SONY_VAIO, |
14835 | ALC275_FIX_SONY_VAIO_GPIO2, | 14891 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
14836 | ALC269_FIXUP_DELL_M101Z, | 14892 | ALC269_FIXUP_DELL_M101Z, |
14837 | ALC269_FIXUP_SKU_IGNORE, | 14893 | ALC269_FIXUP_SKU_IGNORE, |
14838 | ALC269_FIXUP_ASUS_G73JW, | 14894 | ALC269_FIXUP_ASUS_G73JW, |
@@ -14842,22 +14898,26 @@ enum { | |||
14842 | 14898 | ||
14843 | static const struct alc_fixup alc269_fixups[] = { | 14899 | static const struct alc_fixup alc269_fixups[] = { |
14844 | [ALC269_FIXUP_SONY_VAIO] = { | 14900 | [ALC269_FIXUP_SONY_VAIO] = { |
14845 | .verbs = (const struct hda_verb[]) { | 14901 | .type = ALC_FIXUP_VERBS, |
14902 | .v.verbs = (const struct hda_verb[]) { | ||
14846 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, | 14903 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, |
14847 | {} | 14904 | {} |
14848 | } | 14905 | } |
14849 | }, | 14906 | }, |
14850 | [ALC275_FIX_SONY_VAIO_GPIO2] = { | 14907 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
14851 | .verbs = (const struct hda_verb[]) { | 14908 | .type = ALC_FIXUP_VERBS, |
14909 | .v.verbs = (const struct hda_verb[]) { | ||
14852 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, | 14910 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, |
14853 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, | 14911 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, |
14854 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, | 14912 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, |
14855 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, | ||
14856 | { } | 14913 | { } |
14857 | } | 14914 | }, |
14915 | .chained = true, | ||
14916 | .chain_id = ALC269_FIXUP_SONY_VAIO | ||
14858 | }, | 14917 | }, |
14859 | [ALC269_FIXUP_DELL_M101Z] = { | 14918 | [ALC269_FIXUP_DELL_M101Z] = { |
14860 | .verbs = (const struct hda_verb[]) { | 14919 | .type = ALC_FIXUP_VERBS, |
14920 | .v.verbs = (const struct hda_verb[]) { | ||
14861 | /* Enables internal speaker */ | 14921 | /* Enables internal speaker */ |
14862 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, | 14922 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
14863 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, | 14923 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
@@ -14865,34 +14925,33 @@ static const struct alc_fixup alc269_fixups[] = { | |||
14865 | } | 14925 | } |
14866 | }, | 14926 | }, |
14867 | [ALC269_FIXUP_SKU_IGNORE] = { | 14927 | [ALC269_FIXUP_SKU_IGNORE] = { |
14868 | .sku = ALC_FIXUP_SKU_IGNORE, | 14928 | .type = ALC_FIXUP_SKU, |
14929 | .v.sku = ALC_FIXUP_SKU_IGNORE, | ||
14869 | }, | 14930 | }, |
14870 | [ALC269_FIXUP_ASUS_G73JW] = { | 14931 | [ALC269_FIXUP_ASUS_G73JW] = { |
14871 | .pins = (const struct alc_pincfg[]) { | 14932 | .type = ALC_FIXUP_PINS, |
14933 | .v.pins = (const struct alc_pincfg[]) { | ||
14872 | { 0x17, 0x99130111 }, /* subwoofer */ | 14934 | { 0x17, 0x99130111 }, /* subwoofer */ |
14873 | { } | 14935 | { } |
14874 | } | 14936 | } |
14875 | }, | 14937 | }, |
14876 | [ALC269_FIXUP_LENOVO_EAPD] = { | 14938 | [ALC269_FIXUP_LENOVO_EAPD] = { |
14877 | .verbs = (const struct hda_verb[]) { | 14939 | .type = ALC_FIXUP_VERBS, |
14940 | .v.verbs = (const struct hda_verb[]) { | ||
14878 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | 14941 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
14879 | {} | 14942 | {} |
14880 | } | 14943 | } |
14881 | }, | 14944 | }, |
14882 | [ALC275_FIXUP_SONY_HWEQ] = { | 14945 | [ALC275_FIXUP_SONY_HWEQ] = { |
14883 | .func = alc269_fixup_hweq, | 14946 | .type = ALC_FIXUP_FUNC, |
14884 | .verbs = (const struct hda_verb[]) { | 14947 | .v.func = alc269_fixup_hweq, |
14885 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, | 14948 | .chained = true, |
14886 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, | 14949 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
14887 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, | ||
14888 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, | ||
14889 | { } | ||
14890 | } | ||
14891 | } | 14950 | } |
14892 | }; | 14951 | }; |
14893 | 14952 | ||
14894 | static struct snd_pci_quirk alc269_fixup_tbl[] = { | 14953 | static struct snd_pci_quirk alc269_fixup_tbl[] = { |
14895 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), | 14954 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
14896 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | 14955 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
14897 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | 14956 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
14898 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | 14957 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
@@ -14908,7 +14967,7 @@ static struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
14908 | /* | 14967 | /* |
14909 | * configuration and preset | 14968 | * configuration and preset |
14910 | */ | 14969 | */ |
14911 | static const char *alc269_models[ALC269_MODEL_LAST] = { | 14970 | static const char * const alc269_models[ALC269_MODEL_LAST] = { |
14912 | [ALC269_BASIC] = "basic", | 14971 | [ALC269_BASIC] = "basic", |
14913 | [ALC269_QUANTA_FL1] = "quanta", | 14972 | [ALC269_QUANTA_FL1] = "quanta", |
14914 | [ALC269_AMIC] = "laptop-amic", | 14973 | [ALC269_AMIC] = "laptop-amic", |
@@ -15184,8 +15243,10 @@ static int patch_alc269(struct hda_codec *codec) | |||
15184 | board_config = ALC269_AUTO; | 15243 | board_config = ALC269_AUTO; |
15185 | } | 15244 | } |
15186 | 15245 | ||
15187 | if (board_config == ALC269_AUTO) | 15246 | if (board_config == ALC269_AUTO) { |
15188 | alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 1); | 15247 | alc_pick_fixup(codec, NULL, alc269_fixup_tbl, alc269_fixups); |
15248 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | ||
15249 | } | ||
15189 | 15250 | ||
15190 | if (board_config == ALC269_AUTO) { | 15251 | if (board_config == ALC269_AUTO) { |
15191 | /* automatic parse from the BIOS config */ | 15252 | /* automatic parse from the BIOS config */ |
@@ -15246,8 +15307,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
15246 | if (has_cdefine_beep(codec)) | 15307 | if (has_cdefine_beep(codec)) |
15247 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 15308 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
15248 | 15309 | ||
15249 | if (board_config == ALC269_AUTO) | 15310 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); |
15250 | alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 0); | ||
15251 | 15311 | ||
15252 | spec->vmaster_nid = 0x02; | 15312 | spec->vmaster_nid = 0x02; |
15253 | 15313 | ||
@@ -15950,7 +16010,7 @@ static int alc861_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
15950 | const struct auto_pin_cfg *cfg) | 16010 | const struct auto_pin_cfg *cfg) |
15951 | { | 16011 | { |
15952 | struct alc_spec *spec = codec->spec; | 16012 | struct alc_spec *spec = codec->spec; |
15953 | static const char *chname[4] = { | 16013 | static const char * const chname[4] = { |
15954 | "Front", "Surround", NULL /*CLFE*/, "Side" | 16014 | "Front", "Surround", NULL /*CLFE*/, "Side" |
15955 | }; | 16015 | }; |
15956 | const char *pfx = alc_get_line_out_pfx(cfg, true); | 16016 | const char *pfx = alc_get_line_out_pfx(cfg, true); |
@@ -16156,7 +16216,7 @@ static struct hda_amp_list alc861_loopbacks[] = { | |||
16156 | /* | 16216 | /* |
16157 | * configuration and preset | 16217 | * configuration and preset |
16158 | */ | 16218 | */ |
16159 | static const char *alc861_models[ALC861_MODEL_LAST] = { | 16219 | static const char * const alc861_models[ALC861_MODEL_LAST] = { |
16160 | [ALC861_3ST] = "3stack", | 16220 | [ALC861_3ST] = "3stack", |
16161 | [ALC660_3ST] = "3stack-660", | 16221 | [ALC660_3ST] = "3stack-660", |
16162 | [ALC861_3ST_DIG] = "3stack-dig", | 16222 | [ALC861_3ST_DIG] = "3stack-dig", |
@@ -16306,7 +16366,8 @@ enum { | |||
16306 | 16366 | ||
16307 | static const struct alc_fixup alc861_fixups[] = { | 16367 | static const struct alc_fixup alc861_fixups[] = { |
16308 | [PINFIX_FSC_AMILO_PI1505] = { | 16368 | [PINFIX_FSC_AMILO_PI1505] = { |
16309 | .pins = (const struct alc_pincfg[]) { | 16369 | .type = ALC_FIXUP_PINS, |
16370 | .v.pins = (const struct alc_pincfg[]) { | ||
16310 | { 0x0b, 0x0221101f }, /* HP */ | 16371 | { 0x0b, 0x0221101f }, /* HP */ |
16311 | { 0x0f, 0x90170310 }, /* speaker */ | 16372 | { 0x0f, 0x90170310 }, /* speaker */ |
16312 | { } | 16373 | { } |
@@ -16341,8 +16402,10 @@ static int patch_alc861(struct hda_codec *codec) | |||
16341 | board_config = ALC861_AUTO; | 16402 | board_config = ALC861_AUTO; |
16342 | } | 16403 | } |
16343 | 16404 | ||
16344 | if (board_config == ALC861_AUTO) | 16405 | if (board_config == ALC861_AUTO) { |
16345 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1); | 16406 | alc_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
16407 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | ||
16408 | } | ||
16346 | 16409 | ||
16347 | if (board_config == ALC861_AUTO) { | 16410 | if (board_config == ALC861_AUTO) { |
16348 | /* automatic parse from the BIOS config */ | 16411 | /* automatic parse from the BIOS config */ |
@@ -16379,8 +16442,7 @@ static int patch_alc861(struct hda_codec *codec) | |||
16379 | 16442 | ||
16380 | spec->vmaster_nid = 0x03; | 16443 | spec->vmaster_nid = 0x03; |
16381 | 16444 | ||
16382 | if (board_config == ALC861_AUTO) | 16445 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); |
16383 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0); | ||
16384 | 16446 | ||
16385 | codec->patch_ops = alc_patch_ops; | 16447 | codec->patch_ops = alc_patch_ops; |
16386 | if (board_config == ALC861_AUTO) { | 16448 | if (board_config == ALC861_AUTO) { |
@@ -16857,7 +16919,7 @@ static void alc861vd_dallas_setup(struct hda_codec *codec) | |||
16857 | /* | 16919 | /* |
16858 | * configuration and preset | 16920 | * configuration and preset |
16859 | */ | 16921 | */ |
16860 | static const char *alc861vd_models[ALC861VD_MODEL_LAST] = { | 16922 | static const char * const alc861vd_models[ALC861VD_MODEL_LAST] = { |
16861 | [ALC660VD_3ST] = "3stack-660", | 16923 | [ALC660VD_3ST] = "3stack-660", |
16862 | [ALC660VD_3ST_DIG] = "3stack-660-digout", | 16924 | [ALC660VD_3ST_DIG] = "3stack-660-digout", |
16863 | [ALC660VD_ASUS_V1S] = "asus-v1s", | 16925 | [ALC660VD_ASUS_V1S] = "asus-v1s", |
@@ -17077,7 +17139,9 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec) | |||
17077 | static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec, | 17139 | static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec, |
17078 | const struct auto_pin_cfg *cfg) | 17140 | const struct auto_pin_cfg *cfg) |
17079 | { | 17141 | { |
17080 | static const char *chname[4] = {"Front", "Surround", "CLFE", "Side"}; | 17142 | static const char * const chname[4] = { |
17143 | "Front", "Surround", "CLFE", "Side" | ||
17144 | }; | ||
17081 | const char *pfx = alc_get_line_out_pfx(cfg, true); | 17145 | const char *pfx = alc_get_line_out_pfx(cfg, true); |
17082 | hda_nid_t nid_v, nid_s; | 17146 | hda_nid_t nid_v, nid_s; |
17083 | int i, err; | 17147 | int i, err; |
@@ -17262,7 +17326,8 @@ enum { | |||
17262 | /* reset GPIO1 */ | 17326 | /* reset GPIO1 */ |
17263 | static const struct alc_fixup alc861vd_fixups[] = { | 17327 | static const struct alc_fixup alc861vd_fixups[] = { |
17264 | [ALC660VD_FIX_ASUS_GPIO1] = { | 17328 | [ALC660VD_FIX_ASUS_GPIO1] = { |
17265 | .verbs = (const struct hda_verb[]) { | 17329 | .type = ALC_FIXUP_VERBS, |
17330 | .v.verbs = (const struct hda_verb[]) { | ||
17266 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, | 17331 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
17267 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, | 17332 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, |
17268 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, | 17333 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, |
@@ -17297,8 +17362,10 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
17297 | board_config = ALC861VD_AUTO; | 17362 | board_config = ALC861VD_AUTO; |
17298 | } | 17363 | } |
17299 | 17364 | ||
17300 | if (board_config == ALC861VD_AUTO) | 17365 | if (board_config == ALC861VD_AUTO) { |
17301 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1); | 17366 | alc_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
17367 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | ||
17368 | } | ||
17302 | 17369 | ||
17303 | if (board_config == ALC861VD_AUTO) { | 17370 | if (board_config == ALC861VD_AUTO) { |
17304 | /* automatic parse from the BIOS config */ | 17371 | /* automatic parse from the BIOS config */ |
@@ -17346,8 +17413,7 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
17346 | 17413 | ||
17347 | spec->vmaster_nid = 0x02; | 17414 | spec->vmaster_nid = 0x02; |
17348 | 17415 | ||
17349 | if (board_config == ALC861VD_AUTO) | 17416 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); |
17350 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0); | ||
17351 | 17417 | ||
17352 | codec->patch_ops = alc_patch_ops; | 17418 | codec->patch_ops = alc_patch_ops; |
17353 | 17419 | ||
@@ -18630,7 +18696,7 @@ static struct snd_kcontrol_new alc272_nc10_mixer[] = { | |||
18630 | /* | 18696 | /* |
18631 | * configuration and preset | 18697 | * configuration and preset |
18632 | */ | 18698 | */ |
18633 | static const char *alc662_models[ALC662_MODEL_LAST] = { | 18699 | static const char * const alc662_models[ALC662_MODEL_LAST] = { |
18634 | [ALC662_3ST_2ch_DIG] = "3stack-dig", | 18700 | [ALC662_3ST_2ch_DIG] = "3stack-dig", |
18635 | [ALC662_3ST_6ch_DIG] = "3stack-6ch-dig", | 18701 | [ALC662_3ST_6ch_DIG] = "3stack-6ch-dig", |
18636 | [ALC662_3ST_6ch] = "3stack-6ch", | 18702 | [ALC662_3ST_6ch] = "3stack-6ch", |
@@ -19145,7 +19211,7 @@ static int alc662_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
19145 | const struct auto_pin_cfg *cfg) | 19211 | const struct auto_pin_cfg *cfg) |
19146 | { | 19212 | { |
19147 | struct alc_spec *spec = codec->spec; | 19213 | struct alc_spec *spec = codec->spec; |
19148 | static const char *chname[4] = { | 19214 | static const char * const chname[4] = { |
19149 | "Front", "Surround", NULL /*CLFE*/, "Side" | 19215 | "Front", "Surround", NULL /*CLFE*/, "Side" |
19150 | }; | 19216 | }; |
19151 | const char *pfx = alc_get_line_out_pfx(cfg, true); | 19217 | const char *pfx = alc_get_line_out_pfx(cfg, true); |
@@ -19378,7 +19444,10 @@ static void alc662_auto_init(struct hda_codec *codec) | |||
19378 | } | 19444 | } |
19379 | 19445 | ||
19380 | static void alc272_fixup_mario(struct hda_codec *codec, | 19446 | static void alc272_fixup_mario(struct hda_codec *codec, |
19381 | const struct alc_fixup *fix, int pre_init) { | 19447 | const struct alc_fixup *fix, int action) |
19448 | { | ||
19449 | if (action != ALC_FIXUP_ACT_PROBE) | ||
19450 | return; | ||
19382 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, | 19451 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
19383 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | | 19452 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
19384 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | | 19453 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
@@ -19396,19 +19465,22 @@ enum { | |||
19396 | 19465 | ||
19397 | static const struct alc_fixup alc662_fixups[] = { | 19466 | static const struct alc_fixup alc662_fixups[] = { |
19398 | [ALC662_FIXUP_ASPIRE] = { | 19467 | [ALC662_FIXUP_ASPIRE] = { |
19399 | .pins = (const struct alc_pincfg[]) { | 19468 | .type = ALC_FIXUP_PINS, |
19469 | .v.pins = (const struct alc_pincfg[]) { | ||
19400 | { 0x15, 0x99130112 }, /* subwoofer */ | 19470 | { 0x15, 0x99130112 }, /* subwoofer */ |
19401 | { } | 19471 | { } |
19402 | } | 19472 | } |
19403 | }, | 19473 | }, |
19404 | [ALC662_FIXUP_IDEAPAD] = { | 19474 | [ALC662_FIXUP_IDEAPAD] = { |
19405 | .pins = (const struct alc_pincfg[]) { | 19475 | .type = ALC_FIXUP_PINS, |
19476 | .v.pins = (const struct alc_pincfg[]) { | ||
19406 | { 0x17, 0x99130112 }, /* subwoofer */ | 19477 | { 0x17, 0x99130112 }, /* subwoofer */ |
19407 | { } | 19478 | { } |
19408 | } | 19479 | } |
19409 | }, | 19480 | }, |
19410 | [ALC272_FIXUP_MARIO] = { | 19481 | [ALC272_FIXUP_MARIO] = { |
19411 | .func = alc272_fixup_mario, | 19482 | .type = ALC_FIXUP_FUNC, |
19483 | .v.func = alc272_fixup_mario, | ||
19412 | } | 19484 | } |
19413 | }; | 19485 | }; |
19414 | 19486 | ||
@@ -19462,7 +19534,9 @@ static int patch_alc662(struct hda_codec *codec) | |||
19462 | } | 19534 | } |
19463 | 19535 | ||
19464 | if (board_config == ALC662_AUTO) { | 19536 | if (board_config == ALC662_AUTO) { |
19465 | alc_pick_fixup(codec, alc662_fixup_tbl, alc662_fixups, 1); | 19537 | alc_pick_fixup(codec, alc662_fixup_models, |
19538 | alc662_fixup_tbl, alc662_fixups); | ||
19539 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); | ||
19466 | /* automatic parse from the BIOS config */ | 19540 | /* automatic parse from the BIOS config */ |
19467 | err = alc662_parse_auto_config(codec); | 19541 | err = alc662_parse_auto_config(codec); |
19468 | if (err < 0) { | 19542 | if (err < 0) { |
@@ -19520,12 +19594,11 @@ static int patch_alc662(struct hda_codec *codec) | |||
19520 | } | 19594 | } |
19521 | spec->vmaster_nid = 0x02; | 19595 | spec->vmaster_nid = 0x02; |
19522 | 19596 | ||
19597 | alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); | ||
19598 | |||
19523 | codec->patch_ops = alc_patch_ops; | 19599 | codec->patch_ops = alc_patch_ops; |
19524 | if (board_config == ALC662_AUTO) { | 19600 | if (board_config == ALC662_AUTO) |
19525 | spec->init_hook = alc662_auto_init; | 19601 | spec->init_hook = alc662_auto_init; |
19526 | alc_pick_fixup_model(codec, alc662_fixup_models, | ||
19527 | alc662_fixup_tbl, alc662_fixups, 0); | ||
19528 | } | ||
19529 | 19602 | ||
19530 | alc_init_jacks(codec); | 19603 | alc_init_jacks(codec); |
19531 | 19604 | ||
@@ -19913,7 +19986,7 @@ static void alc680_auto_init(struct hda_codec *codec) | |||
19913 | /* | 19986 | /* |
19914 | * configuration and preset | 19987 | * configuration and preset |
19915 | */ | 19988 | */ |
19916 | static const char *alc680_models[ALC680_MODEL_LAST] = { | 19989 | static const char * const alc680_models[ALC680_MODEL_LAST] = { |
19917 | [ALC680_BASE] = "base", | 19990 | [ALC680_BASE] = "base", |
19918 | [ALC680_AUTO] = "auto", | 19991 | [ALC680_AUTO] = "auto", |
19919 | }; | 19992 | }; |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 4ab019d0924e..9ea48b425d0b 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -266,7 +266,7 @@ struct sigmatel_spec { | |||
266 | struct sigmatel_mic_route int_mic; | 266 | struct sigmatel_mic_route int_mic; |
267 | struct sigmatel_mic_route dock_mic; | 267 | struct sigmatel_mic_route dock_mic; |
268 | 268 | ||
269 | const char **spdif_labels; | 269 | const char * const *spdif_labels; |
270 | 270 | ||
271 | hda_nid_t dig_in_nid; | 271 | hda_nid_t dig_in_nid; |
272 | hda_nid_t mono_nid; | 272 | hda_nid_t mono_nid; |
@@ -524,7 +524,7 @@ static unsigned long stac927x_capsws[] = { | |||
524 | HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT), | 524 | HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT), |
525 | }; | 525 | }; |
526 | 526 | ||
527 | static const char *stac927x_spdif_labels[5] = { | 527 | static const char * const stac927x_spdif_labels[5] = { |
528 | "Digital Playback", "ADAT", "Analog Mux 1", | 528 | "Digital Playback", "ADAT", "Analog Mux 1", |
529 | "Analog Mux 2", "Analog Mux 3" | 529 | "Analog Mux 2", "Analog Mux 3" |
530 | }; | 530 | }; |
@@ -1062,7 +1062,7 @@ static struct snd_kcontrol_new stac_smux_mixer = { | |||
1062 | .put = stac92xx_smux_enum_put, | 1062 | .put = stac92xx_smux_enum_put, |
1063 | }; | 1063 | }; |
1064 | 1064 | ||
1065 | static const char *slave_vols[] = { | 1065 | static const char * const slave_vols[] = { |
1066 | "Front Playback Volume", | 1066 | "Front Playback Volume", |
1067 | "Surround Playback Volume", | 1067 | "Surround Playback Volume", |
1068 | "Center Playback Volume", | 1068 | "Center Playback Volume", |
@@ -1073,7 +1073,7 @@ static const char *slave_vols[] = { | |||
1073 | NULL | 1073 | NULL |
1074 | }; | 1074 | }; |
1075 | 1075 | ||
1076 | static const char *slave_sws[] = { | 1076 | static const char * const slave_sws[] = { |
1077 | "Front Playback Switch", | 1077 | "Front Playback Switch", |
1078 | "Surround Playback Switch", | 1078 | "Surround Playback Switch", |
1079 | "Center Playback Switch", | 1079 | "Center Playback Switch", |
@@ -1354,7 +1354,7 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = { | |||
1354 | [STAC_9200_PANASONIC] = ref9200_pin_configs, | 1354 | [STAC_9200_PANASONIC] = ref9200_pin_configs, |
1355 | }; | 1355 | }; |
1356 | 1356 | ||
1357 | static const char *stac9200_models[STAC_9200_MODELS] = { | 1357 | static const char * const stac9200_models[STAC_9200_MODELS] = { |
1358 | [STAC_AUTO] = "auto", | 1358 | [STAC_AUTO] = "auto", |
1359 | [STAC_REF] = "ref", | 1359 | [STAC_REF] = "ref", |
1360 | [STAC_9200_OQO] = "oqo", | 1360 | [STAC_9200_OQO] = "oqo", |
@@ -1500,7 +1500,7 @@ static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { | |||
1500 | [STAC_M6] = stac925xM6_pin_configs, | 1500 | [STAC_M6] = stac925xM6_pin_configs, |
1501 | }; | 1501 | }; |
1502 | 1502 | ||
1503 | static const char *stac925x_models[STAC_925x_MODELS] = { | 1503 | static const char * const stac925x_models[STAC_925x_MODELS] = { |
1504 | [STAC_925x_AUTO] = "auto", | 1504 | [STAC_925x_AUTO] = "auto", |
1505 | [STAC_REF] = "ref", | 1505 | [STAC_REF] = "ref", |
1506 | [STAC_M1] = "m1", | 1506 | [STAC_M1] = "m1", |
@@ -1574,7 +1574,7 @@ static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { | |||
1574 | [STAC_92HD73XX_INTEL] = intel_dg45id_pin_configs, | 1574 | [STAC_92HD73XX_INTEL] = intel_dg45id_pin_configs, |
1575 | }; | 1575 | }; |
1576 | 1576 | ||
1577 | static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { | 1577 | static const char * const stac92hd73xx_models[STAC_92HD73XX_MODELS] = { |
1578 | [STAC_92HD73XX_AUTO] = "auto", | 1578 | [STAC_92HD73XX_AUTO] = "auto", |
1579 | [STAC_92HD73XX_NO_JD] = "no-jd", | 1579 | [STAC_92HD73XX_NO_JD] = "no-jd", |
1580 | [STAC_92HD73XX_REF] = "ref", | 1580 | [STAC_92HD73XX_REF] = "ref", |
@@ -1660,7 +1660,7 @@ static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = { | |||
1660 | [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs, | 1660 | [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs, |
1661 | }; | 1661 | }; |
1662 | 1662 | ||
1663 | static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { | 1663 | static const char * const stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { |
1664 | [STAC_92HD83XXX_AUTO] = "auto", | 1664 | [STAC_92HD83XXX_AUTO] = "auto", |
1665 | [STAC_92HD83XXX_REF] = "ref", | 1665 | [STAC_92HD83XXX_REF] = "ref", |
1666 | [STAC_92HD83XXX_PWR_REF] = "mic-ref", | 1666 | [STAC_92HD83XXX_PWR_REF] = "mic-ref", |
@@ -1722,7 +1722,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { | |||
1722 | [STAC_HP_DV4_1222NR] = NULL, | 1722 | [STAC_HP_DV4_1222NR] = NULL, |
1723 | }; | 1723 | }; |
1724 | 1724 | ||
1725 | static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { | 1725 | static const char * const stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { |
1726 | [STAC_92HD71BXX_AUTO] = "auto", | 1726 | [STAC_92HD71BXX_AUTO] = "auto", |
1727 | [STAC_92HD71BXX_REF] = "ref", | 1727 | [STAC_92HD71BXX_REF] = "ref", |
1728 | [STAC_DELL_M4_1] = "dell-m4-1", | 1728 | [STAC_DELL_M4_1] = "dell-m4-1", |
@@ -1915,7 +1915,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { | |||
1915 | [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs, | 1915 | [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs, |
1916 | }; | 1916 | }; |
1917 | 1917 | ||
1918 | static const char *stac922x_models[STAC_922X_MODELS] = { | 1918 | static const char * const stac922x_models[STAC_922X_MODELS] = { |
1919 | [STAC_922X_AUTO] = "auto", | 1919 | [STAC_922X_AUTO] = "auto", |
1920 | [STAC_D945_REF] = "ref", | 1920 | [STAC_D945_REF] = "ref", |
1921 | [STAC_D945GTP5] = "5stack", | 1921 | [STAC_D945GTP5] = "5stack", |
@@ -2077,7 +2077,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { | |||
2077 | [STAC_927X_VOLKNOB] = NULL, | 2077 | [STAC_927X_VOLKNOB] = NULL, |
2078 | }; | 2078 | }; |
2079 | 2079 | ||
2080 | static const char *stac927x_models[STAC_927X_MODELS] = { | 2080 | static const char * const stac927x_models[STAC_927X_MODELS] = { |
2081 | [STAC_927X_AUTO] = "auto", | 2081 | [STAC_927X_AUTO] = "auto", |
2082 | [STAC_D965_REF_NO_JD] = "ref-no-jd", | 2082 | [STAC_D965_REF_NO_JD] = "ref-no-jd", |
2083 | [STAC_D965_REF] = "ref", | 2083 | [STAC_D965_REF] = "ref", |
@@ -2180,7 +2180,7 @@ static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = { | |||
2180 | [STAC_9205_EAPD] = NULL, | 2180 | [STAC_9205_EAPD] = NULL, |
2181 | }; | 2181 | }; |
2182 | 2182 | ||
2183 | static const char *stac9205_models[STAC_9205_MODELS] = { | 2183 | static const char * const stac9205_models[STAC_9205_MODELS] = { |
2184 | [STAC_9205_AUTO] = "auto", | 2184 | [STAC_9205_AUTO] = "auto", |
2185 | [STAC_9205_REF] = "ref", | 2185 | [STAC_9205_REF] = "ref", |
2186 | [STAC_9205_DELL_M42] = "dell-m42", | 2186 | [STAC_9205_DELL_M42] = "dell-m42", |
@@ -3123,7 +3123,7 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs, | |||
3123 | int type) | 3123 | int type) |
3124 | { | 3124 | { |
3125 | struct sigmatel_spec *spec = codec->spec; | 3125 | struct sigmatel_spec *spec = codec->spec; |
3126 | static const char *chname[4] = { | 3126 | static const char * const chname[4] = { |
3127 | "Front", "Surround", NULL /*CLFE*/, "Side" | 3127 | "Front", "Surround", NULL /*CLFE*/, "Side" |
3128 | }; | 3128 | }; |
3129 | hda_nid_t nid; | 3129 | hda_nid_t nid; |
@@ -3256,7 +3256,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec, | |||
3256 | } | 3256 | } |
3257 | 3257 | ||
3258 | /* labels for mono mux outputs */ | 3258 | /* labels for mono mux outputs */ |
3259 | static const char *stac92xx_mono_labels[4] = { | 3259 | static const char * const stac92xx_mono_labels[4] = { |
3260 | "DAC0", "DAC1", "Mixer", "DAC2" | 3260 | "DAC0", "DAC1", "Mixer", "DAC2" |
3261 | }; | 3261 | }; |
3262 | 3262 | ||
@@ -3380,7 +3380,7 @@ static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec) | |||
3380 | return 0; | 3380 | return 0; |
3381 | }; | 3381 | }; |
3382 | 3382 | ||
3383 | static const char *stac92xx_spdif_labels[3] = { | 3383 | static const char * const stac92xx_spdif_labels[3] = { |
3384 | "Digital Playback", "Analog Mux 1", "Analog Mux 2", | 3384 | "Digital Playback", "Analog Mux 1", "Analog Mux 2", |
3385 | }; | 3385 | }; |
3386 | 3386 | ||
@@ -3388,7 +3388,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec) | |||
3388 | { | 3388 | { |
3389 | struct sigmatel_spec *spec = codec->spec; | 3389 | struct sigmatel_spec *spec = codec->spec; |
3390 | struct hda_input_mux *spdif_mux = &spec->private_smux; | 3390 | struct hda_input_mux *spdif_mux = &spec->private_smux; |
3391 | const char **labels = spec->spdif_labels; | 3391 | const char * const *labels = spec->spdif_labels; |
3392 | int i, num_cons; | 3392 | int i, num_cons; |
3393 | hda_nid_t con_lst[HDA_MAX_NUM_INPUTS]; | 3393 | hda_nid_t con_lst[HDA_MAX_NUM_INPUTS]; |
3394 | 3394 | ||
@@ -3409,7 +3409,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec) | |||
3409 | } | 3409 | } |
3410 | 3410 | ||
3411 | /* labels for dmic mux inputs */ | 3411 | /* labels for dmic mux inputs */ |
3412 | static const char *stac92xx_dmic_labels[5] = { | 3412 | static const char * const stac92xx_dmic_labels[5] = { |
3413 | "Analog Inputs", "Digital Mic 1", "Digital Mic 2", | 3413 | "Analog Inputs", "Digital Mic 1", "Digital Mic 2", |
3414 | "Digital Mic 3", "Digital Mic 4" | 3414 | "Digital Mic 3", "Digital Mic 4" |
3415 | }; | 3415 | }; |
@@ -5333,7 +5333,7 @@ again: | |||
5333 | return 0; | 5333 | return 0; |
5334 | } | 5334 | } |
5335 | 5335 | ||
5336 | static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) | 5336 | static int hp_bnb2011_with_dock(struct hda_codec *codec) |
5337 | { | 5337 | { |
5338 | if (codec->vendor_id != 0x111d7605 && | 5338 | if (codec->vendor_id != 0x111d7605 && |
5339 | codec->vendor_id != 0x111d76d1) | 5339 | codec->vendor_id != 0x111d76d1) |
@@ -5348,10 +5348,6 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) | |||
5348 | case 0x103c161d: | 5348 | case 0x103c161d: |
5349 | case 0x103c161e: | 5349 | case 0x103c161e: |
5350 | case 0x103c161f: | 5350 | case 0x103c161f: |
5351 | case 0x103c1620: | ||
5352 | case 0x103c1621: | ||
5353 | case 0x103c1622: | ||
5354 | case 0x103c1623: | ||
5355 | 5351 | ||
5356 | case 0x103c162a: | 5352 | case 0x103c162a: |
5357 | case 0x103c162b: | 5353 | case 0x103c162b: |
@@ -5360,41 +5356,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) | |||
5360 | case 0x103c1631: | 5356 | case 0x103c1631: |
5361 | 5357 | ||
5362 | case 0x103c1633: | 5358 | case 0x103c1633: |
5363 | 5359 | case 0x103c1634: | |
5364 | case 0x103c1635: | 5360 | case 0x103c1635: |
5365 | 5361 | ||
5366 | case 0x103c164f: | ||
5367 | |||
5368 | case 0x103c1676: | ||
5369 | case 0x103c1677: | ||
5370 | case 0x103c1678: | ||
5371 | case 0x103c1679: | ||
5372 | case 0x103c167a: | ||
5373 | case 0x103c167b: | ||
5374 | case 0x103c167c: | ||
5375 | case 0x103c167d: | ||
5376 | case 0x103c167e: | ||
5377 | case 0x103c167f: | ||
5378 | case 0x103c1680: | ||
5379 | case 0x103c1681: | ||
5380 | case 0x103c1682: | ||
5381 | case 0x103c1683: | ||
5382 | case 0x103c1684: | ||
5383 | case 0x103c1685: | ||
5384 | case 0x103c1686: | ||
5385 | case 0x103c1687: | ||
5386 | case 0x103c1688: | ||
5387 | case 0x103c1689: | ||
5388 | case 0x103c168a: | ||
5389 | case 0x103c168b: | ||
5390 | case 0x103c168c: | ||
5391 | case 0x103c168d: | ||
5392 | case 0x103c168e: | ||
5393 | case 0x103c168f: | ||
5394 | case 0x103c1690: | ||
5395 | case 0x103c1691: | ||
5396 | case 0x103c1692: | ||
5397 | |||
5398 | case 0x103c3587: | 5362 | case 0x103c3587: |
5399 | case 0x103c3588: | 5363 | case 0x103c3588: |
5400 | case 0x103c3589: | 5364 | case 0x103c3589: |
@@ -5402,9 +5366,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) | |||
5402 | 5366 | ||
5403 | case 0x103c3667: | 5367 | case 0x103c3667: |
5404 | case 0x103c3668: | 5368 | case 0x103c3668: |
5405 | /* set BTL amp level to 13.43dB for louder speaker output */ | 5369 | case 0x103c3669: |
5406 | return snd_hda_codec_write_cache(codec, codec->afg, 0, | 5370 | |
5407 | 0x7F4, 0x14); | 5371 | return 1; |
5408 | } | 5372 | } |
5409 | return 0; | 5373 | return 0; |
5410 | } | 5374 | } |
@@ -5420,6 +5384,11 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
5420 | if (spec == NULL) | 5384 | if (spec == NULL) |
5421 | return -ENOMEM; | 5385 | return -ENOMEM; |
5422 | 5386 | ||
5387 | if (hp_bnb2011_with_dock(codec)) { | ||
5388 | snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f); | ||
5389 | snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); | ||
5390 | } | ||
5391 | |||
5423 | /* reset pin power-down; Windows may leave these bits after reboot */ | 5392 | /* reset pin power-down; Windows may leave these bits after reboot */ |
5424 | snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0); | 5393 | snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0); |
5425 | snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0); | 5394 | snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0); |
@@ -5546,8 +5515,6 @@ again: | |||
5546 | AC_VERB_SET_CONNECT_SEL, num_dacs); | 5515 | AC_VERB_SET_CONNECT_SEL, num_dacs); |
5547 | } | 5516 | } |
5548 | 5517 | ||
5549 | stac92hd83xxx_set_system_btl_amp(codec); | ||
5550 | |||
5551 | codec->proc_widget_hook = stac92hd_proc_hook; | 5518 | codec->proc_widget_hook = stac92hd_proc_hook; |
5552 | 5519 | ||
5553 | return 0; | 5520 | return 0; |
@@ -6270,7 +6237,7 @@ static unsigned int stac9872_vaio_pin_configs[9] = { | |||
6270 | 0x90a7013e | 6237 | 0x90a7013e |
6271 | }; | 6238 | }; |
6272 | 6239 | ||
6273 | static const char *stac9872_models[STAC_9872_MODELS] = { | 6240 | static const char * const stac9872_models[STAC_9872_MODELS] = { |
6274 | [STAC_9872_AUTO] = "auto", | 6241 | [STAC_9872_AUTO] = "auto", |
6275 | [STAC_9872_VAIO] = "vaio", | 6242 | [STAC_9872_VAIO] = "vaio", |
6276 | }; | 6243 | }; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 7f4852a478a1..a76c3260d941 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -2281,7 +2281,9 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2281 | const struct auto_pin_cfg *cfg) | 2281 | const struct auto_pin_cfg *cfg) |
2282 | { | 2282 | { |
2283 | char name[32]; | 2283 | char name[32]; |
2284 | static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; | 2284 | static const char * const chname[4] = { |
2285 | "Front", "Surround", "C/LFE", "Side" | ||
2286 | }; | ||
2285 | hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b}; | 2287 | hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b}; |
2286 | int i, err; | 2288 | int i, err; |
2287 | 2289 | ||
@@ -2370,7 +2372,7 @@ static void create_hp_imux(struct via_spec *spec) | |||
2370 | { | 2372 | { |
2371 | int i; | 2373 | int i; |
2372 | struct hda_input_mux *imux = &spec->private_imux[1]; | 2374 | struct hda_input_mux *imux = &spec->private_imux[1]; |
2373 | static const char *texts[] = { "OFF", "ON", NULL}; | 2375 | static const char * const texts[] = { "OFF", "ON", NULL}; |
2374 | 2376 | ||
2375 | /* for hp mode select */ | 2377 | /* for hp mode select */ |
2376 | for (i = 0; texts[i]; i++) | 2378 | for (i = 0; texts[i]; i++) |
@@ -2890,7 +2892,9 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2890 | const struct auto_pin_cfg *cfg) | 2892 | const struct auto_pin_cfg *cfg) |
2891 | { | 2893 | { |
2892 | char name[32]; | 2894 | char name[32]; |
2893 | static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; | 2895 | static const char * const chname[4] = { |
2896 | "Front", "Surround", "C/LFE", "Side" | ||
2897 | }; | ||
2894 | hda_nid_t nid, nid_vol, nid_vols[] = {0x18, 0x1a, 0x1b, 0x29}; | 2898 | hda_nid_t nid, nid_vol, nid_vols[] = {0x18, 0x1a, 0x1b, 0x29}; |
2895 | int i, err; | 2899 | int i, err; |
2896 | 2900 | ||
@@ -3433,7 +3437,9 @@ static int vt1708B_auto_create_multi_out_ctls(struct via_spec *spec, | |||
3433 | const struct auto_pin_cfg *cfg) | 3437 | const struct auto_pin_cfg *cfg) |
3434 | { | 3438 | { |
3435 | char name[32]; | 3439 | char name[32]; |
3436 | static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; | 3440 | static const char * const chname[4] = { |
3441 | "Front", "Surround", "C/LFE", "Side" | ||
3442 | }; | ||
3437 | hda_nid_t nid_vols[] = {0x16, 0x18, 0x26, 0x27}; | 3443 | hda_nid_t nid_vols[] = {0x16, 0x18, 0x26, 0x27}; |
3438 | hda_nid_t nid, nid_vol = 0; | 3444 | hda_nid_t nid, nid_vol = 0; |
3439 | int i, err; | 3445 | int i, err; |
@@ -3861,7 +3867,9 @@ static int vt1708S_auto_create_multi_out_ctls(struct via_spec *spec, | |||
3861 | const struct auto_pin_cfg *cfg) | 3867 | const struct auto_pin_cfg *cfg) |
3862 | { | 3868 | { |
3863 | char name[32]; | 3869 | char name[32]; |
3864 | static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; | 3870 | static const char * const chname[4] = { |
3871 | "Front", "Surround", "C/LFE", "Side" | ||
3872 | }; | ||
3865 | hda_nid_t nid_vols[] = {0x10, 0x11, 0x24, 0x25}; | 3873 | hda_nid_t nid_vols[] = {0x10, 0x11, 0x24, 0x25}; |
3866 | hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x26, 0x27}; | 3874 | hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x26, 0x27}; |
3867 | hda_nid_t nid, nid_vol, nid_mute; | 3875 | hda_nid_t nid, nid_vol, nid_mute; |
@@ -4304,7 +4312,7 @@ static int vt1702_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
4304 | { | 4312 | { |
4305 | int err, i; | 4313 | int err, i; |
4306 | struct hda_input_mux *imux; | 4314 | struct hda_input_mux *imux; |
4307 | static const char *texts[] = { "ON", "OFF", NULL}; | 4315 | static const char * const texts[] = { "ON", "OFF", NULL}; |
4308 | if (!pin) | 4316 | if (!pin) |
4309 | return 0; | 4317 | return 0; |
4310 | spec->multiout.hp_nid = 0x1D; | 4318 | spec->multiout.hp_nid = 0x1D; |
@@ -4615,7 +4623,9 @@ static int vt1718S_auto_create_multi_out_ctls(struct via_spec *spec, | |||
4615 | const struct auto_pin_cfg *cfg) | 4623 | const struct auto_pin_cfg *cfg) |
4616 | { | 4624 | { |
4617 | char name[32]; | 4625 | char name[32]; |
4618 | static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; | 4626 | static const char * const chname[4] = { |
4627 | "Front", "Surround", "C/LFE", "Side" | ||
4628 | }; | ||
4619 | hda_nid_t nid_vols[] = {0x8, 0x9, 0xa, 0xb}; | 4629 | hda_nid_t nid_vols[] = {0x8, 0x9, 0xa, 0xb}; |
4620 | hda_nid_t nid_mutes[] = {0x24, 0x25, 0x26, 0x27}; | 4630 | hda_nid_t nid_mutes[] = {0x24, 0x25, 0x26, 0x27}; |
4621 | hda_nid_t nid, nid_vol, nid_mute = 0; | 4631 | hda_nid_t nid, nid_vol, nid_mute = 0; |
@@ -5064,7 +5074,9 @@ static int vt1716S_auto_create_multi_out_ctls(struct via_spec *spec, | |||
5064 | const struct auto_pin_cfg *cfg) | 5074 | const struct auto_pin_cfg *cfg) |
5065 | { | 5075 | { |
5066 | char name[32]; | 5076 | char name[32]; |
5067 | static const char *chname[3] = { "Front", "Surround", "C/LFE" }; | 5077 | static const char * const chname[3] = { |
5078 | "Front", "Surround", "C/LFE" | ||
5079 | }; | ||
5068 | hda_nid_t nid_vols[] = {0x10, 0x11, 0x25}; | 5080 | hda_nid_t nid_vols[] = {0x10, 0x11, 0x25}; |
5069 | hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x27}; | 5081 | hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x27}; |
5070 | hda_nid_t nid, nid_vol, nid_mute; | 5082 | hda_nid_t nid, nid_vol, nid_mute; |