diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-02 06:38:19 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-02 06:38:19 -0400 |
commit | 90dd48a1a941d0efd413ce011895e3b6edd49b9a (patch) | |
tree | 5c19c10d16308dbb744c216342642ced15b0a23c /sound/pci | |
parent | 2b63536f0cc20c30619a90dc2d36cc64a9d75c28 (diff) |
ALSA: hda - Constify fixup and other array data in patch_via.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_via.c | 223 |
1 files changed, 112 insertions, 111 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 0bfbacb4e34c..605c99e1e520 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -109,19 +109,19 @@ enum VIA_HDA_CODEC { | |||
109 | 109 | ||
110 | struct via_spec { | 110 | struct via_spec { |
111 | /* codec parameterization */ | 111 | /* codec parameterization */ |
112 | struct snd_kcontrol_new *mixers[6]; | 112 | const struct snd_kcontrol_new *mixers[6]; |
113 | unsigned int num_mixers; | 113 | unsigned int num_mixers; |
114 | 114 | ||
115 | struct hda_verb *init_verbs[5]; | 115 | const struct hda_verb *init_verbs[5]; |
116 | unsigned int num_iverbs; | 116 | unsigned int num_iverbs; |
117 | 117 | ||
118 | char *stream_name_analog; | 118 | char *stream_name_analog; |
119 | struct hda_pcm_stream *stream_analog_playback; | 119 | const struct hda_pcm_stream *stream_analog_playback; |
120 | struct hda_pcm_stream *stream_analog_capture; | 120 | const struct hda_pcm_stream *stream_analog_capture; |
121 | 121 | ||
122 | char *stream_name_digital; | 122 | char *stream_name_digital; |
123 | struct hda_pcm_stream *stream_digital_playback; | 123 | const struct hda_pcm_stream *stream_digital_playback; |
124 | struct hda_pcm_stream *stream_digital_capture; | 124 | const struct hda_pcm_stream *stream_digital_capture; |
125 | 125 | ||
126 | /* playback */ | 126 | /* playback */ |
127 | struct hda_multi_out multiout; | 127 | struct hda_multi_out multiout; |
@@ -129,7 +129,7 @@ struct via_spec { | |||
129 | 129 | ||
130 | /* capture */ | 130 | /* capture */ |
131 | unsigned int num_adc_nids; | 131 | unsigned int num_adc_nids; |
132 | hda_nid_t *adc_nids; | 132 | const hda_nid_t *adc_nids; |
133 | hda_nid_t mux_nids[3]; | 133 | hda_nid_t mux_nids[3]; |
134 | hda_nid_t dig_in_nid; | 134 | hda_nid_t dig_in_nid; |
135 | hda_nid_t dig_in_pin; | 135 | hda_nid_t dig_in_pin; |
@@ -410,54 +410,54 @@ static int bind_pin_switch_put(struct snd_kcontrol *kcontrol, | |||
410 | .put = bind_pin_switch_put, \ | 410 | .put = bind_pin_switch_put, \ |
411 | .private_value = HDA_COMPOSE_AMP_VAL(0, 3, 0, 0) } | 411 | .private_value = HDA_COMPOSE_AMP_VAL(0, 3, 0, 0) } |
412 | 412 | ||
413 | static struct snd_kcontrol_new via_control_templates[] = { | 413 | static const struct snd_kcontrol_new via_control_templates[] = { |
414 | HDA_CODEC_VOLUME(NULL, 0, 0, 0), | 414 | HDA_CODEC_VOLUME(NULL, 0, 0, 0), |
415 | HDA_CODEC_MUTE(NULL, 0, 0, 0), | 415 | HDA_CODEC_MUTE(NULL, 0, 0, 0), |
416 | ANALOG_INPUT_MUTE, | 416 | ANALOG_INPUT_MUTE, |
417 | BIND_PIN_MUTE, | 417 | BIND_PIN_MUTE, |
418 | }; | 418 | }; |
419 | 419 | ||
420 | static hda_nid_t vt1708_adc_nids[2] = { | 420 | static const hda_nid_t vt1708_adc_nids[2] = { |
421 | /* ADC1-2 */ | 421 | /* ADC1-2 */ |
422 | 0x15, 0x27 | 422 | 0x15, 0x27 |
423 | }; | 423 | }; |
424 | 424 | ||
425 | static hda_nid_t vt1709_adc_nids[3] = { | 425 | static const hda_nid_t vt1709_adc_nids[3] = { |
426 | /* ADC1-2 */ | 426 | /* ADC1-2 */ |
427 | 0x14, 0x15, 0x16 | 427 | 0x14, 0x15, 0x16 |
428 | }; | 428 | }; |
429 | 429 | ||
430 | static hda_nid_t vt1708B_adc_nids[2] = { | 430 | static const hda_nid_t vt1708B_adc_nids[2] = { |
431 | /* ADC1-2 */ | 431 | /* ADC1-2 */ |
432 | 0x13, 0x14 | 432 | 0x13, 0x14 |
433 | }; | 433 | }; |
434 | 434 | ||
435 | static hda_nid_t vt1708S_adc_nids[2] = { | 435 | static const hda_nid_t vt1708S_adc_nids[2] = { |
436 | /* ADC1-2 */ | 436 | /* ADC1-2 */ |
437 | 0x13, 0x14 | 437 | 0x13, 0x14 |
438 | }; | 438 | }; |
439 | 439 | ||
440 | static hda_nid_t vt1702_adc_nids[3] = { | 440 | static const hda_nid_t vt1702_adc_nids[3] = { |
441 | /* ADC1-2 */ | 441 | /* ADC1-2 */ |
442 | 0x12, 0x20, 0x1F | 442 | 0x12, 0x20, 0x1F |
443 | }; | 443 | }; |
444 | 444 | ||
445 | static hda_nid_t vt1718S_adc_nids[2] = { | 445 | static const hda_nid_t vt1718S_adc_nids[2] = { |
446 | /* ADC1-2 */ | 446 | /* ADC1-2 */ |
447 | 0x10, 0x11 | 447 | 0x10, 0x11 |
448 | }; | 448 | }; |
449 | 449 | ||
450 | static hda_nid_t vt1716S_adc_nids[2] = { | 450 | static const hda_nid_t vt1716S_adc_nids[2] = { |
451 | /* ADC1-2 */ | 451 | /* ADC1-2 */ |
452 | 0x13, 0x14 | 452 | 0x13, 0x14 |
453 | }; | 453 | }; |
454 | 454 | ||
455 | static hda_nid_t vt2002P_adc_nids[2] = { | 455 | static const hda_nid_t vt2002P_adc_nids[2] = { |
456 | /* ADC1-2 */ | 456 | /* ADC1-2 */ |
457 | 0x10, 0x11 | 457 | 0x10, 0x11 |
458 | }; | 458 | }; |
459 | 459 | ||
460 | static hda_nid_t vt1812_adc_nids[2] = { | 460 | static const hda_nid_t vt1812_adc_nids[2] = { |
461 | /* ADC1-2 */ | 461 | /* ADC1-2 */ |
462 | 0x10, 0x11 | 462 | 0x10, 0x11 |
463 | }; | 463 | }; |
@@ -487,7 +487,7 @@ static int __via_add_control(struct via_spec *spec, int type, const char *name, | |||
487 | __via_add_control(spec, type, name, 0, val) | 487 | __via_add_control(spec, type, name, 0, val) |
488 | 488 | ||
489 | static struct snd_kcontrol_new *via_clone_control(struct via_spec *spec, | 489 | static struct snd_kcontrol_new *via_clone_control(struct via_spec *spec, |
490 | struct snd_kcontrol_new *tmpl) | 490 | const struct snd_kcontrol_new *tmpl) |
491 | { | 491 | { |
492 | struct snd_kcontrol_new *knew; | 492 | struct snd_kcontrol_new *knew; |
493 | 493 | ||
@@ -780,7 +780,7 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol, | |||
780 | return 0; | 780 | return 0; |
781 | } | 781 | } |
782 | 782 | ||
783 | static struct snd_kcontrol_new via_hp_mixer[2] = { | 783 | static const struct snd_kcontrol_new via_hp_mixer[2] = { |
784 | { | 784 | { |
785 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 785 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
786 | .name = "Independent HP", | 786 | .name = "Independent HP", |
@@ -1003,7 +1003,7 @@ static int via_smart51_put(struct snd_kcontrol *kcontrol, | |||
1003 | return 1; | 1003 | return 1; |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | static struct snd_kcontrol_new via_smart51_mixer[2] = { | 1006 | static const struct snd_kcontrol_new via_smart51_mixer[2] = { |
1007 | { | 1007 | { |
1008 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1008 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1009 | .name = "Smart 5.1", | 1009 | .name = "Smart 5.1", |
@@ -1049,7 +1049,7 @@ static int via_smart51_build(struct via_spec *spec) | |||
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | /* capture mixer elements */ | 1051 | /* capture mixer elements */ |
1052 | static struct snd_kcontrol_new vt1708_capture_mixer[] = { | 1052 | static const struct snd_kcontrol_new vt1708_capture_mixer[] = { |
1053 | HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_INPUT), | 1053 | HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_INPUT), |
1054 | HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_INPUT), | 1054 | HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_INPUT), |
1055 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x27, 0x0, HDA_INPUT), | 1055 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x27, 0x0, HDA_INPUT), |
@@ -1179,7 +1179,7 @@ static void analog_low_current_mode(struct hda_codec *codec, int stream_idle) | |||
1179 | /* | 1179 | /* |
1180 | * generic initialization of ADC, input mixers and output mixers | 1180 | * generic initialization of ADC, input mixers and output mixers |
1181 | */ | 1181 | */ |
1182 | static struct hda_verb vt1708_volume_init_verbs[] = { | 1182 | static const struct hda_verb vt1708_volume_init_verbs[] = { |
1183 | /* | 1183 | /* |
1184 | * Unmute ADC0-1 and set the default input to mic-in | 1184 | * Unmute ADC0-1 and set the default input to mic-in |
1185 | */ | 1185 | */ |
@@ -1421,7 +1421,7 @@ static int via_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, | |||
1421 | return 0; | 1421 | return 0; |
1422 | } | 1422 | } |
1423 | 1423 | ||
1424 | static struct hda_pcm_stream vt1708_pcm_analog_playback = { | 1424 | static const struct hda_pcm_stream vt1708_pcm_analog_playback = { |
1425 | .substreams = 2, | 1425 | .substreams = 2, |
1426 | .channels_min = 2, | 1426 | .channels_min = 2, |
1427 | .channels_max = 8, | 1427 | .channels_max = 8, |
@@ -1433,7 +1433,7 @@ static struct hda_pcm_stream vt1708_pcm_analog_playback = { | |||
1433 | }, | 1433 | }, |
1434 | }; | 1434 | }; |
1435 | 1435 | ||
1436 | static struct hda_pcm_stream vt1708_pcm_analog_s16_playback = { | 1436 | static const struct hda_pcm_stream vt1708_pcm_analog_s16_playback = { |
1437 | .substreams = 2, | 1437 | .substreams = 2, |
1438 | .channels_min = 2, | 1438 | .channels_min = 2, |
1439 | .channels_max = 8, | 1439 | .channels_max = 8, |
@@ -1450,7 +1450,7 @@ static struct hda_pcm_stream vt1708_pcm_analog_s16_playback = { | |||
1450 | }, | 1450 | }, |
1451 | }; | 1451 | }; |
1452 | 1452 | ||
1453 | static struct hda_pcm_stream vt1708_pcm_analog_capture = { | 1453 | static const struct hda_pcm_stream vt1708_pcm_analog_capture = { |
1454 | .substreams = 2, | 1454 | .substreams = 2, |
1455 | .channels_min = 2, | 1455 | .channels_min = 2, |
1456 | .channels_max = 2, | 1456 | .channels_max = 2, |
@@ -1461,7 +1461,7 @@ static struct hda_pcm_stream vt1708_pcm_analog_capture = { | |||
1461 | }, | 1461 | }, |
1462 | }; | 1462 | }; |
1463 | 1463 | ||
1464 | static struct hda_pcm_stream vt1708_pcm_digital_playback = { | 1464 | static const struct hda_pcm_stream vt1708_pcm_digital_playback = { |
1465 | .substreams = 1, | 1465 | .substreams = 1, |
1466 | .channels_min = 2, | 1466 | .channels_min = 2, |
1467 | .channels_max = 2, | 1467 | .channels_max = 2, |
@@ -1474,7 +1474,7 @@ static struct hda_pcm_stream vt1708_pcm_digital_playback = { | |||
1474 | }, | 1474 | }, |
1475 | }; | 1475 | }; |
1476 | 1476 | ||
1477 | static struct hda_pcm_stream vt1708_pcm_digital_capture = { | 1477 | static const struct hda_pcm_stream vt1708_pcm_digital_capture = { |
1478 | .substreams = 1, | 1478 | .substreams = 1, |
1479 | .channels_min = 2, | 1479 | .channels_min = 2, |
1480 | .channels_max = 2, | 1480 | .channels_max = 2, |
@@ -1484,7 +1484,7 @@ static int via_build_controls(struct hda_codec *codec) | |||
1484 | { | 1484 | { |
1485 | struct via_spec *spec = codec->spec; | 1485 | struct via_spec *spec = codec->spec; |
1486 | struct snd_kcontrol *kctl; | 1486 | struct snd_kcontrol *kctl; |
1487 | struct snd_kcontrol_new *knew; | 1487 | const struct snd_kcontrol_new *knew; |
1488 | int err, i; | 1488 | int err, i; |
1489 | 1489 | ||
1490 | for (i = 0; i < spec->num_mixers; i++) { | 1490 | for (i = 0; i < spec->num_mixers; i++) { |
@@ -1819,7 +1819,7 @@ static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid) | |||
1819 | 1819 | ||
1820 | /* | 1820 | /* |
1821 | */ | 1821 | */ |
1822 | static struct hda_codec_ops via_patch_ops = { | 1822 | static const struct hda_codec_ops via_patch_ops = { |
1823 | .build_controls = via_build_controls, | 1823 | .build_controls = via_build_controls, |
1824 | .build_pcms = via_build_pcms, | 1824 | .build_pcms = via_build_pcms, |
1825 | .init = via_init, | 1825 | .init = via_init, |
@@ -2002,7 +2002,8 @@ static int vt1708_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
2002 | static int vt_auto_create_analog_input_ctls(struct hda_codec *codec, | 2002 | static int vt_auto_create_analog_input_ctls(struct hda_codec *codec, |
2003 | const struct auto_pin_cfg *cfg, | 2003 | const struct auto_pin_cfg *cfg, |
2004 | hda_nid_t cap_nid, | 2004 | hda_nid_t cap_nid, |
2005 | hda_nid_t pin_idxs[], int num_idxs) | 2005 | const hda_nid_t pin_idxs[], |
2006 | int num_idxs) | ||
2006 | { | 2007 | { |
2007 | struct via_spec *spec = codec->spec; | 2008 | struct via_spec *spec = codec->spec; |
2008 | struct hda_input_mux *imux = &spec->private_imux[0]; | 2009 | struct hda_input_mux *imux = &spec->private_imux[0]; |
@@ -2048,13 +2049,13 @@ static int vt_auto_create_analog_input_ctls(struct hda_codec *codec, | |||
2048 | static int vt1708_auto_create_analog_input_ctls(struct hda_codec *codec, | 2049 | static int vt1708_auto_create_analog_input_ctls(struct hda_codec *codec, |
2049 | const struct auto_pin_cfg *cfg) | 2050 | const struct auto_pin_cfg *cfg) |
2050 | { | 2051 | { |
2051 | static hda_nid_t pin_idxs[] = { 0xff, 0x24, 0x1d, 0x1e, 0x21 }; | 2052 | static const hda_nid_t pin_idxs[] = { 0xff, 0x24, 0x1d, 0x1e, 0x21 }; |
2052 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x17, pin_idxs, | 2053 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x17, pin_idxs, |
2053 | ARRAY_SIZE(pin_idxs)); | 2054 | ARRAY_SIZE(pin_idxs)); |
2054 | } | 2055 | } |
2055 | 2056 | ||
2056 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2057 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
2057 | static struct hda_amp_list vt1708_loopbacks[] = { | 2058 | static const struct hda_amp_list vt1708_loopbacks[] = { |
2058 | { 0x17, HDA_INPUT, 1 }, | 2059 | { 0x17, HDA_INPUT, 1 }, |
2059 | { 0x17, HDA_INPUT, 2 }, | 2060 | { 0x17, HDA_INPUT, 2 }, |
2060 | { 0x17, HDA_INPUT, 3 }, | 2061 | { 0x17, HDA_INPUT, 3 }, |
@@ -2113,7 +2114,7 @@ static int vt1708_jack_detectect_put(struct snd_kcontrol *kcontrol, | |||
2113 | return change; | 2114 | return change; |
2114 | } | 2115 | } |
2115 | 2116 | ||
2116 | static struct snd_kcontrol_new vt1708_jack_detectect[] = { | 2117 | static const struct snd_kcontrol_new vt1708_jack_detectect[] = { |
2117 | { | 2118 | { |
2118 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2119 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2119 | .name = "Jack Detect", | 2120 | .name = "Jack Detect", |
@@ -2293,7 +2294,7 @@ static int patch_vt1708(struct hda_codec *codec) | |||
2293 | } | 2294 | } |
2294 | 2295 | ||
2295 | /* capture mixer elements */ | 2296 | /* capture mixer elements */ |
2296 | static struct snd_kcontrol_new vt1709_capture_mixer[] = { | 2297 | static const struct snd_kcontrol_new vt1709_capture_mixer[] = { |
2297 | HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x0, HDA_INPUT), | 2298 | HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x0, HDA_INPUT), |
2298 | HDA_CODEC_MUTE("Capture Switch", 0x14, 0x0, HDA_INPUT), | 2299 | HDA_CODEC_MUTE("Capture Switch", 0x14, 0x0, HDA_INPUT), |
2299 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x15, 0x0, HDA_INPUT), | 2300 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x15, 0x0, HDA_INPUT), |
@@ -2315,7 +2316,7 @@ static struct snd_kcontrol_new vt1709_capture_mixer[] = { | |||
2315 | { } /* end */ | 2316 | { } /* end */ |
2316 | }; | 2317 | }; |
2317 | 2318 | ||
2318 | static struct hda_verb vt1709_uniwill_init_verbs[] = { | 2319 | static const struct hda_verb vt1709_uniwill_init_verbs[] = { |
2319 | {0x20, AC_VERB_SET_UNSOLICITED_ENABLE, | 2320 | {0x20, AC_VERB_SET_UNSOLICITED_ENABLE, |
2320 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | 2321 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
2321 | { } | 2322 | { } |
@@ -2324,7 +2325,7 @@ static struct hda_verb vt1709_uniwill_init_verbs[] = { | |||
2324 | /* | 2325 | /* |
2325 | * generic initialization of ADC, input mixers and output mixers | 2326 | * generic initialization of ADC, input mixers and output mixers |
2326 | */ | 2327 | */ |
2327 | static struct hda_verb vt1709_10ch_volume_init_verbs[] = { | 2328 | static const struct hda_verb vt1709_10ch_volume_init_verbs[] = { |
2328 | /* | 2329 | /* |
2329 | * Unmute ADC0-2 and set the default input to mic-in | 2330 | * Unmute ADC0-2 and set the default input to mic-in |
2330 | */ | 2331 | */ |
@@ -2364,7 +2365,7 @@ static struct hda_verb vt1709_10ch_volume_init_verbs[] = { | |||
2364 | { } | 2365 | { } |
2365 | }; | 2366 | }; |
2366 | 2367 | ||
2367 | static struct hda_pcm_stream vt1709_10ch_pcm_analog_playback = { | 2368 | static const struct hda_pcm_stream vt1709_10ch_pcm_analog_playback = { |
2368 | .substreams = 1, | 2369 | .substreams = 1, |
2369 | .channels_min = 2, | 2370 | .channels_min = 2, |
2370 | .channels_max = 10, | 2371 | .channels_max = 10, |
@@ -2376,7 +2377,7 @@ static struct hda_pcm_stream vt1709_10ch_pcm_analog_playback = { | |||
2376 | }, | 2377 | }, |
2377 | }; | 2378 | }; |
2378 | 2379 | ||
2379 | static struct hda_pcm_stream vt1709_6ch_pcm_analog_playback = { | 2380 | static const struct hda_pcm_stream vt1709_6ch_pcm_analog_playback = { |
2380 | .substreams = 1, | 2381 | .substreams = 1, |
2381 | .channels_min = 2, | 2382 | .channels_min = 2, |
2382 | .channels_max = 6, | 2383 | .channels_max = 6, |
@@ -2388,7 +2389,7 @@ static struct hda_pcm_stream vt1709_6ch_pcm_analog_playback = { | |||
2388 | }, | 2389 | }, |
2389 | }; | 2390 | }; |
2390 | 2391 | ||
2391 | static struct hda_pcm_stream vt1709_pcm_analog_capture = { | 2392 | static const struct hda_pcm_stream vt1709_pcm_analog_capture = { |
2392 | .substreams = 2, | 2393 | .substreams = 2, |
2393 | .channels_min = 2, | 2394 | .channels_min = 2, |
2394 | .channels_max = 2, | 2395 | .channels_max = 2, |
@@ -2399,7 +2400,7 @@ static struct hda_pcm_stream vt1709_pcm_analog_capture = { | |||
2399 | }, | 2400 | }, |
2400 | }; | 2401 | }; |
2401 | 2402 | ||
2402 | static struct hda_pcm_stream vt1709_pcm_digital_playback = { | 2403 | static const struct hda_pcm_stream vt1709_pcm_digital_playback = { |
2403 | .substreams = 1, | 2404 | .substreams = 1, |
2404 | .channels_min = 2, | 2405 | .channels_min = 2, |
2405 | .channels_max = 2, | 2406 | .channels_max = 2, |
@@ -2410,7 +2411,7 @@ static struct hda_pcm_stream vt1709_pcm_digital_playback = { | |||
2410 | }, | 2411 | }, |
2411 | }; | 2412 | }; |
2412 | 2413 | ||
2413 | static struct hda_pcm_stream vt1709_pcm_digital_capture = { | 2414 | static const struct hda_pcm_stream vt1709_pcm_digital_capture = { |
2414 | .substreams = 1, | 2415 | .substreams = 1, |
2415 | .channels_min = 2, | 2416 | .channels_min = 2, |
2416 | .channels_max = 2, | 2417 | .channels_max = 2, |
@@ -2622,7 +2623,7 @@ static int vt1709_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
2622 | static int vt1709_auto_create_analog_input_ctls(struct hda_codec *codec, | 2623 | static int vt1709_auto_create_analog_input_ctls(struct hda_codec *codec, |
2623 | const struct auto_pin_cfg *cfg) | 2624 | const struct auto_pin_cfg *cfg) |
2624 | { | 2625 | { |
2625 | static hda_nid_t pin_idxs[] = { 0xff, 0x23, 0x1d, 0x1e, 0x21 }; | 2626 | static const hda_nid_t pin_idxs[] = { 0xff, 0x23, 0x1d, 0x1e, 0x21 }; |
2626 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x18, pin_idxs, | 2627 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x18, pin_idxs, |
2627 | ARRAY_SIZE(pin_idxs)); | 2628 | ARRAY_SIZE(pin_idxs)); |
2628 | } | 2629 | } |
@@ -2672,7 +2673,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec) | |||
2672 | } | 2673 | } |
2673 | 2674 | ||
2674 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2675 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
2675 | static struct hda_amp_list vt1709_loopbacks[] = { | 2676 | static const struct hda_amp_list vt1709_loopbacks[] = { |
2676 | { 0x18, HDA_INPUT, 1 }, | 2677 | { 0x18, HDA_INPUT, 1 }, |
2677 | { 0x18, HDA_INPUT, 2 }, | 2678 | { 0x18, HDA_INPUT, 2 }, |
2678 | { 0x18, HDA_INPUT, 3 }, | 2679 | { 0x18, HDA_INPUT, 3 }, |
@@ -2733,7 +2734,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec) | |||
2733 | /* | 2734 | /* |
2734 | * generic initialization of ADC, input mixers and output mixers | 2735 | * generic initialization of ADC, input mixers and output mixers |
2735 | */ | 2736 | */ |
2736 | static struct hda_verb vt1709_6ch_volume_init_verbs[] = { | 2737 | static const struct hda_verb vt1709_6ch_volume_init_verbs[] = { |
2737 | /* | 2738 | /* |
2738 | * Unmute ADC0-2 and set the default input to mic-in | 2739 | * Unmute ADC0-2 and set the default input to mic-in |
2739 | */ | 2740 | */ |
@@ -2823,7 +2824,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec) | |||
2823 | } | 2824 | } |
2824 | 2825 | ||
2825 | /* capture mixer elements */ | 2826 | /* capture mixer elements */ |
2826 | static struct snd_kcontrol_new vt1708B_capture_mixer[] = { | 2827 | static const struct snd_kcontrol_new vt1708B_capture_mixer[] = { |
2827 | HDA_CODEC_VOLUME("Capture Volume", 0x13, 0x0, HDA_INPUT), | 2828 | HDA_CODEC_VOLUME("Capture Volume", 0x13, 0x0, HDA_INPUT), |
2828 | HDA_CODEC_MUTE("Capture Switch", 0x13, 0x0, HDA_INPUT), | 2829 | HDA_CODEC_MUTE("Capture Switch", 0x13, 0x0, HDA_INPUT), |
2829 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x14, 0x0, HDA_INPUT), | 2830 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x14, 0x0, HDA_INPUT), |
@@ -2845,7 +2846,7 @@ static struct snd_kcontrol_new vt1708B_capture_mixer[] = { | |||
2845 | /* | 2846 | /* |
2846 | * generic initialization of ADC, input mixers and output mixers | 2847 | * generic initialization of ADC, input mixers and output mixers |
2847 | */ | 2848 | */ |
2848 | static struct hda_verb vt1708B_8ch_volume_init_verbs[] = { | 2849 | static const struct hda_verb vt1708B_8ch_volume_init_verbs[] = { |
2849 | /* | 2850 | /* |
2850 | * Unmute ADC0-1 and set the default input to mic-in | 2851 | * Unmute ADC0-1 and set the default input to mic-in |
2851 | */ | 2852 | */ |
@@ -2880,7 +2881,7 @@ static struct hda_verb vt1708B_8ch_volume_init_verbs[] = { | |||
2880 | { } | 2881 | { } |
2881 | }; | 2882 | }; |
2882 | 2883 | ||
2883 | static struct hda_verb vt1708B_4ch_volume_init_verbs[] = { | 2884 | static const struct hda_verb vt1708B_4ch_volume_init_verbs[] = { |
2884 | /* | 2885 | /* |
2885 | * Unmute ADC0-1 and set the default input to mic-in | 2886 | * Unmute ADC0-1 and set the default input to mic-in |
2886 | */ | 2887 | */ |
@@ -2915,7 +2916,7 @@ static struct hda_verb vt1708B_4ch_volume_init_verbs[] = { | |||
2915 | { } | 2916 | { } |
2916 | }; | 2917 | }; |
2917 | 2918 | ||
2918 | static struct hda_verb vt1708B_uniwill_init_verbs[] = { | 2919 | static const struct hda_verb vt1708B_uniwill_init_verbs[] = { |
2919 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, | 2920 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, |
2920 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | 2921 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
2921 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | 2922 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, |
@@ -2939,7 +2940,7 @@ static int via_pcm_open_close(struct hda_pcm_stream *hinfo, | |||
2939 | return 0; | 2940 | return 0; |
2940 | } | 2941 | } |
2941 | 2942 | ||
2942 | static struct hda_pcm_stream vt1708B_8ch_pcm_analog_playback = { | 2943 | static const struct hda_pcm_stream vt1708B_8ch_pcm_analog_playback = { |
2943 | .substreams = 2, | 2944 | .substreams = 2, |
2944 | .channels_min = 2, | 2945 | .channels_min = 2, |
2945 | .channels_max = 8, | 2946 | .channels_max = 8, |
@@ -2952,7 +2953,7 @@ static struct hda_pcm_stream vt1708B_8ch_pcm_analog_playback = { | |||
2952 | }, | 2953 | }, |
2953 | }; | 2954 | }; |
2954 | 2955 | ||
2955 | static struct hda_pcm_stream vt1708B_4ch_pcm_analog_playback = { | 2956 | static const struct hda_pcm_stream vt1708B_4ch_pcm_analog_playback = { |
2956 | .substreams = 2, | 2957 | .substreams = 2, |
2957 | .channels_min = 2, | 2958 | .channels_min = 2, |
2958 | .channels_max = 4, | 2959 | .channels_max = 4, |
@@ -2964,7 +2965,7 @@ static struct hda_pcm_stream vt1708B_4ch_pcm_analog_playback = { | |||
2964 | }, | 2965 | }, |
2965 | }; | 2966 | }; |
2966 | 2967 | ||
2967 | static struct hda_pcm_stream vt1708B_pcm_analog_capture = { | 2968 | static const struct hda_pcm_stream vt1708B_pcm_analog_capture = { |
2968 | .substreams = 2, | 2969 | .substreams = 2, |
2969 | .channels_min = 2, | 2970 | .channels_min = 2, |
2970 | .channels_max = 2, | 2971 | .channels_max = 2, |
@@ -2977,7 +2978,7 @@ static struct hda_pcm_stream vt1708B_pcm_analog_capture = { | |||
2977 | }, | 2978 | }, |
2978 | }; | 2979 | }; |
2979 | 2980 | ||
2980 | static struct hda_pcm_stream vt1708B_pcm_digital_playback = { | 2981 | static const struct hda_pcm_stream vt1708B_pcm_digital_playback = { |
2981 | .substreams = 1, | 2982 | .substreams = 1, |
2982 | .channels_min = 2, | 2983 | .channels_min = 2, |
2983 | .channels_max = 2, | 2984 | .channels_max = 2, |
@@ -2990,7 +2991,7 @@ static struct hda_pcm_stream vt1708B_pcm_digital_playback = { | |||
2990 | }, | 2991 | }, |
2991 | }; | 2992 | }; |
2992 | 2993 | ||
2993 | static struct hda_pcm_stream vt1708B_pcm_digital_capture = { | 2994 | static const struct hda_pcm_stream vt1708B_pcm_digital_capture = { |
2994 | .substreams = 1, | 2995 | .substreams = 1, |
2995 | .channels_min = 2, | 2996 | .channels_min = 2, |
2996 | .channels_max = 2, | 2997 | .channels_max = 2, |
@@ -3154,7 +3155,7 @@ static int vt1708B_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
3154 | static int vt1708B_auto_create_analog_input_ctls(struct hda_codec *codec, | 3155 | static int vt1708B_auto_create_analog_input_ctls(struct hda_codec *codec, |
3155 | const struct auto_pin_cfg *cfg) | 3156 | const struct auto_pin_cfg *cfg) |
3156 | { | 3157 | { |
3157 | static hda_nid_t pin_idxs[] = { 0xff, 0x1f, 0x1a, 0x1b, 0x1e }; | 3158 | static const hda_nid_t pin_idxs[] = { 0xff, 0x1f, 0x1a, 0x1b, 0x1e }; |
3158 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, | 3159 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, |
3159 | ARRAY_SIZE(pin_idxs)); | 3160 | ARRAY_SIZE(pin_idxs)); |
3160 | } | 3161 | } |
@@ -3204,7 +3205,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec) | |||
3204 | } | 3205 | } |
3205 | 3206 | ||
3206 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3207 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
3207 | static struct hda_amp_list vt1708B_loopbacks[] = { | 3208 | static const struct hda_amp_list vt1708B_loopbacks[] = { |
3208 | { 0x16, HDA_INPUT, 1 }, | 3209 | { 0x16, HDA_INPUT, 1 }, |
3209 | { 0x16, HDA_INPUT, 2 }, | 3210 | { 0x16, HDA_INPUT, 2 }, |
3210 | { 0x16, HDA_INPUT, 3 }, | 3211 | { 0x16, HDA_INPUT, 3 }, |
@@ -3403,7 +3404,7 @@ static int patch_vt1708B_4ch(struct hda_codec *codec) | |||
3403 | /* Patch for VT1708S */ | 3404 | /* Patch for VT1708S */ |
3404 | 3405 | ||
3405 | /* capture mixer elements */ | 3406 | /* capture mixer elements */ |
3406 | static struct snd_kcontrol_new vt1708S_capture_mixer[] = { | 3407 | static const struct snd_kcontrol_new vt1708S_capture_mixer[] = { |
3407 | HDA_CODEC_VOLUME("Capture Volume", 0x13, 0x0, HDA_INPUT), | 3408 | HDA_CODEC_VOLUME("Capture Volume", 0x13, 0x0, HDA_INPUT), |
3408 | HDA_CODEC_MUTE("Capture Switch", 0x13, 0x0, HDA_INPUT), | 3409 | HDA_CODEC_MUTE("Capture Switch", 0x13, 0x0, HDA_INPUT), |
3409 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x14, 0x0, HDA_INPUT), | 3410 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x14, 0x0, HDA_INPUT), |
@@ -3426,7 +3427,7 @@ static struct snd_kcontrol_new vt1708S_capture_mixer[] = { | |||
3426 | { } /* end */ | 3427 | { } /* end */ |
3427 | }; | 3428 | }; |
3428 | 3429 | ||
3429 | static struct hda_verb vt1708S_volume_init_verbs[] = { | 3430 | static const struct hda_verb vt1708S_volume_init_verbs[] = { |
3430 | /* Unmute ADC0-1 and set the default input to mic-in */ | 3431 | /* Unmute ADC0-1 and set the default input to mic-in */ |
3431 | {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | 3432 | {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
3432 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | 3433 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
@@ -3452,7 +3453,7 @@ static struct hda_verb vt1708S_volume_init_verbs[] = { | |||
3452 | { } | 3453 | { } |
3453 | }; | 3454 | }; |
3454 | 3455 | ||
3455 | static struct hda_verb vt1708S_uniwill_init_verbs[] = { | 3456 | static const struct hda_verb vt1708S_uniwill_init_verbs[] = { |
3456 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, | 3457 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, |
3457 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | 3458 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
3458 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | 3459 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, |
@@ -3465,7 +3466,7 @@ static struct hda_verb vt1708S_uniwill_init_verbs[] = { | |||
3465 | { } | 3466 | { } |
3466 | }; | 3467 | }; |
3467 | 3468 | ||
3468 | static struct hda_verb vt1705_uniwill_init_verbs[] = { | 3469 | static const struct hda_verb vt1705_uniwill_init_verbs[] = { |
3469 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, | 3470 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, |
3470 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | 3471 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
3471 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | 3472 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, |
@@ -3477,7 +3478,7 @@ static struct hda_verb vt1705_uniwill_init_verbs[] = { | |||
3477 | { } | 3478 | { } |
3478 | }; | 3479 | }; |
3479 | 3480 | ||
3480 | static struct hda_pcm_stream vt1708S_pcm_analog_playback = { | 3481 | static const struct hda_pcm_stream vt1708S_pcm_analog_playback = { |
3481 | .substreams = 2, | 3482 | .substreams = 2, |
3482 | .channels_min = 2, | 3483 | .channels_min = 2, |
3483 | .channels_max = 8, | 3484 | .channels_max = 8, |
@@ -3490,7 +3491,7 @@ static struct hda_pcm_stream vt1708S_pcm_analog_playback = { | |||
3490 | }, | 3491 | }, |
3491 | }; | 3492 | }; |
3492 | 3493 | ||
3493 | static struct hda_pcm_stream vt1705_pcm_analog_playback = { | 3494 | static const struct hda_pcm_stream vt1705_pcm_analog_playback = { |
3494 | .substreams = 2, | 3495 | .substreams = 2, |
3495 | .channels_min = 2, | 3496 | .channels_min = 2, |
3496 | .channels_max = 6, | 3497 | .channels_max = 6, |
@@ -3503,7 +3504,7 @@ static struct hda_pcm_stream vt1705_pcm_analog_playback = { | |||
3503 | }, | 3504 | }, |
3504 | }; | 3505 | }; |
3505 | 3506 | ||
3506 | static struct hda_pcm_stream vt1708S_pcm_analog_capture = { | 3507 | static const struct hda_pcm_stream vt1708S_pcm_analog_capture = { |
3507 | .substreams = 2, | 3508 | .substreams = 2, |
3508 | .channels_min = 2, | 3509 | .channels_min = 2, |
3509 | .channels_max = 2, | 3510 | .channels_max = 2, |
@@ -3516,7 +3517,7 @@ static struct hda_pcm_stream vt1708S_pcm_analog_capture = { | |||
3516 | }, | 3517 | }, |
3517 | }; | 3518 | }; |
3518 | 3519 | ||
3519 | static struct hda_pcm_stream vt1708S_pcm_digital_playback = { | 3520 | static const struct hda_pcm_stream vt1708S_pcm_digital_playback = { |
3520 | .substreams = 1, | 3521 | .substreams = 1, |
3521 | .channels_min = 2, | 3522 | .channels_min = 2, |
3522 | .channels_max = 2, | 3523 | .channels_max = 2, |
@@ -3718,7 +3719,7 @@ static int vt1708S_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
3718 | static int vt1708S_auto_create_analog_input_ctls(struct hda_codec *codec, | 3719 | static int vt1708S_auto_create_analog_input_ctls(struct hda_codec *codec, |
3719 | const struct auto_pin_cfg *cfg) | 3720 | const struct auto_pin_cfg *cfg) |
3720 | { | 3721 | { |
3721 | static hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; | 3722 | static const hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; |
3722 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, | 3723 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, |
3723 | ARRAY_SIZE(pin_idxs)); | 3724 | ARRAY_SIZE(pin_idxs)); |
3724 | } | 3725 | } |
@@ -3789,7 +3790,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec) | |||
3789 | } | 3790 | } |
3790 | 3791 | ||
3791 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3792 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
3792 | static struct hda_amp_list vt1708S_loopbacks[] = { | 3793 | static const struct hda_amp_list vt1708S_loopbacks[] = { |
3793 | { 0x16, HDA_INPUT, 1 }, | 3794 | { 0x16, HDA_INPUT, 1 }, |
3794 | { 0x16, HDA_INPUT, 2 }, | 3795 | { 0x16, HDA_INPUT, 2 }, |
3795 | { 0x16, HDA_INPUT, 3 }, | 3796 | { 0x16, HDA_INPUT, 3 }, |
@@ -3904,7 +3905,7 @@ static int patch_vt1708S(struct hda_codec *codec) | |||
3904 | /* Patch for VT1702 */ | 3905 | /* Patch for VT1702 */ |
3905 | 3906 | ||
3906 | /* capture mixer elements */ | 3907 | /* capture mixer elements */ |
3907 | static struct snd_kcontrol_new vt1702_capture_mixer[] = { | 3908 | static const struct snd_kcontrol_new vt1702_capture_mixer[] = { |
3908 | HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_INPUT), | 3909 | HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_INPUT), |
3909 | HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_INPUT), | 3910 | HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_INPUT), |
3910 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x20, 0x0, HDA_INPUT), | 3911 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x20, 0x0, HDA_INPUT), |
@@ -3928,7 +3929,7 @@ static struct snd_kcontrol_new vt1702_capture_mixer[] = { | |||
3928 | { } /* end */ | 3929 | { } /* end */ |
3929 | }; | 3930 | }; |
3930 | 3931 | ||
3931 | static struct hda_verb vt1702_volume_init_verbs[] = { | 3932 | static const struct hda_verb vt1702_volume_init_verbs[] = { |
3932 | /* | 3933 | /* |
3933 | * Unmute ADC0-1 and set the default input to mic-in | 3934 | * Unmute ADC0-1 and set the default input to mic-in |
3934 | */ | 3935 | */ |
@@ -3959,7 +3960,7 @@ static struct hda_verb vt1702_volume_init_verbs[] = { | |||
3959 | { } | 3960 | { } |
3960 | }; | 3961 | }; |
3961 | 3962 | ||
3962 | static struct hda_verb vt1702_uniwill_init_verbs[] = { | 3963 | static const struct hda_verb vt1702_uniwill_init_verbs[] = { |
3963 | {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, | 3964 | {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, |
3964 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | 3965 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
3965 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | 3966 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, |
@@ -3969,7 +3970,7 @@ static struct hda_verb vt1702_uniwill_init_verbs[] = { | |||
3969 | { } | 3970 | { } |
3970 | }; | 3971 | }; |
3971 | 3972 | ||
3972 | static struct hda_pcm_stream vt1702_pcm_analog_playback = { | 3973 | static const struct hda_pcm_stream vt1702_pcm_analog_playback = { |
3973 | .substreams = 2, | 3974 | .substreams = 2, |
3974 | .channels_min = 2, | 3975 | .channels_min = 2, |
3975 | .channels_max = 2, | 3976 | .channels_max = 2, |
@@ -3982,7 +3983,7 @@ static struct hda_pcm_stream vt1702_pcm_analog_playback = { | |||
3982 | }, | 3983 | }, |
3983 | }; | 3984 | }; |
3984 | 3985 | ||
3985 | static struct hda_pcm_stream vt1702_pcm_analog_capture = { | 3986 | static const struct hda_pcm_stream vt1702_pcm_analog_capture = { |
3986 | .substreams = 3, | 3987 | .substreams = 3, |
3987 | .channels_min = 2, | 3988 | .channels_min = 2, |
3988 | .channels_max = 2, | 3989 | .channels_max = 2, |
@@ -3995,7 +3996,7 @@ static struct hda_pcm_stream vt1702_pcm_analog_capture = { | |||
3995 | }, | 3996 | }, |
3996 | }; | 3997 | }; |
3997 | 3998 | ||
3998 | static struct hda_pcm_stream vt1702_pcm_digital_playback = { | 3999 | static const struct hda_pcm_stream vt1702_pcm_digital_playback = { |
3999 | .substreams = 2, | 4000 | .substreams = 2, |
4000 | .channels_min = 2, | 4001 | .channels_min = 2, |
4001 | .channels_max = 2, | 4002 | .channels_max = 2, |
@@ -4095,7 +4096,7 @@ static int vt1702_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
4095 | static int vt1702_auto_create_analog_input_ctls(struct hda_codec *codec, | 4096 | static int vt1702_auto_create_analog_input_ctls(struct hda_codec *codec, |
4096 | const struct auto_pin_cfg *cfg) | 4097 | const struct auto_pin_cfg *cfg) |
4097 | { | 4098 | { |
4098 | static hda_nid_t pin_idxs[] = { 0x14, 0x15, 0x18, 0xff }; | 4099 | static const hda_nid_t pin_idxs[] = { 0x14, 0x15, 0x18, 0xff }; |
4099 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x1a, pin_idxs, | 4100 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x1a, pin_idxs, |
4100 | ARRAY_SIZE(pin_idxs)); | 4101 | ARRAY_SIZE(pin_idxs)); |
4101 | } | 4102 | } |
@@ -4146,7 +4147,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec) | |||
4146 | } | 4147 | } |
4147 | 4148 | ||
4148 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4149 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
4149 | static struct hda_amp_list vt1702_loopbacks[] = { | 4150 | static const struct hda_amp_list vt1702_loopbacks[] = { |
4150 | { 0x1A, HDA_INPUT, 1 }, | 4151 | { 0x1A, HDA_INPUT, 1 }, |
4151 | { 0x1A, HDA_INPUT, 2 }, | 4152 | { 0x1A, HDA_INPUT, 2 }, |
4152 | { 0x1A, HDA_INPUT, 3 }, | 4153 | { 0x1A, HDA_INPUT, 3 }, |
@@ -4239,7 +4240,7 @@ static int patch_vt1702(struct hda_codec *codec) | |||
4239 | /* Patch for VT1718S */ | 4240 | /* Patch for VT1718S */ |
4240 | 4241 | ||
4241 | /* capture mixer elements */ | 4242 | /* capture mixer elements */ |
4242 | static struct snd_kcontrol_new vt1718S_capture_mixer[] = { | 4243 | static const struct snd_kcontrol_new vt1718S_capture_mixer[] = { |
4243 | HDA_CODEC_VOLUME("Capture Volume", 0x10, 0x0, HDA_INPUT), | 4244 | HDA_CODEC_VOLUME("Capture Volume", 0x10, 0x0, HDA_INPUT), |
4244 | HDA_CODEC_MUTE("Capture Switch", 0x10, 0x0, HDA_INPUT), | 4245 | HDA_CODEC_MUTE("Capture Switch", 0x10, 0x0, HDA_INPUT), |
4245 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x11, 0x0, HDA_INPUT), | 4246 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x11, 0x0, HDA_INPUT), |
@@ -4261,7 +4262,7 @@ static struct snd_kcontrol_new vt1718S_capture_mixer[] = { | |||
4261 | { } /* end */ | 4262 | { } /* end */ |
4262 | }; | 4263 | }; |
4263 | 4264 | ||
4264 | static struct hda_verb vt1718S_volume_init_verbs[] = { | 4265 | static const struct hda_verb vt1718S_volume_init_verbs[] = { |
4265 | /* | 4266 | /* |
4266 | * Unmute ADC0-1 and set the default input to mic-in | 4267 | * Unmute ADC0-1 and set the default input to mic-in |
4267 | */ | 4268 | */ |
@@ -4309,7 +4310,7 @@ static struct hda_verb vt1718S_volume_init_verbs[] = { | |||
4309 | }; | 4310 | }; |
4310 | 4311 | ||
4311 | 4312 | ||
4312 | static struct hda_verb vt1718S_uniwill_init_verbs[] = { | 4313 | static const struct hda_verb vt1718S_uniwill_init_verbs[] = { |
4313 | {0x28, AC_VERB_SET_UNSOLICITED_ENABLE, | 4314 | {0x28, AC_VERB_SET_UNSOLICITED_ENABLE, |
4314 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | 4315 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
4315 | {0x24, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | 4316 | {0x24, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, |
@@ -4322,7 +4323,7 @@ static struct hda_verb vt1718S_uniwill_init_verbs[] = { | |||
4322 | { } | 4323 | { } |
4323 | }; | 4324 | }; |
4324 | 4325 | ||
4325 | static struct hda_pcm_stream vt1718S_pcm_analog_playback = { | 4326 | static const struct hda_pcm_stream vt1718S_pcm_analog_playback = { |
4326 | .substreams = 2, | 4327 | .substreams = 2, |
4327 | .channels_min = 2, | 4328 | .channels_min = 2, |
4328 | .channels_max = 10, | 4329 | .channels_max = 10, |
@@ -4335,7 +4336,7 @@ static struct hda_pcm_stream vt1718S_pcm_analog_playback = { | |||
4335 | }, | 4336 | }, |
4336 | }; | 4337 | }; |
4337 | 4338 | ||
4338 | static struct hda_pcm_stream vt1718S_pcm_analog_capture = { | 4339 | static const struct hda_pcm_stream vt1718S_pcm_analog_capture = { |
4339 | .substreams = 2, | 4340 | .substreams = 2, |
4340 | .channels_min = 2, | 4341 | .channels_min = 2, |
4341 | .channels_max = 2, | 4342 | .channels_max = 2, |
@@ -4348,7 +4349,7 @@ static struct hda_pcm_stream vt1718S_pcm_analog_capture = { | |||
4348 | }, | 4349 | }, |
4349 | }; | 4350 | }; |
4350 | 4351 | ||
4351 | static struct hda_pcm_stream vt1718S_pcm_digital_playback = { | 4352 | static const struct hda_pcm_stream vt1718S_pcm_digital_playback = { |
4352 | .substreams = 2, | 4353 | .substreams = 2, |
4353 | .channels_min = 2, | 4354 | .channels_min = 2, |
4354 | .channels_max = 2, | 4355 | .channels_max = 2, |
@@ -4361,7 +4362,7 @@ static struct hda_pcm_stream vt1718S_pcm_digital_playback = { | |||
4361 | }, | 4362 | }, |
4362 | }; | 4363 | }; |
4363 | 4364 | ||
4364 | static struct hda_pcm_stream vt1718S_pcm_digital_capture = { | 4365 | static const struct hda_pcm_stream vt1718S_pcm_digital_capture = { |
4365 | .substreams = 1, | 4366 | .substreams = 1, |
4366 | .channels_min = 2, | 4367 | .channels_min = 2, |
4367 | .channels_max = 2, | 4368 | .channels_max = 2, |
@@ -4515,7 +4516,7 @@ static int vt1718S_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
4515 | static int vt1718S_auto_create_analog_input_ctls(struct hda_codec *codec, | 4516 | static int vt1718S_auto_create_analog_input_ctls(struct hda_codec *codec, |
4516 | const struct auto_pin_cfg *cfg) | 4517 | const struct auto_pin_cfg *cfg) |
4517 | { | 4518 | { |
4518 | static hda_nid_t pin_idxs[] = { 0x2c, 0x2b, 0x2a, 0x29, 0, 0xff }; | 4519 | static const hda_nid_t pin_idxs[] = { 0x2c, 0x2b, 0x2a, 0x29, 0, 0xff }; |
4519 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, | 4520 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, |
4520 | ARRAY_SIZE(pin_idxs)); | 4521 | ARRAY_SIZE(pin_idxs)); |
4521 | } | 4522 | } |
@@ -4566,7 +4567,7 @@ static int vt1718S_parse_auto_config(struct hda_codec *codec) | |||
4566 | } | 4567 | } |
4567 | 4568 | ||
4568 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4569 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
4569 | static struct hda_amp_list vt1718S_loopbacks[] = { | 4570 | static const struct hda_amp_list vt1718S_loopbacks[] = { |
4570 | { 0x21, HDA_INPUT, 1 }, | 4571 | { 0x21, HDA_INPUT, 1 }, |
4571 | { 0x21, HDA_INPUT, 2 }, | 4572 | { 0x21, HDA_INPUT, 2 }, |
4572 | { 0x21, HDA_INPUT, 3 }, | 4573 | { 0x21, HDA_INPUT, 3 }, |
@@ -4748,7 +4749,7 @@ static int vt1716s_dmic_put(struct snd_kcontrol *kcontrol, | |||
4748 | } | 4749 | } |
4749 | 4750 | ||
4750 | /* capture mixer elements */ | 4751 | /* capture mixer elements */ |
4751 | static struct snd_kcontrol_new vt1716S_capture_mixer[] = { | 4752 | static const struct snd_kcontrol_new vt1716S_capture_mixer[] = { |
4752 | HDA_CODEC_VOLUME("Capture Volume", 0x13, 0x0, HDA_INPUT), | 4753 | HDA_CODEC_VOLUME("Capture Volume", 0x13, 0x0, HDA_INPUT), |
4753 | HDA_CODEC_MUTE("Capture Switch", 0x13, 0x0, HDA_INPUT), | 4754 | HDA_CODEC_MUTE("Capture Switch", 0x13, 0x0, HDA_INPUT), |
4754 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x14, 0x0, HDA_INPUT), | 4755 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x14, 0x0, HDA_INPUT), |
@@ -4767,7 +4768,7 @@ static struct snd_kcontrol_new vt1716S_capture_mixer[] = { | |||
4767 | { } /* end */ | 4768 | { } /* end */ |
4768 | }; | 4769 | }; |
4769 | 4770 | ||
4770 | static struct snd_kcontrol_new vt1716s_dmic_mixer[] = { | 4771 | static const struct snd_kcontrol_new vt1716s_dmic_mixer[] = { |
4771 | HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x22, 0x0, HDA_INPUT), | 4772 | HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x22, 0x0, HDA_INPUT), |
4772 | { | 4773 | { |
4773 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 4774 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -4783,12 +4784,12 @@ static struct snd_kcontrol_new vt1716s_dmic_mixer[] = { | |||
4783 | 4784 | ||
4784 | 4785 | ||
4785 | /* mono-out mixer elements */ | 4786 | /* mono-out mixer elements */ |
4786 | static struct snd_kcontrol_new vt1716S_mono_out_mixer[] = { | 4787 | static const struct snd_kcontrol_new vt1716S_mono_out_mixer[] = { |
4787 | HDA_CODEC_MUTE("Mono Playback Switch", 0x2a, 0x0, HDA_OUTPUT), | 4788 | HDA_CODEC_MUTE("Mono Playback Switch", 0x2a, 0x0, HDA_OUTPUT), |
4788 | { } /* end */ | 4789 | { } /* end */ |
4789 | }; | 4790 | }; |
4790 | 4791 | ||
4791 | static struct hda_verb vt1716S_volume_init_verbs[] = { | 4792 | static const struct hda_verb vt1716S_volume_init_verbs[] = { |
4792 | /* | 4793 | /* |
4793 | * Unmute ADC0-1 and set the default input to mic-in | 4794 | * Unmute ADC0-1 and set the default input to mic-in |
4794 | */ | 4795 | */ |
@@ -4837,7 +4838,7 @@ static struct hda_verb vt1716S_volume_init_verbs[] = { | |||
4837 | }; | 4838 | }; |
4838 | 4839 | ||
4839 | 4840 | ||
4840 | static struct hda_verb vt1716S_uniwill_init_verbs[] = { | 4841 | static const struct hda_verb vt1716S_uniwill_init_verbs[] = { |
4841 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, | 4842 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, |
4842 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | 4843 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
4843 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | 4844 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, |
@@ -4850,7 +4851,7 @@ static struct hda_verb vt1716S_uniwill_init_verbs[] = { | |||
4850 | { } | 4851 | { } |
4851 | }; | 4852 | }; |
4852 | 4853 | ||
4853 | static struct hda_pcm_stream vt1716S_pcm_analog_playback = { | 4854 | static const struct hda_pcm_stream vt1716S_pcm_analog_playback = { |
4854 | .substreams = 2, | 4855 | .substreams = 2, |
4855 | .channels_min = 2, | 4856 | .channels_min = 2, |
4856 | .channels_max = 6, | 4857 | .channels_max = 6, |
@@ -4863,7 +4864,7 @@ static struct hda_pcm_stream vt1716S_pcm_analog_playback = { | |||
4863 | }, | 4864 | }, |
4864 | }; | 4865 | }; |
4865 | 4866 | ||
4866 | static struct hda_pcm_stream vt1716S_pcm_analog_capture = { | 4867 | static const struct hda_pcm_stream vt1716S_pcm_analog_capture = { |
4867 | .substreams = 2, | 4868 | .substreams = 2, |
4868 | .channels_min = 2, | 4869 | .channels_min = 2, |
4869 | .channels_max = 2, | 4870 | .channels_max = 2, |
@@ -4876,7 +4877,7 @@ static struct hda_pcm_stream vt1716S_pcm_analog_capture = { | |||
4876 | }, | 4877 | }, |
4877 | }; | 4878 | }; |
4878 | 4879 | ||
4879 | static struct hda_pcm_stream vt1716S_pcm_digital_playback = { | 4880 | static const struct hda_pcm_stream vt1716S_pcm_digital_playback = { |
4880 | .substreams = 2, | 4881 | .substreams = 2, |
4881 | .channels_min = 2, | 4882 | .channels_min = 2, |
4882 | .channels_max = 2, | 4883 | .channels_max = 2, |
@@ -5046,7 +5047,7 @@ static int vt1716S_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) | |||
5046 | static int vt1716S_auto_create_analog_input_ctls(struct hda_codec *codec, | 5047 | static int vt1716S_auto_create_analog_input_ctls(struct hda_codec *codec, |
5047 | const struct auto_pin_cfg *cfg) | 5048 | const struct auto_pin_cfg *cfg) |
5048 | { | 5049 | { |
5049 | static hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; | 5050 | static const hda_nid_t pin_idxs[] = { 0x1f, 0x1a, 0x1b, 0x1e, 0, 0xff }; |
5050 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, | 5051 | return vt_auto_create_analog_input_ctls(codec, cfg, 0x16, pin_idxs, |
5051 | ARRAY_SIZE(pin_idxs)); | 5052 | ARRAY_SIZE(pin_idxs)); |
5052 | } | 5053 | } |
@@ -5093,7 +5094,7 @@ static int vt1716S_parse_auto_config(struct hda_codec *codec) | |||
5093 | } | 5094 | } |
5094 | 5095 | ||
5095 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 5096 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
5096 | static struct hda_amp_list vt1716S_loopbacks[] = { | 5097 | static const struct hda_amp_list vt1716S_loopbacks[] = { |
5097 | { 0x16, HDA_INPUT, 1 }, | 5098 | { 0x16, HDA_INPUT, 1 }, |
5098 | { 0x16, HDA_INPUT, 2 }, | 5099 | { 0x16, HDA_INPUT, 2 }, |
5099 | { 0x16, HDA_INPUT, 3 }, | 5100 | { 0x16, HDA_INPUT, 3 }, |
@@ -5256,7 +5257,7 @@ static int patch_vt1716S(struct hda_codec *codec) | |||
5256 | /* for vt2002P */ | 5257 | /* for vt2002P */ |
5257 | 5258 | ||
5258 | /* capture mixer elements */ | 5259 | /* capture mixer elements */ |
5259 | static struct snd_kcontrol_new vt2002P_capture_mixer[] = { | 5260 | static const struct snd_kcontrol_new vt2002P_capture_mixer[] = { |
5260 | HDA_CODEC_VOLUME("Capture Volume", 0x10, 0x0, HDA_INPUT), | 5261 | HDA_CODEC_VOLUME("Capture Volume", 0x10, 0x0, HDA_INPUT), |
5261 | HDA_CODEC_MUTE("Capture Switch", 0x10, 0x0, HDA_INPUT), | 5262 | HDA_CODEC_MUTE("Capture Switch", 0x10, 0x0, HDA_INPUT), |
5262 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x11, 0x0, HDA_INPUT), | 5263 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x11, 0x0, HDA_INPUT), |
@@ -5279,7 +5280,7 @@ static struct snd_kcontrol_new vt2002P_capture_mixer[] = { | |||
5279 | { } /* end */ | 5280 | { } /* end */ |
5280 | }; | 5281 | }; |
5281 | 5282 | ||
5282 | static struct hda_verb vt2002P_volume_init_verbs[] = { | 5283 | static const struct hda_verb vt2002P_volume_init_verbs[] = { |
5283 | /* Class-D speaker related verbs */ | 5284 | /* Class-D speaker related verbs */ |
5284 | {0x1, 0xfe0, 0x4}, | 5285 | {0x1, 0xfe0, 0x4}, |
5285 | {0x1, 0xfe9, 0x80}, | 5286 | {0x1, 0xfe9, 0x80}, |
@@ -5334,7 +5335,7 @@ static struct hda_verb vt2002P_volume_init_verbs[] = { | |||
5334 | {0x1, 0xfb8, 0x88}, | 5335 | {0x1, 0xfb8, 0x88}, |
5335 | { } | 5336 | { } |
5336 | }; | 5337 | }; |
5337 | static struct hda_verb vt1802_volume_init_verbs[] = { | 5338 | static const struct hda_verb vt1802_volume_init_verbs[] = { |
5338 | /* | 5339 | /* |
5339 | * Unmute ADC0-1 and set the default input to mic-in | 5340 | * Unmute ADC0-1 and set the default input to mic-in |
5340 | */ | 5341 | */ |
@@ -5387,7 +5388,7 @@ static struct hda_verb vt1802_volume_init_verbs[] = { | |||
5387 | }; | 5388 | }; |
5388 | 5389 | ||
5389 | 5390 | ||
5390 | static struct hda_verb vt2002P_uniwill_init_verbs[] = { | 5391 | static const struct hda_verb vt2002P_uniwill_init_verbs[] = { |
5391 | {0x25, AC_VERB_SET_UNSOLICITED_ENABLE, | 5392 | {0x25, AC_VERB_SET_UNSOLICITED_ENABLE, |
5392 | AC_USRSP_EN | VIA_JACK_EVENT | VIA_BIND_HP_EVENT}, | 5393 | AC_USRSP_EN | VIA_JACK_EVENT | VIA_BIND_HP_EVENT}, |
5393 | {0x26, AC_VERB_SET_UNSOLICITED_ENABLE, | 5394 | {0x26, AC_VERB_SET_UNSOLICITED_ENABLE, |
@@ -5397,7 +5398,7 @@ static struct hda_verb vt2002P_uniwill_init_verbs[] = { | |||
5397 | {0x2b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | 5398 | {0x2b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, |
5398 | { } | 5399 | { } |
5399 | }; | 5400 | }; |
5400 | static struct hda_verb vt1802_uniwill_init_verbs[] = { | 5401 | static const struct hda_verb vt1802_uniwill_init_verbs[] = { |
5401 | {0x25, AC_VERB_SET_UNSOLICITED_ENABLE, | 5402 | {0x25, AC_VERB_SET_UNSOLICITED_ENABLE, |
5402 | AC_USRSP_EN | VIA_JACK_EVENT | VIA_BIND_HP_EVENT}, | 5403 | AC_USRSP_EN | VIA_JACK_EVENT | VIA_BIND_HP_EVENT}, |
5403 | {0x28, AC_VERB_SET_UNSOLICITED_ENABLE, | 5404 | {0x28, AC_VERB_SET_UNSOLICITED_ENABLE, |
@@ -5408,7 +5409,7 @@ static struct hda_verb vt1802_uniwill_init_verbs[] = { | |||
5408 | { } | 5409 | { } |
5409 | }; | 5410 | }; |
5410 | 5411 | ||
5411 | static struct hda_pcm_stream vt2002P_pcm_analog_playback = { | 5412 | static const struct hda_pcm_stream vt2002P_pcm_analog_playback = { |
5412 | .substreams = 2, | 5413 | .substreams = 2, |
5413 | .channels_min = 2, | 5414 | .channels_min = 2, |
5414 | .channels_max = 2, | 5415 | .channels_max = 2, |
@@ -5421,7 +5422,7 @@ static struct hda_pcm_stream vt2002P_pcm_analog_playback = { | |||
5421 | }, | 5422 | }, |
5422 | }; | 5423 | }; |
5423 | 5424 | ||
5424 | static struct hda_pcm_stream vt2002P_pcm_analog_capture = { | 5425 | static const struct hda_pcm_stream vt2002P_pcm_analog_capture = { |
5425 | .substreams = 2, | 5426 | .substreams = 2, |
5426 | .channels_min = 2, | 5427 | .channels_min = 2, |
5427 | .channels_max = 2, | 5428 | .channels_max = 2, |
@@ -5434,7 +5435,7 @@ static struct hda_pcm_stream vt2002P_pcm_analog_capture = { | |||
5434 | }, | 5435 | }, |
5435 | }; | 5436 | }; |
5436 | 5437 | ||
5437 | static struct hda_pcm_stream vt2002P_pcm_digital_playback = { | 5438 | static const struct hda_pcm_stream vt2002P_pcm_digital_playback = { |
5438 | .substreams = 1, | 5439 | .substreams = 1, |
5439 | .channels_min = 2, | 5440 | .channels_min = 2, |
5440 | .channels_max = 2, | 5441 | .channels_max = 2, |
@@ -5521,7 +5522,7 @@ static int vt2002P_auto_create_analog_input_ctls(struct hda_codec *codec, | |||
5521 | { | 5522 | { |
5522 | struct via_spec *spec = codec->spec; | 5523 | struct via_spec *spec = codec->spec; |
5523 | struct hda_input_mux *imux = &spec->private_imux[0]; | 5524 | struct hda_input_mux *imux = &spec->private_imux[0]; |
5524 | static hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0xff }; | 5525 | static const hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0xff }; |
5525 | int err; | 5526 | int err; |
5526 | 5527 | ||
5527 | err = vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, | 5528 | err = vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, |
@@ -5582,7 +5583,7 @@ static int vt2002P_parse_auto_config(struct hda_codec *codec) | |||
5582 | } | 5583 | } |
5583 | 5584 | ||
5584 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 5585 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
5585 | static struct hda_amp_list vt2002P_loopbacks[] = { | 5586 | static const struct hda_amp_list vt2002P_loopbacks[] = { |
5586 | { 0x21, HDA_INPUT, 0 }, | 5587 | { 0x21, HDA_INPUT, 0 }, |
5587 | { 0x21, HDA_INPUT, 1 }, | 5588 | { 0x21, HDA_INPUT, 1 }, |
5588 | { 0x21, HDA_INPUT, 2 }, | 5589 | { 0x21, HDA_INPUT, 2 }, |
@@ -5775,7 +5776,7 @@ static int patch_vt2002P(struct hda_codec *codec) | |||
5775 | /* for vt1812 */ | 5776 | /* for vt1812 */ |
5776 | 5777 | ||
5777 | /* capture mixer elements */ | 5778 | /* capture mixer elements */ |
5778 | static struct snd_kcontrol_new vt1812_capture_mixer[] = { | 5779 | static const struct snd_kcontrol_new vt1812_capture_mixer[] = { |
5779 | HDA_CODEC_VOLUME("Capture Volume", 0x10, 0x0, HDA_INPUT), | 5780 | HDA_CODEC_VOLUME("Capture Volume", 0x10, 0x0, HDA_INPUT), |
5780 | HDA_CODEC_MUTE("Capture Switch", 0x10, 0x0, HDA_INPUT), | 5781 | HDA_CODEC_MUTE("Capture Switch", 0x10, 0x0, HDA_INPUT), |
5781 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x11, 0x0, HDA_INPUT), | 5782 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x11, 0x0, HDA_INPUT), |
@@ -5797,7 +5798,7 @@ static struct snd_kcontrol_new vt1812_capture_mixer[] = { | |||
5797 | { } /* end */ | 5798 | { } /* end */ |
5798 | }; | 5799 | }; |
5799 | 5800 | ||
5800 | static struct hda_verb vt1812_volume_init_verbs[] = { | 5801 | static const struct hda_verb vt1812_volume_init_verbs[] = { |
5801 | /* | 5802 | /* |
5802 | * Unmute ADC0-1 and set the default input to mic-in | 5803 | * Unmute ADC0-1 and set the default input to mic-in |
5803 | */ | 5804 | */ |
@@ -5850,7 +5851,7 @@ static struct hda_verb vt1812_volume_init_verbs[] = { | |||
5850 | }; | 5851 | }; |
5851 | 5852 | ||
5852 | 5853 | ||
5853 | static struct hda_verb vt1812_uniwill_init_verbs[] = { | 5854 | static const struct hda_verb vt1812_uniwill_init_verbs[] = { |
5854 | {0x33, AC_VERB_SET_UNSOLICITED_ENABLE, | 5855 | {0x33, AC_VERB_SET_UNSOLICITED_ENABLE, |
5855 | AC_USRSP_EN | VIA_JACK_EVENT | VIA_BIND_HP_EVENT}, | 5856 | AC_USRSP_EN | VIA_JACK_EVENT | VIA_BIND_HP_EVENT}, |
5856 | {0x25, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT }, | 5857 | {0x25, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT }, |
@@ -5862,7 +5863,7 @@ static struct hda_verb vt1812_uniwill_init_verbs[] = { | |||
5862 | { } | 5863 | { } |
5863 | }; | 5864 | }; |
5864 | 5865 | ||
5865 | static struct hda_pcm_stream vt1812_pcm_analog_playback = { | 5866 | static const struct hda_pcm_stream vt1812_pcm_analog_playback = { |
5866 | .substreams = 2, | 5867 | .substreams = 2, |
5867 | .channels_min = 2, | 5868 | .channels_min = 2, |
5868 | .channels_max = 2, | 5869 | .channels_max = 2, |
@@ -5875,7 +5876,7 @@ static struct hda_pcm_stream vt1812_pcm_analog_playback = { | |||
5875 | }, | 5876 | }, |
5876 | }; | 5877 | }; |
5877 | 5878 | ||
5878 | static struct hda_pcm_stream vt1812_pcm_analog_capture = { | 5879 | static const struct hda_pcm_stream vt1812_pcm_analog_capture = { |
5879 | .substreams = 2, | 5880 | .substreams = 2, |
5880 | .channels_min = 2, | 5881 | .channels_min = 2, |
5881 | .channels_max = 2, | 5882 | .channels_max = 2, |
@@ -5888,7 +5889,7 @@ static struct hda_pcm_stream vt1812_pcm_analog_capture = { | |||
5888 | }, | 5889 | }, |
5889 | }; | 5890 | }; |
5890 | 5891 | ||
5891 | static struct hda_pcm_stream vt1812_pcm_digital_playback = { | 5892 | static const struct hda_pcm_stream vt1812_pcm_digital_playback = { |
5892 | .substreams = 1, | 5893 | .substreams = 1, |
5893 | .channels_min = 2, | 5894 | .channels_min = 2, |
5894 | .channels_max = 2, | 5895 | .channels_max = 2, |
@@ -5970,7 +5971,7 @@ static int vt1812_auto_create_analog_input_ctls(struct hda_codec *codec, | |||
5970 | { | 5971 | { |
5971 | struct via_spec *spec = codec->spec; | 5972 | struct via_spec *spec = codec->spec; |
5972 | struct hda_input_mux *imux = &spec->private_imux[0]; | 5973 | struct hda_input_mux *imux = &spec->private_imux[0]; |
5973 | static hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0, 0, 0xff }; | 5974 | static const hda_nid_t pin_idxs[] = { 0x2b, 0x2a, 0x29, 0, 0, 0xff }; |
5974 | int err; | 5975 | int err; |
5975 | 5976 | ||
5976 | err = vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, | 5977 | err = vt_auto_create_analog_input_ctls(codec, cfg, 0x21, pin_idxs, |
@@ -6032,7 +6033,7 @@ static int vt1812_parse_auto_config(struct hda_codec *codec) | |||
6032 | } | 6033 | } |
6033 | 6034 | ||
6034 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 6035 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
6035 | static struct hda_amp_list vt1812_loopbacks[] = { | 6036 | static const struct hda_amp_list vt1812_loopbacks[] = { |
6036 | { 0x21, HDA_INPUT, 0 }, | 6037 | { 0x21, HDA_INPUT, 0 }, |
6037 | { 0x21, HDA_INPUT, 1 }, | 6038 | { 0x21, HDA_INPUT, 1 }, |
6038 | { 0x21, HDA_INPUT, 2 }, | 6039 | { 0x21, HDA_INPUT, 2 }, |
@@ -6191,7 +6192,7 @@ static int patch_vt1812(struct hda_codec *codec) | |||
6191 | /* | 6192 | /* |
6192 | * patch entries | 6193 | * patch entries |
6193 | */ | 6194 | */ |
6194 | static struct hda_codec_preset snd_hda_preset_via[] = { | 6195 | static const struct hda_codec_preset snd_hda_preset_via[] = { |
6195 | { .id = 0x11061708, .name = "VT1708", .patch = patch_vt1708}, | 6196 | { .id = 0x11061708, .name = "VT1708", .patch = patch_vt1708}, |
6196 | { .id = 0x11061709, .name = "VT1708", .patch = patch_vt1708}, | 6197 | { .id = 0x11061709, .name = "VT1708", .patch = patch_vt1708}, |
6197 | { .id = 0x1106170a, .name = "VT1708", .patch = patch_vt1708}, | 6198 | { .id = 0x1106170a, .name = "VT1708", .patch = patch_vt1708}, |