diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 346 |
1 files changed, 174 insertions, 172 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 2942d2a9ea1..696ac259030 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -30,7 +30,7 @@ #include "hda_beep.h" struct ad198x_spec { - struct snd_kcontrol_new *mixers[6]; + const struct snd_kcontrol_new *mixers[6]; int num_mixers; unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */ const struct hda_verb *init_verbs[6]; /* initialization verbs @@ -46,17 +46,17 @@ struct ad198x_spec { unsigned int cur_eapd; unsigned int need_dac_fix; - hda_nid_t *alt_dac_nid; - struct hda_pcm_stream *stream_analog_alt_playback; + const hda_nid_t *alt_dac_nid; + const struct hda_pcm_stream *stream_analog_alt_playback; /* capture */ unsigned int num_adc_nids; - hda_nid_t *adc_nids; + const hda_nid_t *adc_nids; hda_nid_t dig_in_nid; /* digital-in NID; optional */ /* capture source */ const struct hda_input_mux *input_mux; - hda_nid_t *capsrc_nids; + const hda_nid_t *capsrc_nids; unsigned int cur_mux[3]; /* channel model */ @@ -182,13 +182,13 @@ static void ad198x_free_kctls(struct hda_codec *codec); #ifdef CONFIG_SND_HDA_INPUT_BEEP /* additional beep mixers; the actual parameters are overwritten at build */ -static struct snd_kcontrol_new ad_beep_mixer[] = { +static const struct snd_kcontrol_new ad_beep_mixer[] = { HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_OUTPUT), HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_OUTPUT), { } /* end */ }; -static struct snd_kcontrol_new ad_beep2_mixer[] = { +static const struct snd_kcontrol_new ad_beep2_mixer[] = { HDA_CODEC_VOLUME("Digital Beep Playback Volume", 0, 0, HDA_OUTPUT), HDA_CODEC_MUTE_BEEP("Digital Beep Playback Switch", 0, 0, HDA_OUTPUT), { } /* end */ @@ -231,7 +231,7 @@ static int ad198x_build_controls(struct hda_codec *codec) /* create beep controls if needed */ #ifdef CONFIG_SND_HDA_INPUT_BEEP if (spec->beep_amp) { - struct snd_kcontrol_new *knew; + const struct snd_kcontrol_new *knew; knew = spec->analog_beep ? ad_beep2_mixer : ad_beep_mixer; for ( ; knew->name; knew++) { struct snd_kcontrol *kctl; @@ -331,7 +331,7 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); } -static struct hda_pcm_stream ad198x_pcm_analog_alt_playback = { +static const struct hda_pcm_stream ad198x_pcm_analog_alt_playback = { .substreams = 1, .channels_min = 2, .channels_max = 2, @@ -403,7 +403,7 @@ static int ad198x_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, /* */ -static struct hda_pcm_stream ad198x_pcm_analog_playback = { +static const struct hda_pcm_stream ad198x_pcm_analog_playback = { .substreams = 1, .channels_min = 2, .channels_max = 6, /* changed later */ @@ -415,7 +415,7 @@ static struct hda_pcm_stream ad198x_pcm_analog_playback = { }, }; -static struct hda_pcm_stream ad198x_pcm_analog_capture = { +static const struct hda_pcm_stream ad198x_pcm_analog_capture = { .substreams = 1, .channels_min = 2, .channels_max = 2, @@ -426,7 +426,7 @@ static struct hda_pcm_stream ad198x_pcm_analog_capture = { }, }; -static struct hda_pcm_stream ad198x_pcm_digital_playback = { +static const struct hda_pcm_stream ad198x_pcm_digital_playback = { .substreams = 1, .channels_min = 2, .channels_max = 2, @@ -439,7 +439,7 @@ static struct hda_pcm_stream ad198x_pcm_digital_playback = { }, }; -static struct hda_pcm_stream ad198x_pcm_digital_capture = { +static const struct hda_pcm_stream ad198x_pcm_digital_capture = { .substreams = 1, .channels_min = 2, .channels_max = 2, @@ -489,11 +489,6 @@ static int ad198x_build_pcms(struct hda_codec *codec) return 0; } -static inline void ad198x_shutup(struct hda_codec *codec) -{ - snd_hda_shutup_pins(codec); -} - static void ad198x_free_kctls(struct hda_codec *codec) { struct ad198x_spec *spec = codec->spec; @@ -547,6 +542,12 @@ static void ad198x_power_eapd(struct hda_codec *codec) } } +static void ad198x_shutup(struct hda_codec *codec) +{ + snd_hda_shutup_pins(codec); + ad198x_power_eapd(codec); +} + static void ad198x_free(struct hda_codec *codec) { struct ad198x_spec *spec = codec->spec; @@ -564,12 +565,11 @@ static void ad198x_free(struct hda_codec *codec) static int ad198x_suspend(struct hda_codec *codec, pm_message_t state) { ad198x_shutup(codec); - ad198x_power_eapd(codec); return 0; } #endif -static struct hda_codec_ops ad198x_patch_ops = { +static const struct hda_codec_ops ad198x_patch_ops = { .build_controls = ad198x_build_controls, .build_pcms = ad198x_build_pcms, .init = ad198x_init, @@ -639,13 +639,13 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol, #define AD1986A_CLFE_DAC 0x05 #define AD1986A_ADC 0x06 -static hda_nid_t ad1986a_dac_nids[3] = { +static const hda_nid_t ad1986a_dac_nids[3] = { AD1986A_FRONT_DAC, AD1986A_SURR_DAC, AD1986A_CLFE_DAC }; -static hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC }; -static hda_nid_t ad1986a_capsrc_nids[1] = { 0x12 }; +static const hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC }; +static const hda_nid_t ad1986a_capsrc_nids[1] = { 0x12 }; -static struct hda_input_mux ad1986a_capture_source = { +static const struct hda_input_mux ad1986a_capture_source = { .num_items = 7, .items = { { "Mic", 0x0 }, @@ -659,7 +659,7 @@ static struct hda_input_mux ad1986a_capture_source = { }; -static struct hda_bind_ctls ad1986a_bind_pcm_vol = { +static const struct hda_bind_ctls ad1986a_bind_pcm_vol = { .ops = &snd_hda_bind_vol, .values = { HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT), @@ -669,7 +669,7 @@ static struct hda_bind_ctls ad1986a_bind_pcm_vol = { }, }; -static struct hda_bind_ctls ad1986a_bind_pcm_sw = { +static const struct hda_bind_ctls ad1986a_bind_pcm_sw = { .ops = &snd_hda_bind_sw, .values = { HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT), @@ -682,7 +682,7 @@ static struct hda_bind_ctls ad1986a_bind_pcm_sw = { /* * mixers */ -static struct snd_kcontrol_new ad1986a_mixers[] = { +static const struct snd_kcontrol_new ad1986a_mixers[] = { /* * bind volumes/mutes of 3 DACs as a single PCM control for simplicity */ @@ -723,7 +723,7 @@ static struct snd_kcontrol_new ad1986a_mixers[] = { }; /* additional mixers for 3stack mode */ -static struct snd_kcontrol_new ad1986a_3st_mixers[] = { +static const struct snd_kcontrol_new ad1986a_3st_mixers[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Channel Mode", @@ -735,10 +735,10 @@ static struct snd_kcontrol_new ad1986a_3st_mixers[] = { }; /* laptop model - 2ch only */ -static hda_nid_t ad1986a_laptop_dac_nids[1] = { AD1986A_FRONT_DAC }; +static const hda_nid_t ad1986a_laptop_dac_nids[1] = { AD1986A_FRONT_DAC }; /* master controls both pins 0x1a and 0x1b */ -static struct hda_bind_ctls ad1986a_laptop_master_vol = { +static const struct hda_bind_ctls ad1986a_laptop_master_vol = { .ops = &snd_hda_bind_vol, .values = { HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), @@ -747,7 +747,7 @@ static struct hda_bind_ctls ad1986a_laptop_master_vol = { }, }; -static struct hda_bind_ctls ad1986a_laptop_master_sw = { +static const struct hda_bind_ctls ad1986a_laptop_master_sw = { .ops = &snd_hda_bind_sw, .values = { HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), @@ -756,7 +756,7 @@ static struct hda_bind_ctls ad1986a_laptop_master_sw = { }, }; -static struct snd_kcontrol_new ad1986a_laptop_mixers[] = { +static const struct snd_kcontrol_new ad1986a_laptop_mixers[] = { HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), @@ -787,7 +787,7 @@ static struct snd_kcontrol_new ad1986a_laptop_mixers[] = { /* laptop-eapd model - 2ch only */ -static struct hda_input_mux ad1986a_laptop_eapd_capture_source = { +static const struct hda_input_mux ad1986a_laptop_eapd_capture_source = { .num_items = 3, .items = { { "Mic", 0x0 }, @@ -796,7 +796,7 @@ static struct hda_input_mux ad1986a_laptop_eapd_capture_source = { }, }; -static struct hda_input_mux ad1986a_automic_capture_source = { +static const struct hda_input_mux ad1986a_automic_capture_source = { .num_items = 2, .items = { { "Mic", 0x0 }, @@ -804,13 +804,13 @@ static struct hda_input_mux ad1986a_automic_capture_source = { }, }; -static struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = { +static const struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = { HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), { } /* end */ }; -static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { +static const struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), @@ -837,7 +837,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = { +static const struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = { HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT), HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT), { } /* end */ @@ -931,7 +931,7 @@ static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { +static const struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -949,7 +949,7 @@ static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { /* * initialization verbs */ -static struct hda_verb ad1986a_init_verbs[] = { +static const struct hda_verb ad1986a_init_verbs[] = { /* Front, Surround, CLFE DAC; mute as default */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, @@ -1004,7 +1004,7 @@ static struct hda_verb ad1986a_init_verbs[] = { { } /* end */ }; -static struct hda_verb ad1986a_ch2_init[] = { +static const struct hda_verb ad1986a_ch2_init[] = { /* Surround out -> Line In */ { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, /* Line-in selectors */ @@ -1016,7 +1016,7 @@ static struct hda_verb ad1986a_ch2_init[] = { { } /* end */ }; -static struct hda_verb ad1986a_ch4_init[] = { +static const struct hda_verb ad1986a_ch4_init[] = { /* Surround out -> Surround */ { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 }, @@ -1026,7 +1026,7 @@ static struct hda_verb ad1986a_ch4_init[] = { { } /* end */ }; -static struct hda_verb ad1986a_ch6_init[] = { +static const struct hda_verb ad1986a_ch6_init[] = { /* Surround out -> Surround out */ { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 }, @@ -1036,19 +1036,19 @@ static struct hda_verb ad1986a_ch6_init[] = { { } /* end */ }; -static struct hda_channel_mode ad1986a_modes[3] = { +static const struct hda_channel_mode ad1986a_modes[3] = { { 2, ad1986a_ch2_init }, { 4, ad1986a_ch4_init }, { 6, ad1986a_ch6_init }, }; /* eapd initialization */ -static struct hda_verb ad1986a_eapd_init_verbs[] = { +static const struct hda_verb ad1986a_eapd_init_verbs[] = { {0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, {} }; -static struct hda_verb ad1986a_automic_verbs[] = { +static const struct hda_verb ad1986a_automic_verbs[] = { {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, {0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /*{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},*/ @@ -1058,7 +1058,7 @@ static struct hda_verb ad1986a_automic_verbs[] = { }; /* Ultra initialization */ -static struct hda_verb ad1986a_ultra_init[] = { +static const struct hda_verb ad1986a_ultra_init[] = { /* eapd initialization */ { 0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, /* CLFE -> Mic in */ @@ -1069,7 +1069,7 @@ static struct hda_verb ad1986a_ultra_init[] = { }; /* pin sensing on HP jack */ -static struct hda_verb ad1986a_hp_init_verbs[] = { +static const struct hda_verb ad1986a_hp_init_verbs[] = { {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_HP_EVENT}, {} }; @@ -1120,7 +1120,7 @@ static const char * const ad1986a_models[AD1986A_MODELS] = { [AD1986A_SAMSUNG_P50] = "samsung-p50", }; -static struct snd_pci_quirk ad1986a_cfg_tbl[] = { +static const struct snd_pci_quirk ad1986a_cfg_tbl[] = { SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_LAPTOP_EAPD), SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9", AD1986A_LAPTOP_EAPD), SND_PCI_QUIRK(0x1043, 0x11f7, "ASUS U5A", AD1986A_LAPTOP_EAPD), @@ -1152,7 +1152,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = { }; #ifdef CONFIG_SND_HDA_POWER_SAVE -static struct hda_amp_list ad1986a_loopbacks[] = { +static const struct hda_amp_list ad1986a_loopbacks[] = { { 0x13, HDA_OUTPUT, 0 }, /* Mic */ { 0x14, HDA_OUTPUT, 0 }, /* Phone */ { 0x15, HDA_OUTPUT, 0 }, /* CD */ @@ -1329,11 +1329,11 @@ static int patch_ad1986a(struct hda_codec *codec) #define AD1983_DAC 0x03 #define AD1983_ADC 0x04 -static hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC }; -static hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC }; -static hda_nid_t ad1983_capsrc_nids[1] = { 0x15 }; +static const hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC }; +static const hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC }; +static const hda_nid_t ad1983_capsrc_nids[1] = { 0x15 }; -static struct hda_input_mux ad1983_capture_source = { +static const struct hda_input_mux ad1983_capture_source = { .num_items = 4, .items = { { "Mic", 0x0 }, @@ -1348,7 +1348,7 @@ static struct hda_input_mux ad1983_capture_source = { */ static int ad1983_spdif_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - static char *texts[] = { "PCM", "ADC" }; + static const char * const texts[] = { "PCM", "ADC" }; uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count = 1; @@ -1385,7 +1385,7 @@ static int ad1983_spdif_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ return 0; } -static struct snd_kcontrol_new ad1983_mixers[] = { +static const struct snd_kcontrol_new ad1983_mixers[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), @@ -1418,7 +1418,7 @@ static struct snd_kcontrol_new ad1983_mixers[] = { { } /* end */ }; -static struct hda_verb ad1983_init_verbs[] = { +static const struct hda_verb ad1983_init_verbs[] = { /* Front, HP, Mono; mute as default */ {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x06, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, @@ -1458,7 +1458,7 @@ static struct hda_verb ad1983_init_verbs[] = { }; #ifdef CONFIG_SND_HDA_POWER_SAVE -static struct hda_amp_list ad1983_loopbacks[] = { +static const struct hda_amp_list ad1983_loopbacks[] = { { 0x12, HDA_OUTPUT, 0 }, /* Mic */ { 0x13, HDA_OUTPUT, 0 }, /* Line */ { } /* end */ @@ -1518,12 +1518,12 @@ static int patch_ad1983(struct hda_codec *codec) #define AD1981_DAC 0x03 #define AD1981_ADC 0x04 -static hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC }; -static hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC }; -static hda_nid_t ad1981_capsrc_nids[1] = { 0x15 }; +static const hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC }; +static const hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC }; +static const hda_nid_t ad1981_capsrc_nids[1] = { 0x15 }; /* 0x0c, 0x09, 0x0e, 0x0f, 0x19, 0x05, 0x18, 0x17 */ -static struct hda_input_mux ad1981_capture_source = { +static const struct hda_input_mux ad1981_capture_source = { .num_items = 7, .items = { { "Front Mic", 0x0 }, @@ -1536,7 +1536,7 @@ static struct hda_input_mux ad1981_capture_source = { }, }; -static struct snd_kcontrol_new ad1981_mixers[] = { +static const struct snd_kcontrol_new ad1981_mixers[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), @@ -1577,7 +1577,7 @@ static struct snd_kcontrol_new ad1981_mixers[] = { { } /* end */ }; -static struct hda_verb ad1981_init_verbs[] = { +static const struct hda_verb ad1981_init_verbs[] = { /* Front, HP, Mono; mute as default */ {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x06, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, @@ -1625,7 +1625,7 @@ static struct hda_verb ad1981_init_verbs[] = { }; #ifdef CONFIG_SND_HDA_POWER_SAVE -static struct hda_amp_list ad1981_loopbacks[] = { +static const struct hda_amp_list ad1981_loopbacks[] = { { 0x12, HDA_OUTPUT, 0 }, /* Front Mic */ { 0x13, HDA_OUTPUT, 0 }, /* Line */ { 0x1b, HDA_OUTPUT, 0 }, /* Aux */ @@ -1645,7 +1645,7 @@ static struct hda_amp_list ad1981_loopbacks[] = { #define AD1981_HP_EVENT 0x37 #define AD1981_MIC_EVENT 0x38 -static struct hda_verb ad1981_hp_init_verbs[] = { +static const struct hda_verb ad1981_hp_init_verbs[] = { {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, /* default off */ /* pin sensing on HP and Mic jacks */ {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT}, @@ -1674,7 +1674,7 @@ static int ad1981_hp_master_sw_put(struct snd_kcontrol *kcontrol, } /* bind volumes of both NID 0x05 and 0x06 */ -static struct hda_bind_ctls ad1981_hp_bind_master_vol = { +static const struct hda_bind_ctls ad1981_hp_bind_master_vol = { .ops = &snd_hda_bind_vol, .values = { HDA_COMPOSE_AMP_VAL(0x05, 3, 0, HDA_OUTPUT), @@ -1696,12 +1696,12 @@ static void ad1981_hp_automute(struct hda_codec *codec) /* toggle input of built-in and mic jack appropriately */ static void ad1981_hp_automic(struct hda_codec *codec) { - static struct hda_verb mic_jack_on[] = { + static const struct hda_verb mic_jack_on[] = { {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, {} }; - static struct hda_verb mic_jack_off[] = { + static const struct hda_verb mic_jack_off[] = { {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, {} @@ -1730,7 +1730,7 @@ static void ad1981_hp_unsol_event(struct hda_codec *codec, } } -static struct hda_input_mux ad1981_hp_capture_source = { +static const struct hda_input_mux ad1981_hp_capture_source = { .num_items = 3, .items = { { "Mic", 0x0 }, @@ -1739,7 +1739,7 @@ static struct hda_input_mux ad1981_hp_capture_source = { }, }; -static struct snd_kcontrol_new ad1981_hp_mixers[] = { +static const struct snd_kcontrol_new ad1981_hp_mixers[] = { HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -1790,7 +1790,7 @@ static int ad1981_hp_init(struct hda_codec *codec) } /* configuration for Toshiba Laptops */ -static struct hda_verb ad1981_toshiba_init_verbs[] = { +static const struct hda_verb ad1981_toshiba_init_verbs[] = { {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */ /* pin sensing on HP and Mic jacks */ {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT}, @@ -1798,14 +1798,14 @@ static struct hda_verb ad1981_toshiba_init_verbs[] = { {} }; -static struct snd_kcontrol_new ad1981_toshiba_mixers[] = { +static const struct snd_kcontrol_new ad1981_toshiba_mixers[] = { HDA_CODEC_VOLUME("Amp Volume", 0x1a, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT), { } }; /* configuration for Lenovo Thinkpad T60 */ -static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { +static const struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x11, 0x0, HDA_OUTPUT), @@ -1835,7 +1835,7 @@ static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { { } /* end */ }; -static struct hda_input_mux ad1981_thinkpad_capture_source = { +static const struct hda_input_mux ad1981_thinkpad_capture_source = { .num_items = 3, .items = { { "Mic", 0x0 }, @@ -1860,7 +1860,7 @@ static const char * const ad1981_models[AD1981_MODELS] = { [AD1981_TOSHIBA] = "toshiba" }; -static struct snd_pci_quirk ad1981_cfg_tbl[] = { +static const struct snd_pci_quirk ad1981_cfg_tbl[] = { SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD), SND_PCI_QUIRK(0x1014, 0x05b7, "Lenovo Z60m", AD1981_THINKPAD), /* All HP models */ @@ -2075,32 +2075,32 @@ enum { * mixers */ -static hda_nid_t ad1988_6stack_dac_nids[4] = { +static const hda_nid_t ad1988_6stack_dac_nids[4] = { 0x04, 0x06, 0x05, 0x0a }; -static hda_nid_t ad1988_3stack_dac_nids[3] = { +static const hda_nid_t ad1988_3stack_dac_nids[3] = { 0x04, 0x05, 0x0a }; /* for AD1988A revision-2, DAC2-4 are swapped */ -static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { +static const hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { 0x04, 0x05, 0x0a, 0x06 }; -static hda_nid_t ad1988_alt_dac_nid[1] = { +static const hda_nid_t ad1988_alt_dac_nid[1] = { 0x03 }; -static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { +static const hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { 0x04, 0x0a, 0x06 }; -static hda_nid_t ad1988_adc_nids[3] = { +static const hda_nid_t ad1988_adc_nids[3] = { 0x08, 0x09, 0x0f }; -static hda_nid_t ad1988_capsrc_nids[3] = { +static const hda_nid_t ad1988_capsrc_nids[3] = { 0x0c, 0x0d, 0x0e }; @@ -2108,11 +2108,11 @@ static hda_nid_t ad1988_capsrc_nids[3] = { #define AD1988_SPDIF_OUT_HDMI 0x0b #define AD1988_SPDIF_IN 0x07 -static hda_nid_t ad1989b_slave_dig_outs[] = { +static const hda_nid_t ad1989b_slave_dig_outs[] = { AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI, 0 }; -static struct hda_input_mux ad1988_6stack_capture_source = { +static const struct hda_input_mux ad1988_6stack_capture_source = { .num_items = 5, .items = { { "Front Mic", 0x1 }, /* port-B */ @@ -2123,7 +2123,7 @@ static struct hda_input_mux ad1988_6stack_capture_source = { }, }; -static struct hda_input_mux ad1988_laptop_capture_source = { +static const struct hda_input_mux ad1988_laptop_capture_source = { .num_items = 3, .items = { { "Mic/Line", 0x1 }, /* port-B */ @@ -2166,7 +2166,7 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol, } /* 6-stack mode */ -static struct snd_kcontrol_new ad1988_6stack_mixers1[] = { +static const struct snd_kcontrol_new ad1988_6stack_mixers1[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x06, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), @@ -2175,7 +2175,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { +static const struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT), @@ -2184,7 +2184,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { +static const struct snd_kcontrol_new ad1988_6stack_mixers2[] = { HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT), HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT), @@ -2211,14 +2211,14 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = { +static const struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = { HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), { } /* end */ }; /* 3-stack mode */ -static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { +static const struct snd_kcontrol_new ad1988_3stack_mixers1[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), @@ -2226,7 +2226,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { +static const struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT), @@ -2234,7 +2234,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { +static const struct snd_kcontrol_new ad1988_3stack_mixers2[] = { HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT), HDA_BIND_MUTE("Surround Playback Switch", 0x2c, 2, HDA_INPUT), HDA_BIND_MUTE_MONO("Center Playback Switch", 0x26, 1, 2, HDA_INPUT), @@ -2268,7 +2268,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { }; /* laptop mode */ -static struct snd_kcontrol_new ad1988_laptop_mixers[] = { +static const struct snd_kcontrol_new ad1988_laptop_mixers[] = { HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x29, 0x0, HDA_INPUT), HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT), @@ -2299,7 +2299,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = { }; /* capture */ -static struct snd_kcontrol_new ad1988_capture_mixers[] = { +static const struct snd_kcontrol_new ad1988_capture_mixers[] = { HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), @@ -2324,7 +2324,7 @@ static struct snd_kcontrol_new ad1988_capture_mixers[] = { static int ad1988_spdif_playback_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - static char *texts[] = { + static const char * const texts[] = { "PCM", "ADC1", "ADC2", "ADC3" }; uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; @@ -2405,7 +2405,7 @@ static int ad1988_spdif_playback_source_put(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = { +static const struct snd_kcontrol_new ad1988_spdif_out_mixers[] = { HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -2418,12 +2418,12 @@ static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1988_spdif_in_mixers[] = { +static const struct snd_kcontrol_new ad1988_spdif_in_mixers[] = { HDA_CODEC_VOLUME("IEC958 Capture Volume", 0x1c, 0x0, HDA_INPUT), { } /* end */ }; -static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { +static const struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("HDMI Playback Volume", 0x1d, 0x0, HDA_OUTPUT), { } /* end */ @@ -2436,7 +2436,7 @@ static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { /* * for 6-stack (+dig) */ -static struct hda_verb ad1988_6stack_init_verbs[] = { +static const struct hda_verb ad1988_6stack_init_verbs[] = { /* Front, Surround, CLFE, side DAC; unmute as default */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, @@ -2496,7 +2496,7 @@ static struct hda_verb ad1988_6stack_init_verbs[] = { { } }; -static struct hda_verb ad1988_6stack_fp_init_verbs[] = { +static const struct hda_verb ad1988_6stack_fp_init_verbs[] = { /* Headphone; unmute as default */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Port-A front headphon path */ @@ -2509,7 +2509,7 @@ static struct hda_verb ad1988_6stack_fp_init_verbs[] = { { } }; -static struct hda_verb ad1988_capture_init_verbs[] = { +static const struct hda_verb ad1988_capture_init_verbs[] = { /* mute analog mix */ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, @@ -2527,7 +2527,7 @@ static struct hda_verb ad1988_capture_init_verbs[] = { { } }; -static struct hda_verb ad1988_spdif_init_verbs[] = { +static const struct hda_verb ad1988_spdif_init_verbs[] = { /* SPDIF out sel */ {0x02, AC_VERB_SET_CONNECT_SEL, 0x0}, /* PCM */ {0x0b, AC_VERB_SET_CONNECT_SEL, 0x0}, /* ADC1 */ @@ -2539,14 +2539,14 @@ static struct hda_verb ad1988_spdif_init_verbs[] = { { } }; -static struct hda_verb ad1988_spdif_in_init_verbs[] = { +static const struct hda_verb ad1988_spdif_in_init_verbs[] = { /* unmute SPDIF input pin */ {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, { } }; /* AD1989 has no ADC -> SPDIF route */ -static struct hda_verb ad1989_spdif_init_verbs[] = { +static const struct hda_verb ad1989_spdif_init_verbs[] = { /* SPDIF-1 out pin */ {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ @@ -2559,7 +2559,7 @@ static struct hda_verb ad1989_spdif_init_verbs[] = { /* * verbs for 3stack (+dig) */ -static struct hda_verb ad1988_3stack_ch2_init[] = { +static const struct hda_verb ad1988_3stack_ch2_init[] = { /* set port-C to line-in */ { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, @@ -2569,7 +2569,7 @@ static struct hda_verb ad1988_3stack_ch2_init[] = { { } /* end */ }; -static struct hda_verb ad1988_3stack_ch6_init[] = { +static const struct hda_verb ad1988_3stack_ch6_init[] = { /* set port-C to surround out */ { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, @@ -2579,12 +2579,12 @@ static struct hda_verb ad1988_3stack_ch6_init[] = { { } /* end */ }; -static struct hda_channel_mode ad1988_3stack_modes[2] = { +static const struct hda_channel_mode ad1988_3stack_modes[2] = { { 2, ad1988_3stack_ch2_init }, { 6, ad1988_3stack_ch6_init }, }; -static struct hda_verb ad1988_3stack_init_verbs[] = { +static const struct hda_verb ad1988_3stack_init_verbs[] = { /* Front, Surround, CLFE, side DAC; unmute as default */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, @@ -2644,13 +2644,13 @@ static struct hda_verb ad1988_3stack_init_verbs[] = { /* * verbs for laptop mode (+dig) */ -static struct hda_verb ad1988_laptop_hp_on[] = { +static const struct hda_verb ad1988_laptop_hp_on[] = { /* unmute port-A and mute port-D */ { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, { } /* end */ }; -static struct hda_verb ad1988_laptop_hp_off[] = { +static const struct hda_verb ad1988_laptop_hp_off[] = { /* mute port-A and unmute port-D */ { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, @@ -2659,7 +2659,7 @@ static struct hda_verb ad1988_laptop_hp_off[] = { #define AD1988_HP_EVENT 0x01 -static struct hda_verb ad1988_laptop_init_verbs[] = { +static const struct hda_verb ad1988_laptop_init_verbs[] = { /* Front, Surround, CLFE, side DAC; unmute as default */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, @@ -2723,7 +2723,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res) } #ifdef CONFIG_SND_HDA_POWER_SAVE -static struct hda_amp_list ad1988_loopbacks[] = { +static const struct hda_amp_list ad1988_loopbacks[] = { { 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 1 }, /* Line */ { 0x20, HDA_INPUT, 4 }, /* Mic */ @@ -2741,7 +2741,7 @@ enum { AD_CTL_WIDGET_MUTE, AD_CTL_BIND_MUTE, }; -static struct snd_kcontrol_new ad1988_control_templates[] = { +static const struct snd_kcontrol_new ad1988_control_templates[] = { HDA_CODEC_VOLUME(NULL, 0, 0, 0), HDA_CODEC_MUTE(NULL, 0, 0, 0), HDA_BIND_MUTE(NULL, 0, 0, 0), @@ -2770,18 +2770,18 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name, #define AD1988_PIN_CD_NID 0x18 #define AD1988_PIN_BEEP_NID 0x10 -static hda_nid_t ad1988_mixer_nids[8] = { +static const hda_nid_t ad1988_mixer_nids[8] = { /* A B C D E F G H */ 0x22, 0x2b, 0x2c, 0x29, 0x26, 0x2a, 0x27, 0x28 }; static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx) { - static hda_nid_t idx_to_dac[8] = { + static const hda_nid_t idx_to_dac[8] = { /* A B C D E F G H */ 0x04, 0x06, 0x05, 0x04, 0x0a, 0x06, 0x05, 0x0a }; - static hda_nid_t idx_to_dac_rev2[8] = { + static const hda_nid_t idx_to_dac_rev2[8] = { /* A B C D E F G H */ 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06 }; @@ -2791,13 +2791,13 @@ static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx) return idx_to_dac[idx]; } -static hda_nid_t ad1988_boost_nids[8] = { +static const hda_nid_t ad1988_boost_nids[8] = { 0x38, 0x39, 0x3a, 0x3d, 0x3c, 0x3b, 0, 0 }; static int ad1988_pin_idx(hda_nid_t nid) { - static hda_nid_t ad1988_io_pins[8] = { + static const hda_nid_t ad1988_io_pins[8] = { 0x11, 0x14, 0x15, 0x12, 0x17, 0x16, 0x24, 0x25 }; int i; @@ -2809,7 +2809,7 @@ static int ad1988_pin_idx(hda_nid_t nid) static int ad1988_pin_to_loopback_idx(hda_nid_t nid) { - static int loopback_idx[8] = { + static const int loopback_idx[8] = { 2, 0, 1, 3, 4, 5, 1, 4 }; switch (nid) { @@ -2822,7 +2822,7 @@ static int ad1988_pin_to_loopback_idx(hda_nid_t nid) static int ad1988_pin_to_adc_idx(hda_nid_t nid) { - static int adc_idx[8] = { + static const int adc_idx[8] = { 0, 1, 2, 8, 4, 3, 6, 7 }; switch (nid) { @@ -2845,7 +2845,7 @@ static int ad1988_auto_fill_dac_nids(struct hda_codec *codec, /* check the pins hardwired to audio widget */ for (i = 0; i < cfg->line_outs; i++) { idx = ad1988_pin_idx(cfg->line_out_pins[i]); - spec->multiout.dac_nids[i] = ad1988_idx_to_dac(codec, idx); + spec->private_dac_nids[i] = ad1988_idx_to_dac(codec, idx); } spec->multiout.num_dacs = cfg->line_outs; return 0; @@ -3070,6 +3070,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) for (i = 0; i < cfg->num_inputs; i++) { hda_nid_t nid = cfg->inputs[i].pin; + int type = cfg->inputs[i].type; switch (nid) { case 0x15: /* port-C */ snd_hda_codec_write(codec, 0x33, 0, AC_VERB_SET_CONNECT_SEL, 0x0); @@ -3079,7 +3080,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) break; } snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, - i == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN); + type == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN); if (nid != AD1988_PIN_CD_NID) snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); @@ -3154,10 +3155,11 @@ static const char * const ad1988_models[AD1988_MODEL_LAST] = { [AD1988_AUTO] = "auto", }; -static struct snd_pci_quirk ad1988_cfg_tbl[] = { +static const struct snd_pci_quirk ad1988_cfg_tbl[] = { SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG), SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG), + SND_PCI_QUIRK(0x1043, 0x82c0, "Asus M3N-HT Deluxe", AD1988_6STACK_DIG), SND_PCI_QUIRK(0x1043, 0x8311, "Asus P5Q-Premium/Pro", AD1988_6STACK_DIG), {} }; @@ -3342,21 +3344,21 @@ static int patch_ad1988(struct hda_codec *codec) * but no build-up framework is given, so far. */ -static hda_nid_t ad1884_dac_nids[1] = { +static const hda_nid_t ad1884_dac_nids[1] = { 0x04, }; -static hda_nid_t ad1884_adc_nids[2] = { +static const hda_nid_t ad1884_adc_nids[2] = { 0x08, 0x09, }; -static hda_nid_t ad1884_capsrc_nids[2] = { +static const hda_nid_t ad1884_capsrc_nids[2] = { 0x0c, 0x0d, }; #define AD1884_SPDIF_OUT 0x02 -static struct hda_input_mux ad1884_capture_source = { +static const struct hda_input_mux ad1884_capture_source = { .num_items = 4, .items = { { "Front Mic", 0x0 }, @@ -3366,7 +3368,7 @@ static struct hda_input_mux ad1884_capture_source = { }, }; -static struct snd_kcontrol_new ad1884_base_mixers[] = { +static const struct snd_kcontrol_new ad1884_base_mixers[] = { HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), @@ -3410,7 +3412,7 @@ static struct snd_kcontrol_new ad1884_base_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1984_dmic_mixers[] = { +static const struct snd_kcontrol_new ad1984_dmic_mixers[] = { HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x05, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Digital Mic Capture Switch", 0x05, 0x0, HDA_INPUT), HDA_CODEC_VOLUME_IDX("Digital Mic Capture Volume", 1, 0x06, 0x0, @@ -3423,7 +3425,7 @@ static struct snd_kcontrol_new ad1984_dmic_mixers[] = { /* * initialization verbs */ -static struct hda_verb ad1884_init_verbs[] = { +static const struct hda_verb ad1884_init_verbs[] = { /* DACs; mute as default */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, @@ -3469,7 +3471,7 @@ static struct hda_verb ad1884_init_verbs[] = { }; #ifdef CONFIG_SND_HDA_POWER_SAVE -static struct hda_amp_list ad1884_loopbacks[] = { +static const struct hda_amp_list ad1884_loopbacks[] = { { 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 2 }, /* CD */ @@ -3541,7 +3543,7 @@ static int patch_ad1884(struct hda_codec *codec) /* * Lenovo Thinkpad T61/X61 */ -static struct hda_input_mux ad1984_thinkpad_capture_source = { +static const struct hda_input_mux ad1984_thinkpad_capture_source = { .num_items = 4, .items = { { "Mic", 0x0 }, @@ -3555,7 +3557,7 @@ static struct hda_input_mux ad1984_thinkpad_capture_source = { /* * Dell Precision T3400 */ -static struct hda_input_mux ad1984_dell_desktop_capture_source = { +static const struct hda_input_mux ad1984_dell_desktop_capture_source = { .num_items = 3, .items = { { "Front Mic", 0x0 }, @@ -3565,7 +3567,7 @@ static struct hda_input_mux ad1984_dell_desktop_capture_source = { }; -static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { +static const struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), @@ -3611,7 +3613,7 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { }; /* additional verbs */ -static struct hda_verb ad1984_thinkpad_init_verbs[] = { +static const struct hda_verb ad1984_thinkpad_init_verbs[] = { /* Port-E (docking station mic) pin */ {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, @@ -3629,7 +3631,7 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = { /* * Dell Precision T3400 */ -static struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = { +static const struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = { HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT), @@ -3680,7 +3682,7 @@ static int ad1984_pcm_dmic_cleanup(struct hda_pcm_stream *hinfo, return 0; } -static struct hda_pcm_stream ad1984_pcm_dmic_capture = { +static const struct hda_pcm_stream ad1984_pcm_dmic_capture = { .substreams = 2, .channels_min = 2, .channels_max = 2, @@ -3722,7 +3724,7 @@ static const char * const ad1984_models[AD1984_MODELS] = { [AD1984_DELL_DESKTOP] = "dell_desktop", }; -static struct snd_pci_quirk ad1984_cfg_tbl[] = { +static const struct snd_pci_quirk ad1984_cfg_tbl[] = { /* Lenovo Thinkpad T61/X61 */ SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), @@ -3787,7 +3789,7 @@ static int patch_ad1984(struct hda_codec *codec) * We share the single DAC for both HP and line-outs (see AD1884/1984). */ -static hda_nid_t ad1884a_dac_nids[1] = { +static const hda_nid_t ad1884a_dac_nids[1] = { 0x03, }; @@ -3796,7 +3798,7 @@ static hda_nid_t ad1884a_dac_nids[1] = { #define AD1884A_SPDIF_OUT 0x02 -static struct hda_input_mux ad1884a_capture_source = { +static const struct hda_input_mux ad1884a_capture_source = { .num_items = 5, .items = { { "Front Mic", 0x0 }, @@ -3807,7 +3809,7 @@ static struct hda_input_mux ad1884a_capture_source = { }, }; -static struct snd_kcontrol_new ad1884a_base_mixers[] = { +static const struct snd_kcontrol_new ad1884a_base_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), @@ -3859,7 +3861,7 @@ static struct snd_kcontrol_new ad1884a_base_mixers[] = { /* * initialization verbs */ -static struct hda_verb ad1884a_init_verbs[] = { +static const struct hda_verb ad1884a_init_verbs[] = { /* DACs; unmute as default */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ @@ -3914,7 +3916,7 @@ static struct hda_verb ad1884a_init_verbs[] = { }; #ifdef CONFIG_SND_HDA_POWER_SAVE -static struct hda_amp_list ad1884a_loopbacks[] = { +static const struct hda_amp_list ad1884a_loopbacks[] = { { 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 2 }, /* CD */ @@ -3947,7 +3949,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol, return ret; } -static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { +static const struct snd_kcontrol_new ad1884a_laptop_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -3975,7 +3977,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { +static const struct snd_kcontrol_new ad1884a_mobile_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ { @@ -4095,7 +4097,7 @@ static int ad1884a_laptop_init(struct hda_codec *codec) } /* additional verbs for laptop model */ -static struct hda_verb ad1884a_laptop_verbs[] = { +static const struct hda_verb ad1884a_laptop_verbs[] = { /* Port-A (HP) pin - always unmuted */ {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Port-F (int speaker) mixer - route only from analog mixer */ @@ -4126,7 +4128,7 @@ static struct hda_verb ad1884a_laptop_verbs[] = { { } /* end */ }; -static struct hda_verb ad1884a_mobile_verbs[] = { +static const struct hda_verb ad1884a_mobile_verbs[] = { /* DACs; unmute as default */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ @@ -4181,7 +4183,7 @@ static struct hda_verb ad1884a_mobile_verbs[] = { * 0x17 - built-in mic */ -static struct hda_verb ad1984a_thinkpad_verbs[] = { +static const struct hda_verb ad1984a_thinkpad_verbs[] = { /* HP unmute */ {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* analog mix */ @@ -4198,7 +4200,7 @@ static struct hda_verb ad1984a_thinkpad_verbs[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { +static const struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), @@ -4219,7 +4221,7 @@ static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { { } /* end */ }; -static struct hda_input_mux ad1984a_thinkpad_capture_source = { +static const struct hda_input_mux ad1984a_thinkpad_capture_source = { .num_items = 3, .items = { { "Mic", 0x0 }, @@ -4262,7 +4264,7 @@ static int ad1984a_thinkpad_init(struct hda_codec *codec) * 0x15 - mic-in */ -static struct hda_verb ad1984a_precision_verbs[] = { +static const struct hda_verb ad1984a_precision_verbs[] = { /* Unmute main output path */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */ @@ -4288,7 +4290,7 @@ static struct hda_verb ad1984a_precision_verbs[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1984a_precision_mixers[] = { +static const struct snd_kcontrol_new ad1984a_precision_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), @@ -4344,7 +4346,7 @@ static int ad1984a_precision_init(struct hda_codec *codec) * digital-mic (0x17) - Internal mic */ -static struct hda_verb ad1984a_touchsmart_verbs[] = { +static const struct hda_verb ad1984a_touchsmart_verbs[] = { /* DACs; unmute as default */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ @@ -4396,7 +4398,7 @@ static struct hda_verb ad1984a_touchsmart_verbs[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = { +static const struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), /* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ { @@ -4475,7 +4477,7 @@ static const char * const ad1884a_models[AD1884A_MODELS] = { [AD1984A_PRECISION] = "precision", }; -static struct snd_pci_quirk ad1884a_cfg_tbl[] = { +static const struct snd_pci_quirk ad1884a_cfg_tbl[] = { SND_PCI_QUIRK(0x1028, 0x04ac, "Precision R5500", AD1984A_PRECISION), SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP), @@ -4614,22 +4616,22 @@ static int patch_ad1884a(struct hda_codec *codec) * port-G - rear clfe-out (6stack) */ -static hda_nid_t ad1882_dac_nids[3] = { +static const hda_nid_t ad1882_dac_nids[3] = { 0x04, 0x03, 0x05 }; -static hda_nid_t ad1882_adc_nids[2] = { +static const hda_nid_t ad1882_adc_nids[2] = { 0x08, 0x09, }; -static hda_nid_t ad1882_capsrc_nids[2] = { +static const hda_nid_t ad1882_capsrc_nids[2] = { 0x0c, 0x0d, }; #define AD1882_SPDIF_OUT 0x02 /* list: 0x11, 0x39, 0x3a, 0x18, 0x3c, 0x3b, 0x12, 0x20 */ -static struct hda_input_mux ad1882_capture_source = { +static const struct hda_input_mux ad1882_capture_source = { .num_items = 5, .items = { { "Front Mic", 0x1 }, @@ -4641,7 +4643,7 @@ static struct hda_input_mux ad1882_capture_source = { }; /* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */ -static struct hda_input_mux ad1882a_capture_source = { +static const struct hda_input_mux ad1882a_capture_source = { .num_items = 5, .items = { { "Front Mic", 0x1 }, @@ -4652,7 +4654,7 @@ static struct hda_input_mux ad1882a_capture_source = { }, }; -static struct snd_kcontrol_new ad1882_base_mixers[] = { +static const struct snd_kcontrol_new ad1882_base_mixers[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), @@ -4694,7 +4696,7 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1882_loopback_mixers[] = { +static const struct snd_kcontrol_new ad1882_loopback_mixers[] = { HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), @@ -4706,7 +4708,7 @@ static struct snd_kcontrol_new ad1882_loopback_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { +static const struct snd_kcontrol_new ad1882a_loopback_mixers[] = { HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT), @@ -4719,7 +4721,7 @@ static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1882_3stack_mixers[] = { +static const struct snd_kcontrol_new ad1882_3stack_mixers[] = { HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x17, 2, 0x0, HDA_OUTPUT), @@ -4733,14 +4735,14 @@ static struct snd_kcontrol_new ad1882_3stack_mixers[] = { { } /* end */ }; -static struct snd_kcontrol_new ad1882_6stack_mixers[] = { +static const struct snd_kcontrol_new ad1882_6stack_mixers[] = { HDA_CODEC_MUTE("Surround Playback Switch", 0x16, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x24, 1, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x24, 2, 0x0, HDA_OUTPUT), { } /* end */ }; -static struct hda_verb ad1882_ch2_init[] = { +static const struct hda_verb ad1882_ch2_init[] = { {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, @@ -4750,7 +4752,7 @@ static struct hda_verb ad1882_ch2_init[] = { { } /* end */ }; -static struct hda_verb ad1882_ch4_init[] = { +static const struct hda_verb ad1882_ch4_init[] = { {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, @@ -4760,7 +4762,7 @@ static struct hda_verb ad1882_ch4_init[] = { { } /* end */ }; -static struct hda_verb ad1882_ch6_init[] = { +static const struct hda_verb ad1882_ch6_init[] = { {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, @@ -4770,7 +4772,7 @@ static struct hda_verb ad1882_ch6_init[] = { { } /* end */ }; -static struct hda_channel_mode ad1882_modes[3] = { +static const struct hda_channel_mode ad1882_modes[3] = { { 2, ad1882_ch2_init }, { 4, ad1882_ch4_init }, { 6, ad1882_ch6_init }, @@ -4779,7 +4781,7 @@ static struct hda_channel_mode ad1882_modes[3] = { /* * initialization verbs */ -static struct hda_verb ad1882_init_verbs[] = { +static const struct hda_verb ad1882_init_verbs[] = { /* DACs; mute as default */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, @@ -4848,7 +4850,7 @@ static struct hda_verb ad1882_init_verbs[] = { }; #ifdef CONFIG_SND_HDA_POWER_SAVE -static struct hda_amp_list ad1882_loopbacks[] = { +static const struct hda_amp_list ad1882_loopbacks[] = { { 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 4 }, /* Line */ @@ -4945,7 +4947,7 @@ static int patch_ad1882(struct hda_codec *codec) /* * patch entries */ -static struct hda_codec_preset snd_hda_preset_analog[] = { +static const struct hda_codec_preset snd_hda_preset_analog[] = { { .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a }, { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 }, { .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a }, |