Merge branch 'fix/hda' into for-linus

+498 -255
+5 -5
sound/pci/hda/hda_codec.c
··· 2134 2134 * This function returns zero if successful or a negative error code. 2135 2135 */ 2136 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 2139 struct snd_kcontrol *kctl; 2140 - const char **s; 2140 + const char * const *s; 2141 2141 int err; 2142 2142 2143 2143 for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++) ··· 3689 3689 * If no entries are matching, the function returns a negative value. 3690 3690 */ 3691 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 3693 const struct snd_pci_quirk *tbl) 3694 3694 { 3695 3695 if (codec->modelname && models) { ··· 3753 3753 * If no entries are matching, the function returns a negative value. 3754 3754 */ 3755 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 3757 const struct snd_pci_quirk *tbl) 3758 3758 { 3759 3759 const struct snd_pci_quirk *q; ··· 4690 4690 int check_location) 4691 4691 { 4692 4692 unsigned int def_conf; 4693 - static const char *mic_names[] = { 4693 + static const char * const mic_names[] = { 4694 4694 "Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic", 4695 4695 }; 4696 4696 int attr;
+4 -3
sound/pci/hda/hda_generic.c
··· 762 762 /* 763 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 768 struct hda_gspec *spec = codec->spec; 768 769 int i, err; ··· 781 780 static int build_output_controls(struct hda_codec *codec) 782 781 { 783 782 struct hda_gspec *spec = codec->spec; 784 - static const char *types_speaker[] = { "Speaker", "Headphone" }; 785 - static const char *types_line[] = { "Front", "Headphone" }; 783 + static const char * const types_speaker[] = { "Speaker", "Headphone" }; 784 + static const char * const types_line[] = { "Front", "Headphone" }; 786 785 787 786 switch (spec->pcm_vol_nodes) { 788 787 case 1:
+2
sound/pci/hda/hda_intel.c
··· 2809 2809 #endif 2810 2810 /* Vortex86MX */ 2811 2811 { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, 2812 + /* VMware HDAudio */ 2813 + { PCI_DEVICE(0x15ad, 0x1977), .driver_data = AZX_DRIVER_GENERIC }, 2812 2814 /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */ 2813 2815 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID), 2814 2816 .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
+3 -3
sound/pci/hda/hda_local.h
··· 140 140 struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, 141 141 const char *name); 142 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 144 int snd_hda_codec_reset(struct hda_codec *codec); 145 145 146 146 /* amp value bits */ ··· 341 341 * Misc 342 342 */ 343 343 int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, 344 - const char **modelnames, 344 + const char * const *modelnames, 345 345 const struct snd_pci_quirk *pci_list); 346 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 348 const struct snd_pci_quirk *tbl); 349 349 int snd_hda_add_new_ctls(struct hda_codec *codec, 350 350 struct snd_kcontrol_new *knew);
+1 -1
sound/pci/hda/hda_proc.c
··· 418 418 419 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 422 "D0", "D1", "D2", "D3" 423 423 }; 424 424 if (state < 4)
+192 -16
sound/pci/hda/patch_analog.c
··· 46 46 unsigned int cur_eapd; 47 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 52 /* capture */ 50 53 unsigned int num_adc_nids; 51 54 hda_nid_t *adc_nids; ··· 84 81 #endif 85 82 /* for virtual master */ 86 83 hda_nid_t vmaster_nid; 87 - const char **slave_vols; 88 - const char **slave_sws; 84 + const char * const *slave_vols; 85 + const char * const *slave_sws; 89 86 }; 90 87 91 88 /* ··· 133 130 return 0; 134 131 } 135 132 136 - static const char *ad_slave_vols[] = { 133 + static const char * const ad_slave_vols[] = { 137 134 "Front Playback Volume", 138 135 "Surround Playback Volume", 139 136 "Center Playback Volume", ··· 146 143 NULL 147 144 }; 148 145 149 - static const char *ad_slave_sws[] = { 146 + static const char * const ad_slave_sws[] = { 150 147 "Front Playback Switch", 151 148 "Surround Playback Switch", 152 149 "Center Playback Switch", ··· 159 156 NULL 160 157 }; 161 158 159 + static const char * const ad1988_6stack_fp_slave_vols[] = { 160 + "Front Playback Volume", 161 + "Surround Playback Volume", 162 + "Center Playback Volume", 163 + "LFE Playback Volume", 164 + "Side Playback Volume", 165 + "IEC958 Playback Volume", 166 + NULL 167 + }; 168 + 169 + static const char * const ad1988_6stack_fp_slave_sws[] = { 170 + "Front Playback Switch", 171 + "Surround Playback Switch", 172 + "Center Playback Switch", 173 + "LFE Playback Switch", 174 + "Side Playback Switch", 175 + "IEC958 Playback Switch", 176 + NULL 177 + }; 162 178 static void ad198x_free_kctls(struct hda_codec *codec); 163 179 164 180 #ifdef CONFIG_SND_HDA_INPUT_BEEP ··· 331 309 return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); 332 310 } 333 311 312 + static int ad198x_alt_playback_pcm_prepare(struct hda_pcm_stream *hinfo, 313 + struct hda_codec *codec, 314 + unsigned int stream_tag, 315 + unsigned int format, 316 + struct snd_pcm_substream *substream) 317 + { 318 + struct ad198x_spec *spec = codec->spec; 319 + snd_hda_codec_setup_stream(codec, spec->alt_dac_nid[0], stream_tag, 320 + 0, format); 321 + return 0; 322 + } 323 + 324 + static int ad198x_alt_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, 325 + struct hda_codec *codec, 326 + struct snd_pcm_substream *substream) 327 + { 328 + struct ad198x_spec *spec = codec->spec; 329 + snd_hda_codec_cleanup_stream(codec, spec->alt_dac_nid[0]); 330 + return 0; 331 + } 332 + 333 + static struct hda_pcm_stream ad198x_pcm_analog_alt_playback = { 334 + .substreams = 1, 335 + .channels_min = 2, 336 + .channels_max = 2, 337 + /* NID is set in ad198x_build_pcms */ 338 + .ops = { 339 + .prepare = ad198x_alt_playback_pcm_prepare, 340 + .cleanup = ad198x_alt_playback_pcm_cleanup 341 + }, 342 + }; 343 + 334 344 /* 335 345 * Digital out 336 346 */ ··· 498 444 info->stream[SNDRV_PCM_STREAM_CAPTURE] = ad198x_pcm_digital_capture; 499 445 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in_nid; 500 446 } 447 + } 448 + 449 + if (spec->alt_dac_nid && spec->stream_analog_alt_playback) { 450 + codec->num_pcms++; 451 + info = spec->pcm_rec + 2; 452 + info->name = "AD198x Headphone"; 453 + info->pcm_type = HDA_PCM_TYPE_AUDIO; 454 + info->stream[SNDRV_PCM_STREAM_PLAYBACK] = 455 + *spec->stream_analog_alt_playback; 456 + info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 457 + spec->alt_dac_nid[0]; 501 458 } 502 459 503 460 return 0; ··· 1134 1069 AD1986A_MODELS 1135 1070 }; 1136 1071 1137 - static const char *ad1986a_models[AD1986A_MODELS] = { 1072 + static const char * const ad1986a_models[AD1986A_MODELS] = { 1138 1073 [AD1986A_6STACK] = "6stack", 1139 1074 [AD1986A_3STACK] = "3stack", 1140 1075 [AD1986A_LAPTOP] = "laptop", ··· 1878 1813 AD1981_MODELS 1879 1814 }; 1880 1815 1881 - static const char *ad1981_models[AD1981_MODELS] = { 1816 + static const char * const ad1981_models[AD1981_MODELS] = { 1882 1817 [AD1981_HP] = "hp", 1883 1818 [AD1981_THINKPAD] = "thinkpad", 1884 1819 [AD1981_BASIC] = "basic", ··· 2080 2015 enum { 2081 2016 AD1988_6STACK, 2082 2017 AD1988_6STACK_DIG, 2018 + AD1988_6STACK_DIG_FP, 2083 2019 AD1988_3STACK, 2084 2020 AD1988_3STACK_DIG, 2085 2021 AD1988_LAPTOP, ··· 2111 2045 /* for AD1988A revision-2, DAC2-4 are swapped */ 2112 2046 static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { 2113 2047 0x04, 0x05, 0x0a, 0x06 2048 + }; 2049 + 2050 + static hda_nid_t ad1988_alt_dac_nid[1] = { 2051 + 0x03 2114 2052 }; 2115 2053 2116 2054 static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { ··· 2210 2140 }; 2211 2141 2212 2142 static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { 2143 + HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), 2144 + HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT), 2145 + HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT), 2146 + HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x27, 2, 2, HDA_INPUT), 2147 + HDA_BIND_MUTE("Side Playback Switch", 0x28, 2, HDA_INPUT), 2148 + HDA_BIND_MUTE("Headphone Playback Switch", 0x22, 2, HDA_INPUT), 2149 + HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT), 2150 + 2151 + HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x6, HDA_INPUT), 2152 + HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x6, HDA_INPUT), 2153 + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x0, HDA_INPUT), 2154 + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x0, HDA_INPUT), 2155 + HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x1, HDA_INPUT), 2156 + HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x1, HDA_INPUT), 2157 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x4, HDA_INPUT), 2158 + HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x4, HDA_INPUT), 2159 + 2160 + HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT), 2161 + HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), 2162 + 2163 + HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT), 2164 + HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT), 2165 + 2166 + { } /* end */ 2167 + }; 2168 + 2169 + static struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = { 2170 + HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), 2171 + 2213 2172 HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), 2214 2173 HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT), 2215 2174 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT), ··· 2492 2393 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2493 2394 /* Port-A front headphon path */ 2494 2395 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */ 2396 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2397 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2398 + {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2399 + {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 2400 + /* Port-D line-out path */ 2401 + {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2402 + {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2403 + {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2404 + {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2405 + /* Port-F surround path */ 2406 + {0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2407 + {0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2408 + {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2409 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2410 + /* Port-G CLFE path */ 2411 + {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2412 + {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2413 + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2414 + {0x24, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2415 + /* Port-H side path */ 2416 + {0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2417 + {0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2418 + {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2419 + {0x25, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2420 + /* Mono out path */ 2421 + {0x36, AC_VERB_SET_CONNECT_SEL, 0x1}, /* DAC1:04h */ 2422 + {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2423 + {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2424 + {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2425 + {0x13, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f}, /* unmute, 0dB */ 2426 + /* Port-B front mic-in path */ 2427 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 2428 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 2429 + {0x39, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 2430 + /* Port-C line-in path */ 2431 + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 2432 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 2433 + {0x3a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 2434 + {0x33, AC_VERB_SET_CONNECT_SEL, 0x0}, 2435 + /* Port-E mic-in path */ 2436 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 2437 + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 2438 + {0x3c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 2439 + {0x34, AC_VERB_SET_CONNECT_SEL, 0x0}, 2440 + /* Analog CD Input */ 2441 + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 2442 + /* Analog Mix output amp */ 2443 + {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */ 2444 + 2445 + { } 2446 + }; 2447 + 2448 + static struct hda_verb ad1988_6stack_fp_init_verbs[] = { 2449 + /* Front, Surround, CLFE, side DAC; unmute as default */ 2450 + {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2451 + {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2452 + {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2453 + {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2454 + /* Headphone; unmute as default */ 2455 + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2456 + /* Port-A front headphon path */ 2457 + {0x37, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC0:03h */ 2495 2458 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 2496 2459 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2497 2460 {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, ··· 2953 2792 const struct auto_pin_cfg *cfg) 2954 2793 { 2955 2794 char name[32]; 2956 - static const char *chname[4] = { "Front", "Surround", NULL /*CLFE*/, "Side" }; 2795 + static const char * const chname[4] = { 2796 + "Front", "Surround", NULL /*CLFE*/, "Side" 2797 + }; 2957 2798 hda_nid_t nid; 2958 2799 int i, err; 2959 2800 ··· 3237 3074 return 0; 3238 3075 } 3239 3076 3240 - 3241 3077 /* 3242 3078 */ 3243 3079 3244 - static const char *ad1988_models[AD1988_MODEL_LAST] = { 3080 + static const char * const ad1988_models[AD1988_MODEL_LAST] = { 3245 3081 [AD1988_6STACK] = "6stack", 3246 3082 [AD1988_6STACK_DIG] = "6stack-dig", 3083 + [AD1988_6STACK_DIG_FP] = "6stack-dig-fp", 3247 3084 [AD1988_3STACK] = "3stack", 3248 3085 [AD1988_3STACK_DIG] = "3stack-dig", 3249 3086 [AD1988_LAPTOP] = "laptop", ··· 3303 3140 switch (board_config) { 3304 3141 case AD1988_6STACK: 3305 3142 case AD1988_6STACK_DIG: 3143 + case AD1988_6STACK_DIG_FP: 3306 3144 spec->multiout.max_channels = 8; 3307 3145 spec->multiout.num_dacs = 4; 3308 3146 if (is_rev2(codec)) ··· 3316 3152 spec->mixers[0] = ad1988_6stack_mixers1_rev2; 3317 3153 else 3318 3154 spec->mixers[0] = ad1988_6stack_mixers1; 3319 - spec->mixers[1] = ad1988_6stack_mixers2; 3155 + if (board_config == AD1988_6STACK_DIG_FP) { 3156 + spec->mixers[1] = ad1988_6stack_fp_mixers; 3157 + spec->slave_vols = ad1988_6stack_fp_slave_vols; 3158 + spec->slave_sws = ad1988_6stack_fp_slave_sws; 3159 + spec->alt_dac_nid = ad1988_alt_dac_nid; 3160 + spec->stream_analog_alt_playback = 3161 + &ad198x_pcm_analog_alt_playback; 3162 + } else 3163 + spec->mixers[1] = ad1988_6stack_mixers2; 3320 3164 spec->num_init_verbs = 1; 3321 - spec->init_verbs[0] = ad1988_6stack_init_verbs; 3322 - if (board_config == AD1988_6STACK_DIG) { 3165 + if (board_config == AD1988_6STACK_DIG_FP) 3166 + spec->init_verbs[0] = ad1988_6stack_fp_init_verbs; 3167 + else 3168 + spec->init_verbs[0] = ad1988_6stack_init_verbs; 3169 + if ((board_config == AD1988_6STACK_DIG) || 3170 + (board_config == AD1988_6STACK_DIG_FP)) { 3323 3171 spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; 3324 3172 spec->dig_in_nid = AD1988_SPDIF_IN; 3325 3173 } ··· 3575 3399 }; 3576 3400 #endif 3577 3401 3578 - static const char *ad1884_slave_vols[] = { 3402 + static const char * const ad1884_slave_vols[] = { 3579 3403 "PCM Playback Volume", 3580 3404 "Mic Playback Volume", 3581 3405 "Mono Playback Volume", ··· 3813 3637 AD1984_MODELS 3814 3638 }; 3815 3639 3816 - static const char *ad1984_models[AD1984_MODELS] = { 3640 + static const char * const ad1984_models[AD1984_MODELS] = { 3817 3641 [AD1984_BASIC] = "basic", 3818 3642 [AD1984_THINKPAD] = "thinkpad", 3819 3643 [AD1984_DELL_DESKTOP] = "dell_desktop", ··· 4484 4308 AD1884A_MODELS 4485 4309 }; 4486 4310 4487 - static const char *ad1884a_models[AD1884A_MODELS] = { 4311 + static const char * const ad1884a_models[AD1884A_MODELS] = { 4488 4312 [AD1884A_DESKTOP] = "desktop", 4489 4313 [AD1884A_LAPTOP] = "laptop", 4490 4314 [AD1884A_MOBILE] = "mobile", ··· 4872 4696 AD1882_MODELS 4873 4697 }; 4874 4698 4875 - static const char *ad1882_models[AD1986A_MODELS] = { 4699 + static const char * const ad1882_models[AD1986A_MODELS] = { 4876 4700 [AD1882_3STACK] = "3stack", 4877 4701 [AD1882_6STACK] = "6stack", 4878 4702 };
+2 -2
sound/pci/hda/patch_cirrus.c
··· 490 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 495 static int add_mute(struct hda_codec *codec, const char *name, int index, 496 496 unsigned int pval, int dir, struct snd_kcontrol **kctlp) ··· 1156 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 1160 [CS420X_MBP53] = "mbp53", 1161 1161 [CS420X_MBP55] = "mbp55", 1162 1162 [CS420X_IMAC27] = "imac27",
+1 -1
sound/pci/hda/patch_cmedia.c
··· 608 608 /* 609 609 */ 610 610 611 - static const char *cmi9880_models[CMI_MODELS] = { 611 + static const char * const cmi9880_models[CMI_MODELS] = { 612 612 [CMI_MINIMAL] = "minimal", 613 613 [CMI_MIN_FP] = "min_fp", 614 614 [CMI_FULL] = "full",
+7 -7
sound/pci/hda/patch_conexant.c
··· 537 537 }; 538 538 #endif 539 539 540 - static const char *slave_vols[] = { 540 + static const char * const slave_vols[] = { 541 541 "Headphone Playback Volume", 542 542 "Speaker Playback Volume", 543 543 NULL 544 544 }; 545 545 546 - static const char *slave_sws[] = { 546 + static const char * const slave_sws[] = { 547 547 "Headphone Playback Switch", 548 548 "Speaker Playback Switch", 549 549 NULL ··· 1134 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 1138 [CXT5045_LAPTOP_HPSENSE] = "laptop-hpsense", 1139 1139 [CXT5045_LAPTOP_MICSENSE] = "laptop-micsense", 1140 1140 [CXT5045_LAPTOP_HPMICSENSE] = "laptop-hpmicsense", ··· 1579 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 1583 [CXT5047_LAPTOP] = "laptop", 1584 1584 [CXT5047_LAPTOP_HP] = "laptop-hp", 1585 1585 [CXT5047_LAPTOP_EAPD] = "laptop-eapd", ··· 1995 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 1999 [CXT5051_LAPTOP] = "laptop", 2000 2000 [CXT5051_HP] = "hp", 2001 2001 [CXT5051_HP_DV6736] = "hp-dv6736", ··· 3084 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 3088 [CXT5066_LAPTOP] = "laptop", 3089 3089 [CXT5066_DELL_LAPTOP] = "dell-laptop", 3090 3090 [CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5", ··· 3746 3746 struct conexant_spec *spec = codec->spec; 3747 3747 int i, err; 3748 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 3751 if (spec->dac_info_filled == 1) 3752 3752 return cx_auto_add_pb_volume(codec, spec->dac_info[0].dac,
+12
sound/pci/hda/patch_hdmi.c
··· 817 817 struct hdmi_spec *spec = codec->spec; 818 818 struct hdmi_eld *eld; 819 819 struct hda_pcm_stream *codec_pars; 820 + struct snd_pcm_runtime *runtime = substream->runtime; 820 821 unsigned int idx; 821 822 822 823 for (idx = 0; idx < spec->num_cvts; idx++) ··· 845 844 hinfo->formats = codec_pars->formats; 846 845 hinfo->maxbps = codec_pars->maxbps; 847 846 } 847 + /* store the updated parameters */ 848 + runtime->hw.channels_min = hinfo->channels_min; 849 + runtime->hw.channels_max = hinfo->channels_max; 850 + runtime->hw.formats = hinfo->formats; 851 + runtime->hw.rates = hinfo->rates; 852 + 853 + snd_pcm_hw_constraint_step(substream->runtime, 0, 854 + SNDRV_PCM_HW_PARAM_CHANNELS, 2); 848 855 return 0; 849 856 } 850 857 ··· 1247 1238 snd_pcm_hw_constraint_list(substream->runtime, 0, 1248 1239 SNDRV_PCM_HW_PARAM_CHANNELS, 1249 1240 hw_constraints_channels); 1241 + } else { 1242 + snd_pcm_hw_constraint_step(substream->runtime, 0, 1243 + SNDRV_PCM_HW_PARAM_CHANNELS, 2); 1250 1244 } 1251 1245 1252 1246 return snd_hda_multi_out_dig_open(codec, &spec->multiout);
+221 -148
sound/pci/hda/patch_realtek.c
··· 303 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 308 struct alc_spec { 307 309 /* codec parameterization */ 308 310 struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ ··· 406 404 /* for PLL fix */ 407 405 hda_nid_t pll_nid; 408 406 unsigned int pll_coef_idx, pll_coef_bit; 407 + 408 + /* fix-up list */ 409 + int fixup_id; 410 + const struct alc_fixup *fixup_list; 411 + const char *fixup_name; 409 412 }; 410 413 411 414 /* ··· 1690 1683 }; 1691 1684 1692 1685 struct alc_fixup { 1693 - unsigned int sku; 1694 - const struct alc_pincfg *pins; 1695 - const struct hda_verb *verbs; 1696 - void (*func)(struct hda_codec *codec, const struct alc_fixup *fix, 1697 - int pre_init); 1686 + int type; 1687 + bool chained; 1688 + int chain_id; 1689 + union { 1690 + unsigned int sku; 1691 + const struct alc_pincfg *pins; 1692 + const struct hda_verb *verbs; 1693 + void (*func)(struct hda_codec *codec, 1694 + const struct alc_fixup *fix, 1695 + int action); 1696 + } v; 1698 1697 }; 1699 1698 1700 - static void __alc_pick_fixup(struct hda_codec *codec, 1701 - const struct alc_fixup *fix, 1702 - const char *modelname, 1703 - int pre_init) 1704 - { 1705 - const struct alc_pincfg *cfg; 1706 - struct alc_spec *spec; 1699 + enum { 1700 + ALC_FIXUP_INVALID, 1701 + ALC_FIXUP_SKU, 1702 + ALC_FIXUP_PINS, 1703 + ALC_FIXUP_VERBS, 1704 + ALC_FIXUP_FUNC, 1705 + }; 1707 1706 1708 - cfg = fix->pins; 1709 - if (pre_init && fix->sku) { 1710 - #ifdef CONFIG_SND_DEBUG_VERBOSE 1711 - snd_printdd(KERN_INFO "hda_codec: %s: Apply sku override for %s\n", 1712 - codec->chip_name, modelname); 1713 - #endif 1714 - spec = codec->spec; 1715 - spec->cdefine.sku_cfg = fix->sku; 1716 - spec->cdefine.fixup = 1; 1717 - } 1718 - if (pre_init && cfg) { 1719 - #ifdef CONFIG_SND_DEBUG_VERBOSE 1720 - snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n", 1721 - codec->chip_name, modelname); 1722 - #endif 1723 - for (; cfg->nid; cfg++) 1724 - snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); 1725 - } 1726 - if (!pre_init && fix->verbs) { 1727 - #ifdef CONFIG_SND_DEBUG_VERBOSE 1728 - snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n", 1729 - codec->chip_name, modelname); 1730 - #endif 1731 - add_verb(codec->spec, fix->verbs); 1732 - } 1733 - if (fix->func) { 1734 - #ifdef CONFIG_SND_DEBUG_VERBOSE 1735 - snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-func for %s\n", 1736 - codec->chip_name, modelname); 1737 - #endif 1738 - fix->func(codec, fix, pre_init); 1707 + enum { 1708 + ALC_FIXUP_ACT_PRE_PROBE, 1709 + ALC_FIXUP_ACT_PROBE, 1710 + ALC_FIXUP_ACT_INIT, 1711 + }; 1712 + 1713 + static void alc_apply_fixup(struct hda_codec *codec, int action) 1714 + { 1715 + struct alc_spec *spec = codec->spec; 1716 + int id = spec->fixup_id; 1717 + const char *modelname = spec->fixup_name; 1718 + int depth = 0; 1719 + 1720 + if (!spec->fixup_list) 1721 + return; 1722 + 1723 + while (id >= 0) { 1724 + const struct alc_fixup *fix = spec->fixup_list + id; 1725 + const struct alc_pincfg *cfg; 1726 + 1727 + switch (fix->type) { 1728 + case ALC_FIXUP_SKU: 1729 + if (action != ALC_FIXUP_ACT_PRE_PROBE || !fix->v.sku) 1730 + break;; 1731 + snd_printdd(KERN_INFO "hda_codec: %s: " 1732 + "Apply sku override for %s\n", 1733 + codec->chip_name, modelname); 1734 + spec->cdefine.sku_cfg = fix->v.sku; 1735 + spec->cdefine.fixup = 1; 1736 + break; 1737 + case ALC_FIXUP_PINS: 1738 + cfg = fix->v.pins; 1739 + if (action != ALC_FIXUP_ACT_PRE_PROBE || !cfg) 1740 + break; 1741 + snd_printdd(KERN_INFO "hda_codec: %s: " 1742 + "Apply pincfg for %s\n", 1743 + codec->chip_name, modelname); 1744 + for (; cfg->nid; cfg++) 1745 + snd_hda_codec_set_pincfg(codec, cfg->nid, 1746 + cfg->val); 1747 + break; 1748 + case ALC_FIXUP_VERBS: 1749 + if (action != ALC_FIXUP_ACT_PROBE || !fix->v.verbs) 1750 + break; 1751 + snd_printdd(KERN_INFO "hda_codec: %s: " 1752 + "Apply fix-verbs for %s\n", 1753 + codec->chip_name, modelname); 1754 + add_verb(codec->spec, fix->v.verbs); 1755 + break; 1756 + case ALC_FIXUP_FUNC: 1757 + if (!fix->v.func) 1758 + break; 1759 + snd_printdd(KERN_INFO "hda_codec: %s: " 1760 + "Apply fix-func for %s\n", 1761 + codec->chip_name, modelname); 1762 + fix->v.func(codec, fix, action); 1763 + break; 1764 + default: 1765 + snd_printk(KERN_ERR "hda_codec: %s: " 1766 + "Invalid fixup type %d\n", 1767 + codec->chip_name, fix->type); 1768 + break; 1769 + } 1770 + if (!fix[id].chained) 1771 + break; 1772 + if (++depth > 10) 1773 + break; 1774 + id = fix[id].chain_id; 1739 1775 } 1740 1776 } 1741 1777 1742 1778 static void alc_pick_fixup(struct hda_codec *codec, 1743 - const struct snd_pci_quirk *quirk, 1744 - const struct alc_fixup *fix, 1745 - int pre_init) 1779 + const struct alc_model_fixup *models, 1780 + const struct snd_pci_quirk *quirk, 1781 + const struct alc_fixup *fixlist) 1746 1782 { 1747 - quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); 1748 - if (quirk) { 1749 - fix += quirk->value; 1750 - #ifdef CONFIG_SND_DEBUG_VERBOSE 1751 - __alc_pick_fixup(codec, fix, quirk->name, pre_init); 1752 - #else 1753 - __alc_pick_fixup(codec, fix, NULL, pre_init); 1754 - #endif 1755 - } 1756 - } 1783 + struct alc_spec *spec = codec->spec; 1784 + int id = -1; 1785 + const char *name = NULL; 1757 1786 1758 - static void alc_pick_fixup_model(struct hda_codec *codec, 1759 - const struct alc_model_fixup *models, 1760 - const struct snd_pci_quirk *quirk, 1761 - const struct alc_fixup *fix, 1762 - int pre_init) 1763 - { 1764 1787 if (codec->modelname && models) { 1765 1788 while (models->name) { 1766 1789 if (!strcmp(codec->modelname, models->name)) { 1767 - fix += models->id; 1790 + id = models->id; 1791 + name = models->name; 1768 1792 break; 1769 1793 } 1770 1794 models++; 1771 1795 } 1772 - __alc_pick_fixup(codec, fix, codec->modelname, pre_init); 1773 - } else { 1774 - alc_pick_fixup(codec, quirk, fix, pre_init); 1796 + } 1797 + if (id < 0) { 1798 + quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); 1799 + if (quirk) { 1800 + id = quirk->value; 1801 + #ifdef CONFIG_SND_DEBUG_VERBOSE 1802 + name = quirk->name; 1803 + #endif 1804 + } 1805 + } 1806 + 1807 + spec->fixup_id = id; 1808 + if (id >= 0) { 1809 + spec->fixup_list = fixlist; 1810 + spec->fixup_name = name; 1775 1811 } 1776 1812 } 1777 1813 ··· 2916 2866 /* 2917 2867 * slave controls for virtual master 2918 2868 */ 2919 - static const char *alc_slave_vols[] = { 2869 + static const char * const alc_slave_vols[] = { 2920 2870 "Front Playback Volume", 2921 2871 "Surround Playback Volume", 2922 2872 "Center Playback Volume", ··· 2930 2880 NULL, 2931 2881 }; 2932 2882 2933 - static const char *alc_slave_sws[] = { 2883 + static const char * const alc_slave_sws[] = { 2934 2884 "Front Playback Switch", 2935 2885 "Surround Playback Switch", 2936 2886 "Center Playback Switch", ··· 3911 3861 if (spec->init_hook) 3912 3862 spec->init_hook(codec); 3913 3863 3864 + alc_apply_fixup(codec, ALC_FIXUP_ACT_INIT); 3865 + 3914 3866 hda_call_check_power_status(codec, 0x01); 3915 3867 return 0; 3916 3868 } ··· 4611 4559 /* 4612 4560 */ 4613 4561 4614 - static const char *alc880_models[ALC880_MODEL_LAST] = { 4562 + static const char * const alc880_models[ALC880_MODEL_LAST] = { 4615 4563 [ALC880_3ST] = "3stack", 4616 4564 [ALC880_TCL_S700] = "tcl", 4617 4565 [ALC880_3ST_DIG] = "3stack-digout", ··· 5144 5092 static int alc880_auto_create_multi_out_ctls(struct alc_spec *spec, 5145 5093 const struct auto_pin_cfg *cfg) 5146 5094 { 5147 - static const char *chname[4] = { 5095 + static const char * const chname[4] = { 5148 5096 "Front", "Surround", NULL /*CLFE*/, "Side" 5149 5097 }; 5150 5098 const char *pfx = alc_get_line_out_pfx(cfg, false); ··· 7142 7090 7143 7091 static const struct alc_fixup alc260_fixups[] = { 7144 7092 [PINFIX_HP_DC5750] = { 7145 - .pins = (const struct alc_pincfg[]) { 7093 + .type = ALC_FIXUP_PINS, 7094 + .v.pins = (const struct alc_pincfg[]) { 7146 7095 { 0x11, 0x90130110 }, /* speaker */ 7147 7096 { } 7148 7097 } ··· 7158 7105 /* 7159 7106 * ALC260 configurations 7160 7107 */ 7161 - static const char *alc260_models[ALC260_MODEL_LAST] = { 7108 + static const char * const alc260_models[ALC260_MODEL_LAST] = { 7162 7109 [ALC260_BASIC] = "basic", 7163 7110 [ALC260_HP] = "hp", 7164 7111 [ALC260_HP_3013] = "hp-3013", ··· 7354 7301 board_config = ALC260_AUTO; 7355 7302 } 7356 7303 7357 - if (board_config == ALC260_AUTO) 7358 - alc_pick_fixup(codec, alc260_fixup_tbl, alc260_fixups, 1); 7304 + if (board_config == ALC260_AUTO) { 7305 + alc_pick_fixup(codec, NULL, alc260_fixup_tbl, alc260_fixups); 7306 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 7307 + } 7359 7308 7360 7309 if (board_config == ALC260_AUTO) { 7361 7310 /* automatic parse from the BIOS config */ ··· 7405 7350 set_capture_mixer(codec); 7406 7351 set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); 7407 7352 7408 - if (board_config == ALC260_AUTO) 7409 - alc_pick_fixup(codec, alc260_fixup_tbl, alc260_fixups, 0); 7353 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 7410 7354 7411 7355 spec->vmaster_nid = 0x08; 7412 7356 ··· 9781 9727 /* 9782 9728 * configuration and preset 9783 9729 */ 9784 - static const char *alc882_models[ALC882_MODEL_LAST] = { 9730 + static const char * const alc882_models[ALC882_MODEL_LAST] = { 9785 9731 [ALC882_3ST_DIG] = "3stack-dig", 9786 9732 [ALC882_6ST_DIG] = "6stack-dig", 9787 9733 [ALC882_ARIMA] = "arima", ··· 10732 10678 10733 10679 static const struct alc_fixup alc882_fixups[] = { 10734 10680 [PINFIX_ABIT_AW9D_MAX] = { 10735 - .pins = (const struct alc_pincfg[]) { 10681 + .type = ALC_FIXUP_PINS, 10682 + .v.pins = (const struct alc_pincfg[]) { 10736 10683 { 0x15, 0x01080104 }, /* side */ 10737 10684 { 0x16, 0x01011012 }, /* rear */ 10738 10685 { 0x17, 0x01016011 }, /* clfe */ ··· 10741 10686 } 10742 10687 }, 10743 10688 [PINFIX_PB_M5210] = { 10744 - .verbs = (const struct hda_verb[]) { 10689 + .type = ALC_FIXUP_VERBS, 10690 + .v.verbs = (const struct hda_verb[]) { 10745 10691 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, 10746 10692 {} 10747 10693 } 10748 10694 }, 10749 10695 [PINFIX_ACER_ASPIRE_7736] = { 10750 - .sku = ALC_FIXUP_SKU_IGNORE, 10696 + .type = ALC_FIXUP_SKU, 10697 + .v.sku = ALC_FIXUP_SKU_IGNORE, 10751 10698 }, 10752 10699 }; 10753 10700 ··· 11041 10984 board_config = ALC882_AUTO; 11042 10985 } 11043 10986 11044 - if (board_config == ALC882_AUTO) 11045 - alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1); 10987 + if (board_config == ALC882_AUTO) { 10988 + alc_pick_fixup(codec, NULL, alc882_fixup_tbl, alc882_fixups); 10989 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 10990 + } 11046 10991 11047 10992 alc_auto_parse_customize_define(codec); 11048 10993 ··· 11120 11061 if (has_cdefine_beep(codec)) 11121 11062 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 11122 11063 11123 - if (board_config == ALC882_AUTO) 11124 - alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0); 11064 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 11125 11065 11126 11066 spec->vmaster_nid = 0x0c; 11127 11067 ··· 12510 12452 12511 12453 static const struct alc_fixup alc262_fixups[] = { 12512 12454 [PINFIX_FSC_H270] = { 12513 - .pins = (const struct alc_pincfg[]) { 12455 + .type = ALC_FIXUP_PINS, 12456 + .v.pins = (const struct alc_pincfg[]) { 12514 12457 { 0x14, 0x99130110 }, /* speaker */ 12515 12458 { 0x15, 0x0221142f }, /* front HP */ 12516 12459 { 0x1b, 0x0121141f }, /* rear HP */ 12517 12460 { } 12518 - } 12519 - }, 12520 - [PINFIX_PB_M5210] = { 12521 - .verbs = (const struct hda_verb[]) { 12522 - { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, 12523 - {} 12524 12461 } 12525 12462 }, 12526 12463 }; ··· 12607 12554 /* 12608 12555 * configuration and preset 12609 12556 */ 12610 - static const char *alc262_models[ALC262_MODEL_LAST] = { 12557 + static const char * const alc262_models[ALC262_MODEL_LAST] = { 12611 12558 [ALC262_BASIC] = "basic", 12612 12559 [ALC262_HIPPO] = "hippo", 12613 12560 [ALC262_HIPPO_1] = "hippo_1", ··· 12948 12895 board_config = ALC262_AUTO; 12949 12896 } 12950 12897 12951 - if (board_config == ALC262_AUTO) 12952 - alc_pick_fixup(codec, alc262_fixup_tbl, alc262_fixups, 1); 12898 + if (board_config == ALC262_AUTO) { 12899 + alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); 12900 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 12901 + } 12953 12902 12954 12903 if (board_config == ALC262_AUTO) { 12955 12904 /* automatic parse from the BIOS config */ ··· 13021 12966 if (!spec->no_analog && has_cdefine_beep(codec)) 13022 12967 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 13023 12968 13024 - if (board_config == ALC262_AUTO) 13025 - alc_pick_fixup(codec, alc262_fixup_tbl, alc262_fixups, 0); 12969 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 13026 12970 13027 12971 spec->vmaster_nid = 0x0c; 13028 12972 ··· 13795 13741 /* 13796 13742 * configuration and preset 13797 13743 */ 13798 - static const char *alc268_models[ALC268_MODEL_LAST] = { 13744 + static const char * const alc268_models[ALC268_MODEL_LAST] = { 13799 13745 [ALC267_QUANTA_IL1] = "quanta-il1", 13800 13746 [ALC268_3ST] = "3stack", 13801 13747 [ALC268_TOSHIBA] = "toshiba", ··· 14876 14822 #endif /* SND_HDA_NEEDS_RESUME */ 14877 14823 14878 14824 static void alc269_fixup_hweq(struct hda_codec *codec, 14879 - const struct alc_fixup *fix, int pre_init) 14825 + const struct alc_fixup *fix, int action) 14880 14826 { 14881 14827 int coef; 14882 14828 14829 + if (action != ALC_FIXUP_ACT_INIT) 14830 + return; 14883 14831 coef = alc_read_coef_idx(codec, 0x1e); 14884 14832 alc_write_coef_idx(codec, 0x1e, coef | 0x80); 14885 14833 } 14886 14834 14887 14835 enum { 14888 14836 ALC269_FIXUP_SONY_VAIO, 14889 - ALC275_FIX_SONY_VAIO_GPIO2, 14837 + ALC275_FIXUP_SONY_VAIO_GPIO2, 14890 14838 ALC269_FIXUP_DELL_M101Z, 14891 14839 ALC269_FIXUP_SKU_IGNORE, 14892 14840 ALC269_FIXUP_ASUS_G73JW, ··· 14898 14842 14899 14843 static const struct alc_fixup alc269_fixups[] = { 14900 14844 [ALC269_FIXUP_SONY_VAIO] = { 14901 - .verbs = (const struct hda_verb[]) { 14845 + .type = ALC_FIXUP_VERBS, 14846 + .v.verbs = (const struct hda_verb[]) { 14902 14847 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, 14903 14848 {} 14904 14849 } 14905 14850 }, 14906 - [ALC275_FIX_SONY_VAIO_GPIO2] = { 14907 - .verbs = (const struct hda_verb[]) { 14851 + [ALC275_FIXUP_SONY_VAIO_GPIO2] = { 14852 + .type = ALC_FIXUP_VERBS, 14853 + .v.verbs = (const struct hda_verb[]) { 14908 14854 {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, 14909 14855 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, 14910 14856 {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, 14911 - {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, 14912 14857 { } 14913 - } 14858 + }, 14859 + .chained = true, 14860 + .chain_id = ALC269_FIXUP_SONY_VAIO 14914 14861 }, 14915 14862 [ALC269_FIXUP_DELL_M101Z] = { 14916 - .verbs = (const struct hda_verb[]) { 14863 + .type = ALC_FIXUP_VERBS, 14864 + .v.verbs = (const struct hda_verb[]) { 14917 14865 /* Enables internal speaker */ 14918 14866 {0x20, AC_VERB_SET_COEF_INDEX, 13}, 14919 14867 {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, ··· 14925 14865 } 14926 14866 }, 14927 14867 [ALC269_FIXUP_SKU_IGNORE] = { 14928 - .sku = ALC_FIXUP_SKU_IGNORE, 14868 + .type = ALC_FIXUP_SKU, 14869 + .v.sku = ALC_FIXUP_SKU_IGNORE, 14929 14870 }, 14930 14871 [ALC269_FIXUP_ASUS_G73JW] = { 14931 - .pins = (const struct alc_pincfg[]) { 14872 + .type = ALC_FIXUP_PINS, 14873 + .v.pins = (const struct alc_pincfg[]) { 14932 14874 { 0x17, 0x99130111 }, /* subwoofer */ 14933 14875 { } 14934 14876 } 14935 14877 }, 14936 14878 [ALC269_FIXUP_LENOVO_EAPD] = { 14937 - .verbs = (const struct hda_verb[]) { 14879 + .type = ALC_FIXUP_VERBS, 14880 + .v.verbs = (const struct hda_verb[]) { 14938 14881 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, 14939 14882 {} 14940 14883 } 14941 14884 }, 14942 14885 [ALC275_FIXUP_SONY_HWEQ] = { 14943 - .func = alc269_fixup_hweq, 14944 - .verbs = (const struct hda_verb[]) { 14945 - {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, 14946 - {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, 14947 - {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, 14948 - {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, 14949 - { } 14950 - } 14886 + .type = ALC_FIXUP_FUNC, 14887 + .v.func = alc269_fixup_hweq, 14888 + .chained = true, 14889 + .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 14951 14890 } 14952 14891 }; 14953 14892 14954 14893 static struct snd_pci_quirk alc269_fixup_tbl[] = { 14955 - SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), 14894 + SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), 14956 14895 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 14957 14896 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 14958 14897 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), ··· 14967 14908 /* 14968 14909 * configuration and preset 14969 14910 */ 14970 - static const char *alc269_models[ALC269_MODEL_LAST] = { 14911 + static const char * const alc269_models[ALC269_MODEL_LAST] = { 14971 14912 [ALC269_BASIC] = "basic", 14972 14913 [ALC269_QUANTA_FL1] = "quanta", 14973 14914 [ALC269_AMIC] = "laptop-amic", ··· 15243 15184 board_config = ALC269_AUTO; 15244 15185 } 15245 15186 15246 - if (board_config == ALC269_AUTO) 15247 - alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 1); 15187 + if (board_config == ALC269_AUTO) { 15188 + alc_pick_fixup(codec, NULL, alc269_fixup_tbl, alc269_fixups); 15189 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 15190 + } 15248 15191 15249 15192 if (board_config == ALC269_AUTO) { 15250 15193 /* automatic parse from the BIOS config */ ··· 15307 15246 if (has_cdefine_beep(codec)) 15308 15247 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 15309 15248 15310 - if (board_config == ALC269_AUTO) 15311 - alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 0); 15249 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 15312 15250 15313 15251 spec->vmaster_nid = 0x02; 15314 15252 ··· 16010 15950 const struct auto_pin_cfg *cfg) 16011 15951 { 16012 15952 struct alc_spec *spec = codec->spec; 16013 - static const char *chname[4] = { 15953 + static const char * const chname[4] = { 16014 15954 "Front", "Surround", NULL /*CLFE*/, "Side" 16015 15955 }; 16016 15956 const char *pfx = alc_get_line_out_pfx(cfg, true); ··· 16216 16156 /* 16217 16157 * configuration and preset 16218 16158 */ 16219 - static const char *alc861_models[ALC861_MODEL_LAST] = { 16159 + static const char * const alc861_models[ALC861_MODEL_LAST] = { 16220 16160 [ALC861_3ST] = "3stack", 16221 16161 [ALC660_3ST] = "3stack-660", 16222 16162 [ALC861_3ST_DIG] = "3stack-dig", ··· 16366 16306 16367 16307 static const struct alc_fixup alc861_fixups[] = { 16368 16308 [PINFIX_FSC_AMILO_PI1505] = { 16369 - .pins = (const struct alc_pincfg[]) { 16309 + .type = ALC_FIXUP_PINS, 16310 + .v.pins = (const struct alc_pincfg[]) { 16370 16311 { 0x0b, 0x0221101f }, /* HP */ 16371 16312 { 0x0f, 0x90170310 }, /* speaker */ 16372 16313 { } ··· 16402 16341 board_config = ALC861_AUTO; 16403 16342 } 16404 16343 16405 - if (board_config == ALC861_AUTO) 16406 - alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1); 16344 + if (board_config == ALC861_AUTO) { 16345 + alc_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); 16346 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 16347 + } 16407 16348 16408 16349 if (board_config == ALC861_AUTO) { 16409 16350 /* automatic parse from the BIOS config */ ··· 16442 16379 16443 16380 spec->vmaster_nid = 0x03; 16444 16381 16445 - if (board_config == ALC861_AUTO) 16446 - alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0); 16382 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 16447 16383 16448 16384 codec->patch_ops = alc_patch_ops; 16449 16385 if (board_config == ALC861_AUTO) { ··· 16919 16857 /* 16920 16858 * configuration and preset 16921 16859 */ 16922 - static const char *alc861vd_models[ALC861VD_MODEL_LAST] = { 16860 + static const char * const alc861vd_models[ALC861VD_MODEL_LAST] = { 16923 16861 [ALC660VD_3ST] = "3stack-660", 16924 16862 [ALC660VD_3ST_DIG] = "3stack-660-digout", 16925 16863 [ALC660VD_ASUS_V1S] = "asus-v1s", ··· 17139 17077 static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec, 17140 17078 const struct auto_pin_cfg *cfg) 17141 17079 { 17142 - static const char *chname[4] = {"Front", "Surround", "CLFE", "Side"}; 17080 + static const char * const chname[4] = { 17081 + "Front", "Surround", "CLFE", "Side" 17082 + }; 17143 17083 const char *pfx = alc_get_line_out_pfx(cfg, true); 17144 17084 hda_nid_t nid_v, nid_s; 17145 17085 int i, err; ··· 17326 17262 /* reset GPIO1 */ 17327 17263 static const struct alc_fixup alc861vd_fixups[] = { 17328 17264 [ALC660VD_FIX_ASUS_GPIO1] = { 17329 - .verbs = (const struct hda_verb[]) { 17265 + .type = ALC_FIXUP_VERBS, 17266 + .v.verbs = (const struct hda_verb[]) { 17330 17267 {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, 17331 17268 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, 17332 17269 {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, ··· 17362 17297 board_config = ALC861VD_AUTO; 17363 17298 } 17364 17299 17365 - if (board_config == ALC861VD_AUTO) 17366 - alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1); 17300 + if (board_config == ALC861VD_AUTO) { 17301 + alc_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); 17302 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 17303 + } 17367 17304 17368 17305 if (board_config == ALC861VD_AUTO) { 17369 17306 /* automatic parse from the BIOS config */ ··· 17413 17346 17414 17347 spec->vmaster_nid = 0x02; 17415 17348 17416 - if (board_config == ALC861VD_AUTO) 17417 - alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0); 17349 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 17418 17350 17419 17351 codec->patch_ops = alc_patch_ops; 17420 17352 ··· 18696 18630 /* 18697 18631 * configuration and preset 18698 18632 */ 18699 - static const char *alc662_models[ALC662_MODEL_LAST] = { 18633 + static const char * const alc662_models[ALC662_MODEL_LAST] = { 18700 18634 [ALC662_3ST_2ch_DIG] = "3stack-dig", 18701 18635 [ALC662_3ST_6ch_DIG] = "3stack-6ch-dig", 18702 18636 [ALC662_3ST_6ch] = "3stack-6ch", ··· 19211 19145 const struct auto_pin_cfg *cfg) 19212 19146 { 19213 19147 struct alc_spec *spec = codec->spec; 19214 - static const char *chname[4] = { 19148 + static const char * const chname[4] = { 19215 19149 "Front", "Surround", NULL /*CLFE*/, "Side" 19216 19150 }; 19217 19151 const char *pfx = alc_get_line_out_pfx(cfg, true); ··· 19444 19378 } 19445 19379 19446 19380 static void alc272_fixup_mario(struct hda_codec *codec, 19447 - const struct alc_fixup *fix, int pre_init) { 19381 + const struct alc_fixup *fix, int action) 19382 + { 19383 + if (action != ALC_FIXUP_ACT_PROBE) 19384 + return; 19448 19385 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, 19449 19386 (0x3b << AC_AMPCAP_OFFSET_SHIFT) | 19450 19387 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | ··· 19465 19396 19466 19397 static const struct alc_fixup alc662_fixups[] = { 19467 19398 [ALC662_FIXUP_ASPIRE] = { 19468 - .pins = (const struct alc_pincfg[]) { 19399 + .type = ALC_FIXUP_PINS, 19400 + .v.pins = (const struct alc_pincfg[]) { 19469 19401 { 0x15, 0x99130112 }, /* subwoofer */ 19470 19402 { } 19471 19403 } 19472 19404 }, 19473 19405 [ALC662_FIXUP_IDEAPAD] = { 19474 - .pins = (const struct alc_pincfg[]) { 19406 + .type = ALC_FIXUP_PINS, 19407 + .v.pins = (const struct alc_pincfg[]) { 19475 19408 { 0x17, 0x99130112 }, /* subwoofer */ 19476 19409 { } 19477 19410 } 19478 19411 }, 19479 19412 [ALC272_FIXUP_MARIO] = { 19480 - .func = alc272_fixup_mario, 19413 + .type = ALC_FIXUP_FUNC, 19414 + .v.func = alc272_fixup_mario, 19481 19415 } 19482 19416 }; 19483 19417 ··· 19534 19462 } 19535 19463 19536 19464 if (board_config == ALC662_AUTO) { 19537 - alc_pick_fixup(codec, alc662_fixup_tbl, alc662_fixups, 1); 19465 + alc_pick_fixup(codec, alc662_fixup_models, 19466 + alc662_fixup_tbl, alc662_fixups); 19467 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 19538 19468 /* automatic parse from the BIOS config */ 19539 19469 err = alc662_parse_auto_config(codec); 19540 19470 if (err < 0) { ··· 19594 19520 } 19595 19521 spec->vmaster_nid = 0x02; 19596 19522 19523 + alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 19524 + 19597 19525 codec->patch_ops = alc_patch_ops; 19598 - if (board_config == ALC662_AUTO) { 19526 + if (board_config == ALC662_AUTO) 19599 19527 spec->init_hook = alc662_auto_init; 19600 - alc_pick_fixup_model(codec, alc662_fixup_models, 19601 - alc662_fixup_tbl, alc662_fixups, 0); 19602 - } 19603 19528 19604 19529 alc_init_jacks(codec); 19605 19530 ··· 19986 19913 /* 19987 19914 * configuration and preset 19988 19915 */ 19989 - static const char *alc680_models[ALC680_MODEL_LAST] = { 19916 + static const char * const alc680_models[ALC680_MODEL_LAST] = { 19990 19917 [ALC680_BASE] = "base", 19991 19918 [ALC680_AUTO] = "auto", 19992 19919 };
+28 -61
sound/pci/hda/patch_sigmatel.c
··· 266 266 struct sigmatel_mic_route int_mic; 267 267 struct sigmatel_mic_route dock_mic; 268 268 269 - const char **spdif_labels; 269 + const char * const *spdif_labels; 270 270 271 271 hda_nid_t dig_in_nid; 272 272 hda_nid_t mono_nid; ··· 524 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 528 "Digital Playback", "ADAT", "Analog Mux 1", 529 529 "Analog Mux 2", "Analog Mux 3" 530 530 }; ··· 1062 1062 .put = stac92xx_smux_enum_put, 1063 1063 }; 1064 1064 1065 - static const char *slave_vols[] = { 1065 + static const char * const slave_vols[] = { 1066 1066 "Front Playback Volume", 1067 1067 "Surround Playback Volume", 1068 1068 "Center Playback Volume", ··· 1073 1073 NULL 1074 1074 }; 1075 1075 1076 - static const char *slave_sws[] = { 1076 + static const char * const slave_sws[] = { 1077 1077 "Front Playback Switch", 1078 1078 "Surround Playback Switch", 1079 1079 "Center Playback Switch", ··· 1354 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 1358 [STAC_AUTO] = "auto", 1359 1359 [STAC_REF] = "ref", 1360 1360 [STAC_9200_OQO] = "oqo", ··· 1500 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 1504 [STAC_925x_AUTO] = "auto", 1505 1505 [STAC_REF] = "ref", 1506 1506 [STAC_M1] = "m1", ··· 1574 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 1578 [STAC_92HD73XX_AUTO] = "auto", 1579 1579 [STAC_92HD73XX_NO_JD] = "no-jd", 1580 1580 [STAC_92HD73XX_REF] = "ref", ··· 1660 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 1664 [STAC_92HD83XXX_AUTO] = "auto", 1665 1665 [STAC_92HD83XXX_REF] = "ref", 1666 1666 [STAC_92HD83XXX_PWR_REF] = "mic-ref", ··· 1722 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 1726 [STAC_92HD71BXX_AUTO] = "auto", 1727 1727 [STAC_92HD71BXX_REF] = "ref", 1728 1728 [STAC_DELL_M4_1] = "dell-m4-1", ··· 1915 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 1919 [STAC_922X_AUTO] = "auto", 1920 1920 [STAC_D945_REF] = "ref", 1921 1921 [STAC_D945GTP5] = "5stack", ··· 2077 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 2081 [STAC_927X_AUTO] = "auto", 2082 2082 [STAC_D965_REF_NO_JD] = "ref-no-jd", 2083 2083 [STAC_D965_REF] = "ref", ··· 2180 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 2184 [STAC_9205_AUTO] = "auto", 2185 2185 [STAC_9205_REF] = "ref", 2186 2186 [STAC_9205_DELL_M42] = "dell-m42", ··· 3123 3123 int type) 3124 3124 { 3125 3125 struct sigmatel_spec *spec = codec->spec; 3126 - static const char *chname[4] = { 3126 + static const char * const chname[4] = { 3127 3127 "Front", "Surround", NULL /*CLFE*/, "Side" 3128 3128 }; 3129 3129 hda_nid_t nid; ··· 3256 3256 } 3257 3257 3258 3258 /* labels for mono mux outputs */ 3259 - static const char *stac92xx_mono_labels[4] = { 3259 + static const char * const stac92xx_mono_labels[4] = { 3260 3260 "DAC0", "DAC1", "Mixer", "DAC2" 3261 3261 }; 3262 3262 ··· 3380 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 3384 "Digital Playback", "Analog Mux 1", "Analog Mux 2", 3385 3385 }; 3386 3386 ··· 3388 3388 { 3389 3389 struct sigmatel_spec *spec = codec->spec; 3390 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 3392 int i, num_cons; 3393 3393 hda_nid_t con_lst[HDA_MAX_NUM_INPUTS]; 3394 3394 ··· 3409 3409 } 3410 3410 3411 3411 /* labels for dmic mux inputs */ 3412 - static const char *stac92xx_dmic_labels[5] = { 3412 + static const char * const stac92xx_dmic_labels[5] = { 3413 3413 "Analog Inputs", "Digital Mic 1", "Digital Mic 2", 3414 3414 "Digital Mic 3", "Digital Mic 4" 3415 3415 }; ··· 5333 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 5338 if (codec->vendor_id != 0x111d7605 && 5339 5339 codec->vendor_id != 0x111d76d1) ··· 5348 5348 case 0x103c161d: 5349 5349 case 0x103c161e: 5350 5350 case 0x103c161f: 5351 - case 0x103c1620: 5352 - case 0x103c1621: 5353 - case 0x103c1622: 5354 - case 0x103c1623: 5355 5351 5356 5352 case 0x103c162a: 5357 5353 case 0x103c162b: ··· 5356 5360 case 0x103c1631: 5357 5361 5358 5362 case 0x103c1633: 5359 - 5363 + case 0x103c1634: 5360 5364 case 0x103c1635: 5361 - 5362 - case 0x103c164f: 5363 - 5364 - case 0x103c1676: 5365 - case 0x103c1677: 5366 - case 0x103c1678: 5367 - case 0x103c1679: 5368 - case 0x103c167a: 5369 - case 0x103c167b: 5370 - case 0x103c167c: 5371 - case 0x103c167d: 5372 - case 0x103c167e: 5373 - case 0x103c167f: 5374 - case 0x103c1680: 5375 - case 0x103c1681: 5376 - case 0x103c1682: 5377 - case 0x103c1683: 5378 - case 0x103c1684: 5379 - case 0x103c1685: 5380 - case 0x103c1686: 5381 - case 0x103c1687: 5382 - case 0x103c1688: 5383 - case 0x103c1689: 5384 - case 0x103c168a: 5385 - case 0x103c168b: 5386 - case 0x103c168c: 5387 - case 0x103c168d: 5388 - case 0x103c168e: 5389 - case 0x103c168f: 5390 - case 0x103c1690: 5391 - case 0x103c1691: 5392 - case 0x103c1692: 5393 5365 5394 5366 case 0x103c3587: 5395 5367 case 0x103c3588: ··· 5366 5402 5367 5403 case 0x103c3667: 5368 5404 case 0x103c3668: 5369 - /* set BTL amp level to 13.43dB for louder speaker output */ 5370 - return snd_hda_codec_write_cache(codec, codec->afg, 0, 5371 - 0x7F4, 0x14); 5405 + case 0x103c3669: 5406 + 5407 + return 1; 5372 5408 } 5373 5409 return 0; 5374 5410 } ··· 5383 5419 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5384 5420 if (spec == NULL) 5385 5421 return -ENOMEM; 5422 + 5423 + if (hp_bnb2011_with_dock(codec)) { 5424 + snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f); 5425 + snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); 5426 + } 5386 5427 5387 5428 /* reset pin power-down; Windows may leave these bits after reboot */ 5388 5429 snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0); ··· 5514 5545 snd_hda_codec_write_cache(codec, 0xF, 0, 5515 5546 AC_VERB_SET_CONNECT_SEL, num_dacs); 5516 5547 } 5517 - 5518 - stac92hd83xxx_set_system_btl_amp(codec); 5519 5548 5520 5549 codec->proc_widget_hook = stac92hd_proc_hook; 5521 5550 ··· 6237 6270 0x90a7013e 6238 6271 }; 6239 6272 6240 - static const char *stac9872_models[STAC_9872_MODELS] = { 6273 + static const char * const stac9872_models[STAC_9872_MODELS] = { 6241 6274 [STAC_9872_AUTO] = "auto", 6242 6275 [STAC_9872_VAIO] = "vaio", 6243 6276 };
+20 -8
sound/pci/hda/patch_via.c
··· 2281 2281 const struct auto_pin_cfg *cfg) 2282 2282 { 2283 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 2287 hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b}; 2286 2288 int i, err; 2287 2289 ··· 2372 2370 { 2373 2371 int i; 2374 2372 struct hda_input_mux *imux = &spec->private_imux[1]; 2375 - static const char *texts[] = { "OFF", "ON", NULL}; 2373 + static const char * const texts[] = { "OFF", "ON", NULL}; 2376 2374 2377 2375 /* for hp mode select */ 2378 2376 for (i = 0; texts[i]; i++) ··· 2892 2890 const struct auto_pin_cfg *cfg) 2893 2891 { 2894 2892 char name[32]; 2895 - static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; 2893 + static const char * const chname[4] = { 2894 + "Front", "Surround", "C/LFE", "Side" 2895 + }; 2896 2896 hda_nid_t nid, nid_vol, nid_vols[] = {0x18, 0x1a, 0x1b, 0x29}; 2897 2897 int i, err; 2898 2898 ··· 3437 3433 const struct auto_pin_cfg *cfg) 3438 3434 { 3439 3435 char name[32]; 3440 - static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; 3436 + static const char * const chname[4] = { 3437 + "Front", "Surround", "C/LFE", "Side" 3438 + }; 3441 3439 hda_nid_t nid_vols[] = {0x16, 0x18, 0x26, 0x27}; 3442 3440 hda_nid_t nid, nid_vol = 0; 3443 3441 int i, err; ··· 3867 3861 const struct auto_pin_cfg *cfg) 3868 3862 { 3869 3863 char name[32]; 3870 - static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; 3864 + static const char * const chname[4] = { 3865 + "Front", "Surround", "C/LFE", "Side" 3866 + }; 3871 3867 hda_nid_t nid_vols[] = {0x10, 0x11, 0x24, 0x25}; 3872 3868 hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x26, 0x27}; 3873 3869 hda_nid_t nid, nid_vol, nid_mute; ··· 4312 4304 { 4313 4305 int err, i; 4314 4306 struct hda_input_mux *imux; 4315 - static const char *texts[] = { "ON", "OFF", NULL}; 4307 + static const char * const texts[] = { "ON", "OFF", NULL}; 4316 4308 if (!pin) 4317 4309 return 0; 4318 4310 spec->multiout.hp_nid = 0x1D; ··· 4623 4615 const struct auto_pin_cfg *cfg) 4624 4616 { 4625 4617 char name[32]; 4626 - static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; 4618 + static const char * const chname[4] = { 4619 + "Front", "Surround", "C/LFE", "Side" 4620 + }; 4627 4621 hda_nid_t nid_vols[] = {0x8, 0x9, 0xa, 0xb}; 4628 4622 hda_nid_t nid_mutes[] = {0x24, 0x25, 0x26, 0x27}; 4629 4623 hda_nid_t nid, nid_vol, nid_mute = 0; ··· 5074 5064 const struct auto_pin_cfg *cfg) 5075 5065 { 5076 5066 char name[32]; 5077 - static const char *chname[3] = { "Front", "Surround", "C/LFE" }; 5067 + static const char * const chname[3] = { 5068 + "Front", "Surround", "C/LFE" 5069 + }; 5078 5070 hda_nid_t nid_vols[] = {0x10, 0x11, 0x25}; 5079 5071 hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x27}; 5080 5072 hda_nid_t nid, nid_vol, nid_mute;