Commit 498f5b17 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Constify fixup and other array data in patch_analog.c

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4c6d72d1
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "hda_beep.h" #include "hda_beep.h"
struct ad198x_spec { struct ad198x_spec {
struct snd_kcontrol_new *mixers[6]; const struct snd_kcontrol_new *mixers[6];
int num_mixers; int num_mixers;
unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */ unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */
const struct hda_verb *init_verbs[6]; /* initialization verbs const struct hda_verb *init_verbs[6]; /* initialization verbs
...@@ -46,17 +46,17 @@ struct ad198x_spec { ...@@ -46,17 +46,17 @@ struct ad198x_spec {
unsigned int cur_eapd; unsigned int cur_eapd;
unsigned int need_dac_fix; unsigned int need_dac_fix;
hda_nid_t *alt_dac_nid; const hda_nid_t *alt_dac_nid;
struct hda_pcm_stream *stream_analog_alt_playback; const struct hda_pcm_stream *stream_analog_alt_playback;
/* capture */ /* capture */
unsigned int num_adc_nids; 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 */ hda_nid_t dig_in_nid; /* digital-in NID; optional */
/* capture source */ /* capture source */
const struct hda_input_mux *input_mux; const struct hda_input_mux *input_mux;
hda_nid_t *capsrc_nids; const hda_nid_t *capsrc_nids;
unsigned int cur_mux[3]; unsigned int cur_mux[3];
/* channel model */ /* channel model */
...@@ -182,13 +182,13 @@ static void ad198x_free_kctls(struct hda_codec *codec); ...@@ -182,13 +182,13 @@ static void ad198x_free_kctls(struct hda_codec *codec);
#ifdef CONFIG_SND_HDA_INPUT_BEEP #ifdef CONFIG_SND_HDA_INPUT_BEEP
/* additional beep mixers; the actual parameters are overwritten at build */ /* 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_VOLUME("Beep Playback Volume", 0, 0, HDA_OUTPUT),
HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_OUTPUT), HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_OUTPUT),
{ } /* end */ { } /* 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_VOLUME("Digital Beep Playback Volume", 0, 0, HDA_OUTPUT),
HDA_CODEC_MUTE_BEEP("Digital Beep Playback Switch", 0, 0, HDA_OUTPUT), HDA_CODEC_MUTE_BEEP("Digital Beep Playback Switch", 0, 0, HDA_OUTPUT),
{ } /* end */ { } /* end */
...@@ -231,7 +231,7 @@ static int ad198x_build_controls(struct hda_codec *codec) ...@@ -231,7 +231,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
/* create beep controls if needed */ /* create beep controls if needed */
#ifdef CONFIG_SND_HDA_INPUT_BEEP #ifdef CONFIG_SND_HDA_INPUT_BEEP
if (spec->beep_amp) { 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; knew = spec->analog_beep ? ad_beep2_mixer : ad_beep_mixer;
for ( ; knew->name; knew++) { for ( ; knew->name; knew++) {
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
...@@ -331,7 +331,7 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, ...@@ -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); 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, .substreams = 1,
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
...@@ -403,7 +403,7 @@ static int ad198x_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, ...@@ -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, .substreams = 1,
.channels_min = 2, .channels_min = 2,
.channels_max = 6, /* changed later */ .channels_max = 6, /* changed later */
...@@ -415,7 +415,7 @@ static struct hda_pcm_stream ad198x_pcm_analog_playback = { ...@@ -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, .substreams = 1,
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
...@@ -426,7 +426,7 @@ static struct hda_pcm_stream ad198x_pcm_analog_capture = { ...@@ -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, .substreams = 1,
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
...@@ -439,7 +439,7 @@ static struct hda_pcm_stream ad198x_pcm_digital_playback = { ...@@ -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, .substreams = 1,
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
...@@ -569,7 +569,7 @@ static int ad198x_suspend(struct hda_codec *codec, pm_message_t state) ...@@ -569,7 +569,7 @@ static int ad198x_suspend(struct hda_codec *codec, pm_message_t state)
} }
#endif #endif
static struct hda_codec_ops ad198x_patch_ops = { static const struct hda_codec_ops ad198x_patch_ops = {
.build_controls = ad198x_build_controls, .build_controls = ad198x_build_controls,
.build_pcms = ad198x_build_pcms, .build_pcms = ad198x_build_pcms,
.init = ad198x_init, .init = ad198x_init,
...@@ -639,13 +639,13 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol, ...@@ -639,13 +639,13 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
#define AD1986A_CLFE_DAC 0x05 #define AD1986A_CLFE_DAC 0x05
#define AD1986A_ADC 0x06 #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 AD1986A_FRONT_DAC, AD1986A_SURR_DAC, AD1986A_CLFE_DAC
}; };
static hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC }; static const hda_nid_t ad1986a_adc_nids[1] = { AD1986A_ADC };
static hda_nid_t ad1986a_capsrc_nids[1] = { 0x12 }; 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, .num_items = 7,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -659,7 +659,7 @@ static struct hda_input_mux ad1986a_capture_source = { ...@@ -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, .ops = &snd_hda_bind_vol,
.values = { .values = {
HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT), HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT),
...@@ -669,7 +669,7 @@ static struct hda_bind_ctls ad1986a_bind_pcm_vol = { ...@@ -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, .ops = &snd_hda_bind_sw,
.values = { .values = {
HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT), HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT),
...@@ -682,7 +682,7 @@ static struct hda_bind_ctls ad1986a_bind_pcm_sw = { ...@@ -682,7 +682,7 @@ static struct hda_bind_ctls ad1986a_bind_pcm_sw = {
/* /*
* mixers * 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 * bind volumes/mutes of 3 DACs as a single PCM control for simplicity
*/ */
...@@ -723,7 +723,7 @@ static struct snd_kcontrol_new ad1986a_mixers[] = { ...@@ -723,7 +723,7 @@ static struct snd_kcontrol_new ad1986a_mixers[] = {
}; };
/* additional mixers for 3stack mode */ /* 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Channel Mode", .name = "Channel Mode",
...@@ -735,10 +735,10 @@ static struct snd_kcontrol_new ad1986a_3st_mixers[] = { ...@@ -735,10 +735,10 @@ static struct snd_kcontrol_new ad1986a_3st_mixers[] = {
}; };
/* laptop model - 2ch only */ /* 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 */ /* 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, .ops = &snd_hda_bind_vol,
.values = { .values = {
HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
...@@ -747,7 +747,7 @@ static struct hda_bind_ctls ad1986a_laptop_master_vol = { ...@@ -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, .ops = &snd_hda_bind_sw,
.values = { .values = {
HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
...@@ -756,7 +756,7 @@ static struct hda_bind_ctls ad1986a_laptop_master_sw = { ...@@ -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_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
...@@ -787,7 +787,7 @@ static struct snd_kcontrol_new ad1986a_laptop_mixers[] = { ...@@ -787,7 +787,7 @@ static struct snd_kcontrol_new ad1986a_laptop_mixers[] = {
/* laptop-eapd model - 2ch only */ /* 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, .num_items = 3,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -796,7 +796,7 @@ static struct hda_input_mux ad1986a_laptop_eapd_capture_source = { ...@@ -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, .num_items = 2,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -804,13 +804,13 @@ static struct hda_input_mux ad1986a_automic_capture_source = { ...@@ -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_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
{ } /* end */ { } /* 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_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 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[] = { ...@@ -837,7 +837,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
{ } /* end */ { } /* 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_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT), HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
{ } /* end */ { } /* end */
...@@ -931,7 +931,7 @@ static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol, ...@@ -931,7 +931,7 @@ static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol,
return change; 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), HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -949,7 +949,7 @@ static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { ...@@ -949,7 +949,7 @@ static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
/* /*
* initialization verbs * initialization verbs
*/ */
static struct hda_verb ad1986a_init_verbs[] = { static const struct hda_verb ad1986a_init_verbs[] = {
/* Front, Surround, CLFE DAC; mute as default */ /* Front, Surround, CLFE DAC; mute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
{0x04, 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[] = { ...@@ -1004,7 +1004,7 @@ static struct hda_verb ad1986a_init_verbs[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_verb ad1986a_ch2_init[] = { static const struct hda_verb ad1986a_ch2_init[] = {
/* Surround out -> Line In */ /* Surround out -> Line In */
{ 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
/* Line-in selectors */ /* Line-in selectors */
...@@ -1016,7 +1016,7 @@ static struct hda_verb ad1986a_ch2_init[] = { ...@@ -1016,7 +1016,7 @@ static struct hda_verb ad1986a_ch2_init[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_verb ad1986a_ch4_init[] = { static const struct hda_verb ad1986a_ch4_init[] = {
/* Surround out -> Surround */ /* Surround out -> Surround */
{ 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
{ 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 }, { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 },
...@@ -1026,7 +1026,7 @@ static struct hda_verb ad1986a_ch4_init[] = { ...@@ -1026,7 +1026,7 @@ static struct hda_verb ad1986a_ch4_init[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_verb ad1986a_ch6_init[] = { static const struct hda_verb ad1986a_ch6_init[] = {
/* Surround out -> Surround out */ /* Surround out -> Surround out */
{ 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
{ 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 }, { 0x10, AC_VERB_SET_CONNECT_SEL, 0x0 },
...@@ -1036,19 +1036,19 @@ static struct hda_verb ad1986a_ch6_init[] = { ...@@ -1036,19 +1036,19 @@ static struct hda_verb ad1986a_ch6_init[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_channel_mode ad1986a_modes[3] = { static const struct hda_channel_mode ad1986a_modes[3] = {
{ 2, ad1986a_ch2_init }, { 2, ad1986a_ch2_init },
{ 4, ad1986a_ch4_init }, { 4, ad1986a_ch4_init },
{ 6, ad1986a_ch6_init }, { 6, ad1986a_ch6_init },
}; };
/* eapd initialization */ /* 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 }, {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}, {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x1f, 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},*/ /*{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},*/
...@@ -1058,7 +1058,7 @@ static struct hda_verb ad1986a_automic_verbs[] = { ...@@ -1058,7 +1058,7 @@ static struct hda_verb ad1986a_automic_verbs[] = {
}; };
/* Ultra initialization */ /* Ultra initialization */
static struct hda_verb ad1986a_ultra_init[] = { static const struct hda_verb ad1986a_ultra_init[] = {
/* eapd initialization */ /* eapd initialization */
{ 0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, { 0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 },
/* CLFE -> Mic in */ /* CLFE -> Mic in */
...@@ -1069,7 +1069,7 @@ static struct hda_verb ad1986a_ultra_init[] = { ...@@ -1069,7 +1069,7 @@ static struct hda_verb ad1986a_ultra_init[] = {
}; };
/* pin sensing on HP jack */ /* 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}, {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_HP_EVENT},
{} {}
}; };
...@@ -1120,7 +1120,7 @@ static const char * const ad1986a_models[AD1986A_MODELS] = { ...@@ -1120,7 +1120,7 @@ static const char * const ad1986a_models[AD1986A_MODELS] = {
[AD1986A_SAMSUNG_P50] = "samsung-p50", [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(0x103c, 0x30af, "HP B2800", AD1986A_LAPTOP_EAPD),
SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9", AD1986A_LAPTOP_EAPD), SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9", AD1986A_LAPTOP_EAPD),
SND_PCI_QUIRK(0x1043, 0x11f7, "ASUS U5A", 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[] = { ...@@ -1152,7 +1152,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #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 */ { 0x13, HDA_OUTPUT, 0 }, /* Mic */
{ 0x14, HDA_OUTPUT, 0 }, /* Phone */ { 0x14, HDA_OUTPUT, 0 }, /* Phone */
{ 0x15, HDA_OUTPUT, 0 }, /* CD */ { 0x15, HDA_OUTPUT, 0 }, /* CD */
...@@ -1329,11 +1329,11 @@ static int patch_ad1986a(struct hda_codec *codec) ...@@ -1329,11 +1329,11 @@ static int patch_ad1986a(struct hda_codec *codec)
#define AD1983_DAC 0x03 #define AD1983_DAC 0x03
#define AD1983_ADC 0x04 #define AD1983_ADC 0x04
static hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC }; static const hda_nid_t ad1983_dac_nids[1] = { AD1983_DAC };
static hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC }; static const hda_nid_t ad1983_adc_nids[1] = { AD1983_ADC };
static hda_nid_t ad1983_capsrc_nids[1] = { 0x15 }; 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, .num_items = 4,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -1348,7 +1348,7 @@ static struct hda_input_mux ad1983_capture_source = { ...@@ -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 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->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1; uinfo->count = 1;
...@@ -1385,7 +1385,7 @@ static int ad1983_spdif_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ ...@@ -1385,7 +1385,7 @@ static int ad1983_spdif_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
return 0; 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_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT),
...@@ -1418,7 +1418,7 @@ static struct snd_kcontrol_new ad1983_mixers[] = { ...@@ -1418,7 +1418,7 @@ static struct snd_kcontrol_new ad1983_mixers[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_verb ad1983_init_verbs[] = { static const struct hda_verb ad1983_init_verbs[] = {
/* Front, HP, Mono; mute as default */ /* Front, HP, Mono; mute as default */
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
{0x06, 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[] = { ...@@ -1458,7 +1458,7 @@ static struct hda_verb ad1983_init_verbs[] = {
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #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 */ { 0x12, HDA_OUTPUT, 0 }, /* Mic */
{ 0x13, HDA_OUTPUT, 0 }, /* Line */ { 0x13, HDA_OUTPUT, 0 }, /* Line */
{ } /* end */ { } /* end */
...@@ -1518,12 +1518,12 @@ static int patch_ad1983(struct hda_codec *codec) ...@@ -1518,12 +1518,12 @@ static int patch_ad1983(struct hda_codec *codec)
#define AD1981_DAC 0x03 #define AD1981_DAC 0x03
#define AD1981_ADC 0x04 #define AD1981_ADC 0x04
static hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC }; static const hda_nid_t ad1981_dac_nids[1] = { AD1981_DAC };
static hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC }; static const hda_nid_t ad1981_adc_nids[1] = { AD1981_ADC };
static hda_nid_t ad1981_capsrc_nids[1] = { 0x15 }; static const hda_nid_t ad1981_capsrc_nids[1] = { 0x15 };
/* 0x0c, 0x09, 0x0e, 0x0f, 0x19, 0x05, 0x18, 0x17 */ /* 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, .num_items = 7,
.items = { .items = {
{ "Front Mic", 0x0 }, { "Front Mic", 0x0 },
...@@ -1536,7 +1536,7 @@ static struct hda_input_mux ad1981_capture_source = { ...@@ -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_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT),
...@@ -1577,7 +1577,7 @@ static struct snd_kcontrol_new ad1981_mixers[] = { ...@@ -1577,7 +1577,7 @@ static struct snd_kcontrol_new ad1981_mixers[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_verb ad1981_init_verbs[] = { static const struct hda_verb ad1981_init_verbs[] = {
/* Front, HP, Mono; mute as default */ /* Front, HP, Mono; mute as default */
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, {0x05, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
{0x06, 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[] = { ...@@ -1625,7 +1625,7 @@ static struct hda_verb ad1981_init_verbs[] = {
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #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 */ { 0x12, HDA_OUTPUT, 0 }, /* Front Mic */
{ 0x13, HDA_OUTPUT, 0 }, /* Line */ { 0x13, HDA_OUTPUT, 0 }, /* Line */
{ 0x1b, HDA_OUTPUT, 0 }, /* Aux */ { 0x1b, HDA_OUTPUT, 0 }, /* Aux */
...@@ -1645,7 +1645,7 @@ static struct hda_amp_list ad1981_loopbacks[] = { ...@@ -1645,7 +1645,7 @@ static struct hda_amp_list ad1981_loopbacks[] = {
#define AD1981_HP_EVENT 0x37 #define AD1981_HP_EVENT 0x37
#define AD1981_MIC_EVENT 0x38 #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 */ {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x00 }, /* default off */
/* pin sensing on HP and Mic jacks */ /* pin sensing on HP and Mic jacks */
{0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT}, {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, ...@@ -1674,7 +1674,7 @@ static int ad1981_hp_master_sw_put(struct snd_kcontrol *kcontrol,
} }
/* bind volumes of both NID 0x05 and 0x06 */ /* 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, .ops = &snd_hda_bind_vol,
.values = { .values = {
HDA_COMPOSE_AMP_VAL(0x05, 3, 0, HDA_OUTPUT), HDA_COMPOSE_AMP_VAL(0x05, 3, 0, HDA_OUTPUT),
...@@ -1696,12 +1696,12 @@ static void ad1981_hp_automute(struct hda_codec *codec) ...@@ -1696,12 +1696,12 @@ static void ad1981_hp_automute(struct hda_codec *codec)
/* toggle input of built-in and mic jack appropriately */ /* toggle input of built-in and mic jack appropriately */
static void ad1981_hp_automic(struct hda_codec *codec) 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}, {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
{0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, {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}, {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
{0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
{} {}
...@@ -1730,7 +1730,7 @@ static void ad1981_hp_unsol_event(struct hda_codec *codec, ...@@ -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, .num_items = 3,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -1739,7 +1739,7 @@ static struct hda_input_mux ad1981_hp_capture_source = { ...@@ -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), HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -1790,7 +1790,7 @@ static int ad1981_hp_init(struct hda_codec *codec) ...@@ -1790,7 +1790,7 @@ static int ad1981_hp_init(struct hda_codec *codec)
} }
/* configuration for Toshiba Laptops */ /* 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 */ {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */
/* pin sensing on HP and Mic jacks */ /* pin sensing on HP and Mic jacks */
{0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT}, {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT},
...@@ -1798,14 +1798,14 @@ static struct hda_verb ad1981_toshiba_init_verbs[] = { ...@@ -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_VOLUME("Amp Volume", 0x1a, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT),
{ } { }
}; };
/* configuration for Lenovo Thinkpad T60 */ /* 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_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Master Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x05, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("PCM Playback Volume", 0x11, 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[] = { ...@@ -1835,7 +1835,7 @@ static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_input_mux ad1981_thinkpad_capture_source = { static const struct hda_input_mux ad1981_thinkpad_capture_source = {
.num_items = 3, .num_items = 3,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -1860,7 +1860,7 @@ static const char * const ad1981_models[AD1981_MODELS] = { ...@@ -1860,7 +1860,7 @@ static const char * const ad1981_models[AD1981_MODELS] = {
[AD1981_TOSHIBA] = "toshiba" [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, 0x0597, "Lenovo Z60", AD1981_THINKPAD),
SND_PCI_QUIRK(0x1014, 0x05b7, "Lenovo Z60m", AD1981_THINKPAD), SND_PCI_QUIRK(0x1014, 0x05b7, "Lenovo Z60m", AD1981_THINKPAD),
/* All HP models */ /* All HP models */
...@@ -2075,32 +2075,32 @@ enum { ...@@ -2075,32 +2075,32 @@ enum {
* mixers * mixers
*/ */
static hda_nid_t ad1988_6stack_dac_nids[4] = { static const hda_nid_t ad1988_6stack_dac_nids[4] = {
0x04, 0x06, 0x05, 0x0a 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 0x04, 0x05, 0x0a
}; };
/* for AD1988A revision-2, DAC2-4 are swapped */ /* 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 0x04, 0x05, 0x0a, 0x06
}; };
static hda_nid_t ad1988_alt_dac_nid[1] = { static const hda_nid_t ad1988_alt_dac_nid[1] = {
0x03 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 0x04, 0x0a, 0x06
}; };
static hda_nid_t ad1988_adc_nids[3] = { static const hda_nid_t ad1988_adc_nids[3] = {
0x08, 0x09, 0x0f 0x08, 0x09, 0x0f
}; };
static hda_nid_t ad1988_capsrc_nids[3] = { static const hda_nid_t ad1988_capsrc_nids[3] = {
0x0c, 0x0d, 0x0e 0x0c, 0x0d, 0x0e
}; };
...@@ -2108,11 +2108,11 @@ static hda_nid_t ad1988_capsrc_nids[3] = { ...@@ -2108,11 +2108,11 @@ static hda_nid_t ad1988_capsrc_nids[3] = {
#define AD1988_SPDIF_OUT_HDMI 0x0b #define AD1988_SPDIF_OUT_HDMI 0x0b
#define AD1988_SPDIF_IN 0x07 #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 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, .num_items = 5,
.items = { .items = {
{ "Front Mic", 0x1 }, /* port-B */ { "Front Mic", 0x1 }, /* port-B */
...@@ -2123,7 +2123,7 @@ static struct hda_input_mux ad1988_6stack_capture_source = { ...@@ -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, .num_items = 3,
.items = { .items = {
{ "Mic/Line", 0x1 }, /* port-B */ { "Mic/Line", 0x1 }, /* port-B */
...@@ -2166,7 +2166,7 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol, ...@@ -2166,7 +2166,7 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
} }
/* 6-stack mode */ /* 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("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Surround Playback Volume", 0x06, 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), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
...@@ -2175,7 +2175,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1[] = { ...@@ -2175,7 +2175,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1[] = {
{ } /* end */ { } /* 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("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Surround Playback Volume", 0x05, 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), 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[] = { ...@@ -2184,7 +2184,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
{ } /* end */ { } /* 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("Front Playback Switch", 0x29, 2, HDA_INPUT),
HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 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), HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT),
...@@ -2211,14 +2211,14 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { ...@@ -2211,14 +2211,14 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
{ } /* end */ { } /* 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), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
{ } /* end */ { } /* end */
}; };
/* 3-stack mode */ /* 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("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 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), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
...@@ -2226,7 +2226,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { ...@@ -2226,7 +2226,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1[] = {
{ } /* end */ { } /* 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("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 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), 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[] = { ...@@ -2234,7 +2234,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
{ } /* end */ { } /* 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("Front Playback Switch", 0x29, 2, HDA_INPUT),
HDA_BIND_MUTE("Surround Playback Switch", 0x2c, 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), HDA_BIND_MUTE_MONO("Center Playback Switch", 0x26, 1, 2, HDA_INPUT),
...@@ -2268,7 +2268,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { ...@@ -2268,7 +2268,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
}; };
/* laptop mode */ /* 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_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("PCM Playback Switch", 0x29, 0x0, HDA_INPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x29, 0x0, HDA_INPUT),
HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT), HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT),
...@@ -2299,7 +2299,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = { ...@@ -2299,7 +2299,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
}; };
/* capture */ /* 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_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 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[] = { ...@@ -2324,7 +2324,7 @@ static struct snd_kcontrol_new ad1988_capture_mixers[] = {
static int ad1988_spdif_playback_source_info(struct snd_kcontrol *kcontrol, static int ad1988_spdif_playback_source_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[] = { static const char * const texts[] = {
"PCM", "ADC1", "ADC2", "ADC3" "PCM", "ADC1", "ADC2", "ADC3"
}; };
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
...@@ -2405,7 +2405,7 @@ static int ad1988_spdif_playback_source_put(struct snd_kcontrol *kcontrol, ...@@ -2405,7 +2405,7 @@ static int ad1988_spdif_playback_source_put(struct snd_kcontrol *kcontrol,
return change; 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), HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -2418,12 +2418,12 @@ static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = { ...@@ -2418,12 +2418,12 @@ static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = {
{ } /* end */ { } /* 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), HDA_CODEC_VOLUME("IEC958 Capture Volume", 0x1c, 0x0, HDA_INPUT),
{ } /* end */ { } /* 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("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("HDMI Playback Volume", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("HDMI Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
{ } /* end */ { } /* end */
...@@ -2436,7 +2436,7 @@ static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = { ...@@ -2436,7 +2436,7 @@ static struct snd_kcontrol_new ad1989_spdif_out_mixers[] = {
/* /*
* for 6-stack (+dig) * 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 */ /* Front, Surround, CLFE, side DAC; unmute as default */
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x06, 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[] = { ...@@ -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 */ /* Headphone; unmute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Port-A front headphon path */ /* Port-A front headphon path */
...@@ -2509,7 +2509,7 @@ static struct hda_verb ad1988_6stack_fp_init_verbs[] = { ...@@ -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 */ /* mute analog mix */
{0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
{0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
...@@ -2527,7 +2527,7 @@ static struct hda_verb ad1988_capture_init_verbs[] = { ...@@ -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 */ /* SPDIF out sel */
{0x02, AC_VERB_SET_CONNECT_SEL, 0x0}, /* PCM */ {0x02, AC_VERB_SET_CONNECT_SEL, 0x0}, /* PCM */
{0x0b, AC_VERB_SET_CONNECT_SEL, 0x0}, /* ADC1 */ {0x0b, AC_VERB_SET_CONNECT_SEL, 0x0}, /* ADC1 */
...@@ -2539,14 +2539,14 @@ static struct hda_verb ad1988_spdif_init_verbs[] = { ...@@ -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 */ /* unmute SPDIF input pin */
{0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
{ } { }
}; };
/* AD1989 has no ADC -> SPDIF route */ /* 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 */ /* SPDIF-1 out pin */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */
...@@ -2559,7 +2559,7 @@ static struct hda_verb ad1989_spdif_init_verbs[] = { ...@@ -2559,7 +2559,7 @@ static struct hda_verb ad1989_spdif_init_verbs[] = {
/* /*
* verbs for 3stack (+dig) * 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 */ /* set port-C to line-in */
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
...@@ -2569,7 +2569,7 @@ static struct hda_verb ad1988_3stack_ch2_init[] = { ...@@ -2569,7 +2569,7 @@ static struct hda_verb ad1988_3stack_ch2_init[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_verb ad1988_3stack_ch6_init[] = { static const struct hda_verb ad1988_3stack_ch6_init[] = {
/* set port-C to surround out */ /* set port-C to surround out */
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
...@@ -2579,12 +2579,12 @@ static struct hda_verb ad1988_3stack_ch6_init[] = { ...@@ -2579,12 +2579,12 @@ static struct hda_verb ad1988_3stack_ch6_init[] = {
{ } /* end */ { } /* 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 }, { 2, ad1988_3stack_ch2_init },
{ 6, ad1988_3stack_ch6_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 */ /* Front, Surround, CLFE, side DAC; unmute as default */
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x06, 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[] = { ...@@ -2644,13 +2644,13 @@ static struct hda_verb ad1988_3stack_init_verbs[] = {
/* /*
* verbs for laptop mode (+dig) * 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 */ /* unmute port-A and mute port-D */
{ 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
{ 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
{ } /* end */ { } /* 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 */ /* mute port-A and unmute port-D */
{ 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, { 0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
{ 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, { 0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
...@@ -2659,7 +2659,7 @@ static struct hda_verb ad1988_laptop_hp_off[] = { ...@@ -2659,7 +2659,7 @@ static struct hda_verb ad1988_laptop_hp_off[] = {
#define AD1988_HP_EVENT 0x01 #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 */ /* Front, Surround, CLFE, side DAC; unmute as default */
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x06, 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) ...@@ -2723,7 +2723,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res)
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #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, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Line */ { 0x20, HDA_INPUT, 1 }, /* Line */
{ 0x20, HDA_INPUT, 4 }, /* Mic */ { 0x20, HDA_INPUT, 4 }, /* Mic */
...@@ -2741,7 +2741,7 @@ enum { ...@@ -2741,7 +2741,7 @@ enum {
AD_CTL_WIDGET_MUTE, AD_CTL_WIDGET_MUTE,
AD_CTL_BIND_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_VOLUME(NULL, 0, 0, 0),
HDA_CODEC_MUTE(NULL, 0, 0, 0), HDA_CODEC_MUTE(NULL, 0, 0, 0),
HDA_BIND_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, ...@@ -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_CD_NID 0x18
#define AD1988_PIN_BEEP_NID 0x10 #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 */ /* A B C D E F G H */
0x22, 0x2b, 0x2c, 0x29, 0x26, 0x2a, 0x27, 0x28 0x22, 0x2b, 0x2c, 0x29, 0x26, 0x2a, 0x27, 0x28
}; };
static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx) 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 */ /* A B C D E F G H */
0x04, 0x06, 0x05, 0x04, 0x0a, 0x06, 0x05, 0x0a 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 */ /* A B C D E F G H */
0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06 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) ...@@ -2791,13 +2791,13 @@ static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx)
return idx_to_dac[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 0x38, 0x39, 0x3a, 0x3d, 0x3c, 0x3b, 0, 0
}; };
static int ad1988_pin_idx(hda_nid_t nid) 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 0x11, 0x14, 0x15, 0x12, 0x17, 0x16, 0x24, 0x25
}; };
int i; int i;
...@@ -2809,7 +2809,7 @@ static int ad1988_pin_idx(hda_nid_t nid) ...@@ -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 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 2, 0, 1, 3, 4, 5, 1, 4
}; };
switch (nid) { switch (nid) {
...@@ -2822,7 +2822,7 @@ static int ad1988_pin_to_loopback_idx(hda_nid_t 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 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 0, 1, 2, 8, 4, 3, 6, 7
}; };
switch (nid) { switch (nid) {
...@@ -3154,7 +3154,7 @@ static const char * const ad1988_models[AD1988_MODEL_LAST] = { ...@@ -3154,7 +3154,7 @@ static const char * const ad1988_models[AD1988_MODEL_LAST] = {
[AD1988_AUTO] = "auto", [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, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", 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, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG),
...@@ -3342,21 +3342,21 @@ static int patch_ad1988(struct hda_codec *codec) ...@@ -3342,21 +3342,21 @@ static int patch_ad1988(struct hda_codec *codec)
* but no build-up framework is given, so far. * 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, 0x04,
}; };
static hda_nid_t ad1884_adc_nids[2] = { static const hda_nid_t ad1884_adc_nids[2] = {
0x08, 0x09, 0x08, 0x09,
}; };
static hda_nid_t ad1884_capsrc_nids[2] = { static const hda_nid_t ad1884_capsrc_nids[2] = {
0x0c, 0x0d, 0x0c, 0x0d,
}; };
#define AD1884_SPDIF_OUT 0x02 #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, .num_items = 4,
.items = { .items = {
{ "Front Mic", 0x0 }, { "Front Mic", 0x0 },
...@@ -3366,7 +3366,7 @@ static struct hda_input_mux ad1884_capture_source = { ...@@ -3366,7 +3366,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("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
/* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 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), HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
...@@ -3410,7 +3410,7 @@ static struct snd_kcontrol_new ad1884_base_mixers[] = { ...@@ -3410,7 +3410,7 @@ static struct snd_kcontrol_new ad1884_base_mixers[] = {
{ } /* end */ { } /* 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_VOLUME("Digital Mic Capture Volume", 0x05, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("Digital Mic Capture Switch", 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, HDA_CODEC_VOLUME_IDX("Digital Mic Capture Volume", 1, 0x06, 0x0,
...@@ -3423,7 +3423,7 @@ static struct snd_kcontrol_new ad1984_dmic_mixers[] = { ...@@ -3423,7 +3423,7 @@ static struct snd_kcontrol_new ad1984_dmic_mixers[] = {
/* /*
* initialization verbs * initialization verbs
*/ */
static struct hda_verb ad1884_init_verbs[] = { static const struct hda_verb ad1884_init_verbs[] = {
/* DACs; mute as default */ /* DACs; mute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
...@@ -3469,7 +3469,7 @@ static struct hda_verb ad1884_init_verbs[] = { ...@@ -3469,7 +3469,7 @@ static struct hda_verb ad1884_init_verbs[] = {
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #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, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */
{ 0x20, HDA_INPUT, 2 }, /* CD */ { 0x20, HDA_INPUT, 2 }, /* CD */
...@@ -3541,7 +3541,7 @@ static int patch_ad1884(struct hda_codec *codec) ...@@ -3541,7 +3541,7 @@ static int patch_ad1884(struct hda_codec *codec)
/* /*
* Lenovo Thinkpad T61/X61 * 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, .num_items = 4,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -3555,7 +3555,7 @@ static struct hda_input_mux ad1984_thinkpad_capture_source = { ...@@ -3555,7 +3555,7 @@ static struct hda_input_mux ad1984_thinkpad_capture_source = {
/* /*
* Dell Precision T3400 * 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, .num_items = 3,
.items = { .items = {
{ "Front Mic", 0x0 }, { "Front Mic", 0x0 },
...@@ -3565,7 +3565,7 @@ static struct hda_input_mux ad1984_dell_desktop_capture_source = { ...@@ -3565,7 +3565,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("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
/* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 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), HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
...@@ -3611,7 +3611,7 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { ...@@ -3611,7 +3611,7 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = {
}; };
/* additional verbs */ /* 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 */ /* Port-E (docking station mic) pin */
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
...@@ -3629,7 +3629,7 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = { ...@@ -3629,7 +3629,7 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = {
/* /*
* Dell Precision T3400 * 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_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT),
...@@ -3680,7 +3680,7 @@ static int ad1984_pcm_dmic_cleanup(struct hda_pcm_stream *hinfo, ...@@ -3680,7 +3680,7 @@ static int ad1984_pcm_dmic_cleanup(struct hda_pcm_stream *hinfo,
return 0; return 0;
} }
static struct hda_pcm_stream ad1984_pcm_dmic_capture = { static const struct hda_pcm_stream ad1984_pcm_dmic_capture = {
.substreams = 2, .substreams = 2,
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
...@@ -3722,7 +3722,7 @@ static const char * const ad1984_models[AD1984_MODELS] = { ...@@ -3722,7 +3722,7 @@ static const char * const ad1984_models[AD1984_MODELS] = {
[AD1984_DELL_DESKTOP] = "dell_desktop", [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 */ /* Lenovo Thinkpad T61/X61 */
SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD),
SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP),
...@@ -3787,7 +3787,7 @@ static int patch_ad1984(struct hda_codec *codec) ...@@ -3787,7 +3787,7 @@ static int patch_ad1984(struct hda_codec *codec)
* We share the single DAC for both HP and line-outs (see AD1884/1984). * 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, 0x03,
}; };
...@@ -3796,7 +3796,7 @@ static hda_nid_t ad1884a_dac_nids[1] = { ...@@ -3796,7 +3796,7 @@ static hda_nid_t ad1884a_dac_nids[1] = {
#define AD1884A_SPDIF_OUT 0x02 #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, .num_items = 5,
.items = { .items = {
{ "Front Mic", 0x0 }, { "Front Mic", 0x0 },
...@@ -3807,7 +3807,7 @@ static struct hda_input_mux ad1884a_capture_source = { ...@@ -3807,7 +3807,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_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT),
...@@ -3859,7 +3859,7 @@ static struct snd_kcontrol_new ad1884a_base_mixers[] = { ...@@ -3859,7 +3859,7 @@ static struct snd_kcontrol_new ad1884a_base_mixers[] = {
/* /*
* initialization verbs * initialization verbs
*/ */
static struct hda_verb ad1884a_init_verbs[] = { static const struct hda_verb ad1884a_init_verbs[] = {
/* DACs; unmute as default */ /* DACs; unmute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
...@@ -3914,7 +3914,7 @@ static struct hda_verb ad1884a_init_verbs[] = { ...@@ -3914,7 +3914,7 @@ static struct hda_verb ad1884a_init_verbs[] = {
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #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, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */
{ 0x20, HDA_INPUT, 2 }, /* CD */ { 0x20, HDA_INPUT, 2 }, /* CD */
...@@ -3947,7 +3947,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol, ...@@ -3947,7 +3947,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol,
return ret; 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), HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -3975,7 +3975,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { ...@@ -3975,7 +3975,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = {
{ } /* end */ { } /* 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_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
/*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/
{ {
...@@ -4095,7 +4095,7 @@ static int ad1884a_laptop_init(struct hda_codec *codec) ...@@ -4095,7 +4095,7 @@ static int ad1884a_laptop_init(struct hda_codec *codec)
} }
/* additional verbs for laptop model */ /* 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 */ /* Port-A (HP) pin - always unmuted */
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Port-F (int speaker) mixer - route only from analog mixer */ /* Port-F (int speaker) mixer - route only from analog mixer */
...@@ -4126,7 +4126,7 @@ static struct hda_verb ad1884a_laptop_verbs[] = { ...@@ -4126,7 +4126,7 @@ static struct hda_verb ad1884a_laptop_verbs[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_verb ad1884a_mobile_verbs[] = { static const struct hda_verb ad1884a_mobile_verbs[] = {
/* DACs; unmute as default */ /* DACs; unmute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
...@@ -4181,7 +4181,7 @@ static struct hda_verb ad1884a_mobile_verbs[] = { ...@@ -4181,7 +4181,7 @@ static struct hda_verb ad1884a_mobile_verbs[] = {
* 0x17 - built-in mic * 0x17 - built-in mic
*/ */
static struct hda_verb ad1984a_thinkpad_verbs[] = { static const struct hda_verb ad1984a_thinkpad_verbs[] = {
/* HP unmute */ /* HP unmute */
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* analog mix */ /* analog mix */
...@@ -4198,7 +4198,7 @@ static struct hda_verb ad1984a_thinkpad_verbs[] = { ...@@ -4198,7 +4198,7 @@ static struct hda_verb ad1984a_thinkpad_verbs[] = {
{ } /* end */ { } /* 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_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT),
...@@ -4219,7 +4219,7 @@ static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { ...@@ -4219,7 +4219,7 @@ static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_input_mux ad1984a_thinkpad_capture_source = { static const struct hda_input_mux ad1984a_thinkpad_capture_source = {
.num_items = 3, .num_items = 3,
.items = { .items = {
{ "Mic", 0x0 }, { "Mic", 0x0 },
...@@ -4262,7 +4262,7 @@ static int ad1984a_thinkpad_init(struct hda_codec *codec) ...@@ -4262,7 +4262,7 @@ static int ad1984a_thinkpad_init(struct hda_codec *codec)
* 0x15 - mic-in * 0x15 - mic-in
*/ */
static struct hda_verb ad1984a_precision_verbs[] = { static const struct hda_verb ad1984a_precision_verbs[] = {
/* Unmute main output path */ /* Unmute main output path */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */ {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */
...@@ -4288,7 +4288,7 @@ static struct hda_verb ad1984a_precision_verbs[] = { ...@@ -4288,7 +4288,7 @@ static struct hda_verb ad1984a_precision_verbs[] = {
{ } /* end */ { } /* 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_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT),
...@@ -4344,7 +4344,7 @@ static int ad1984a_precision_init(struct hda_codec *codec) ...@@ -4344,7 +4344,7 @@ static int ad1984a_precision_init(struct hda_codec *codec)
* digital-mic (0x17) - Internal mic * digital-mic (0x17) - Internal mic
*/ */
static struct hda_verb ad1984a_touchsmart_verbs[] = { static const struct hda_verb ad1984a_touchsmart_verbs[] = {
/* DACs; unmute as default */ /* DACs; unmute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */ {0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
...@@ -4396,7 +4396,7 @@ static struct hda_verb ad1984a_touchsmart_verbs[] = { ...@@ -4396,7 +4396,7 @@ static struct hda_verb ad1984a_touchsmart_verbs[] = {
{ } /* end */ { } /* 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_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
/* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ /* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/
{ {
...@@ -4475,7 +4475,7 @@ static const char * const ad1884a_models[AD1884A_MODELS] = { ...@@ -4475,7 +4475,7 @@ static const char * const ad1884a_models[AD1884A_MODELS] = {
[AD1984A_PRECISION] = "precision", [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(0x1028, 0x04ac, "Precision R5500", AD1984A_PRECISION),
SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP), SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP),
...@@ -4614,22 +4614,22 @@ static int patch_ad1884a(struct hda_codec *codec) ...@@ -4614,22 +4614,22 @@ static int patch_ad1884a(struct hda_codec *codec)
* port-G - rear clfe-out (6stack) * 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 0x04, 0x03, 0x05
}; };
static hda_nid_t ad1882_adc_nids[2] = { static const hda_nid_t ad1882_adc_nids[2] = {
0x08, 0x09, 0x08, 0x09,
}; };
static hda_nid_t ad1882_capsrc_nids[2] = { static const hda_nid_t ad1882_capsrc_nids[2] = {
0x0c, 0x0d, 0x0c, 0x0d,
}; };
#define AD1882_SPDIF_OUT 0x02 #define AD1882_SPDIF_OUT 0x02
/* list: 0x11, 0x39, 0x3a, 0x18, 0x3c, 0x3b, 0x12, 0x20 */ /* 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, .num_items = 5,
.items = { .items = {
{ "Front Mic", 0x1 }, { "Front Mic", 0x1 },
...@@ -4641,7 +4641,7 @@ static struct hda_input_mux ad1882_capture_source = { ...@@ -4641,7 +4641,7 @@ static struct hda_input_mux ad1882_capture_source = {
}; };
/* list: 0x11, 0x39, 0x3a, 0x3c, 0x18, 0x1f, 0x12, 0x20 */ /* 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, .num_items = 5,
.items = { .items = {
{ "Front Mic", 0x1 }, { "Front Mic", 0x1 },
...@@ -4652,7 +4652,7 @@ static struct hda_input_mux ad1882a_capture_source = { ...@@ -4652,7 +4652,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("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 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), HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
...@@ -4694,7 +4694,7 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = { ...@@ -4694,7 +4694,7 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = {
{ } /* end */ { } /* 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_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("Front Mic Playback Switch", 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), HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT),
...@@ -4706,7 +4706,7 @@ static struct snd_kcontrol_new ad1882_loopback_mixers[] = { ...@@ -4706,7 +4706,7 @@ static struct snd_kcontrol_new ad1882_loopback_mixers[] = {
{ } /* end */ { } /* 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_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("Front Mic Playback Switch", 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), HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x04, HDA_INPUT),
...@@ -4719,7 +4719,7 @@ static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { ...@@ -4719,7 +4719,7 @@ static struct snd_kcontrol_new ad1882a_loopback_mixers[] = {
{ } /* end */ { } /* 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("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 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), HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x17, 2, 0x0, HDA_OUTPUT),
...@@ -4733,14 +4733,14 @@ static struct snd_kcontrol_new ad1882_3stack_mixers[] = { ...@@ -4733,14 +4733,14 @@ static struct snd_kcontrol_new ad1882_3stack_mixers[] = {
{ } /* end */ { } /* 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("Surround Playback Switch", 0x16, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x24, 1, 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), HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x24, 2, 0x0, HDA_OUTPUT),
{ } /* end */ { } /* 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}, {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(0)},
{0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
...@@ -4750,7 +4750,7 @@ static struct hda_verb ad1882_ch2_init[] = { ...@@ -4750,7 +4750,7 @@ static struct hda_verb ad1882_ch2_init[] = {
{ } /* end */ { } /* 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}, {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(0)},
{0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
...@@ -4760,7 +4760,7 @@ static struct hda_verb ad1882_ch4_init[] = { ...@@ -4760,7 +4760,7 @@ static struct hda_verb ad1882_ch4_init[] = {
{ } /* end */ { } /* 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}, {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(0)},
{0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
...@@ -4770,7 +4770,7 @@ static struct hda_verb ad1882_ch6_init[] = { ...@@ -4770,7 +4770,7 @@ static struct hda_verb ad1882_ch6_init[] = {
{ } /* end */ { } /* end */
}; };
static struct hda_channel_mode ad1882_modes[3] = { static const struct hda_channel_mode ad1882_modes[3] = {
{ 2, ad1882_ch2_init }, { 2, ad1882_ch2_init },
{ 4, ad1882_ch4_init }, { 4, ad1882_ch4_init },
{ 6, ad1882_ch6_init }, { 6, ad1882_ch6_init },
...@@ -4779,7 +4779,7 @@ static struct hda_channel_mode ad1882_modes[3] = { ...@@ -4779,7 +4779,7 @@ static struct hda_channel_mode ad1882_modes[3] = {
/* /*
* initialization verbs * initialization verbs
*/ */
static struct hda_verb ad1882_init_verbs[] = { static const struct hda_verb ad1882_init_verbs[] = {
/* DACs; mute as default */ /* DACs; mute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
...@@ -4848,7 +4848,7 @@ static struct hda_verb ad1882_init_verbs[] = { ...@@ -4848,7 +4848,7 @@ static struct hda_verb ad1882_init_verbs[] = {
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #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, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */
{ 0x20, HDA_INPUT, 4 }, /* Line */ { 0x20, HDA_INPUT, 4 }, /* Line */
...@@ -4945,7 +4945,7 @@ static int patch_ad1882(struct hda_codec *codec) ...@@ -4945,7 +4945,7 @@ static int patch_ad1882(struct hda_codec *codec)
/* /*
* patch entries * 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 = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a },
{ .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 }, { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 },
{ .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a }, { .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment