aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c51
1 files changed, 48 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index add4e87e0b20..909f1c101c95 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -952,7 +952,7 @@ do_sku:
952 tmp | 0x2010); 952 tmp | 0x2010);
953 break; 953 break;
954 case 0x10ec0888: 954 case 0x10ec0888:
955 alc888_coef_init(codec); 955 /*alc888_coef_init(codec);*/ /* called in alc_init() */
956 break; 956 break;
957 case 0x10ec0267: 957 case 0x10ec0267:
958 case 0x10ec0268: 958 case 0x10ec0268:
@@ -2439,6 +2439,8 @@ static int alc_init(struct hda_codec *codec)
2439 unsigned int i; 2439 unsigned int i;
2440 2440
2441 alc_fix_pll(codec); 2441 alc_fix_pll(codec);
2442 if (codec->vendor_id == 0x10ec0888)
2443 alc888_coef_init(codec);
2442 2444
2443 for (i = 0; i < spec->num_init_verbs; i++) 2445 for (i = 0; i < spec->num_init_verbs; i++)
2444 snd_hda_sequence_write(codec, spec->init_verbs[i]); 2446 snd_hda_sequence_write(codec, spec->init_verbs[i]);
@@ -6437,6 +6439,39 @@ static void alc882_auto_init_analog_input(struct hda_codec *codec)
6437 } 6439 }
6438} 6440}
6439 6441
6442static void alc882_auto_init_input_src(struct hda_codec *codec)
6443{
6444 struct alc_spec *spec = codec->spec;
6445 const struct hda_input_mux *imux = spec->input_mux;
6446 int c;
6447
6448 for (c = 0; c < spec->num_adc_nids; c++) {
6449 hda_nid_t conn_list[HDA_MAX_NUM_INPUTS];
6450 hda_nid_t nid = spec->capsrc_nids[c];
6451 int conns, mute, idx, item;
6452
6453 conns = snd_hda_get_connections(codec, nid, conn_list,
6454 ARRAY_SIZE(conn_list));
6455 if (conns < 0)
6456 continue;
6457 for (idx = 0; idx < conns; idx++) {
6458 /* if the current connection is the selected one,
6459 * unmute it as default - otherwise mute it
6460 */
6461 mute = AMP_IN_MUTE(idx);
6462 for (item = 0; item < imux->num_items; item++) {
6463 if (imux->items[item].index == idx) {
6464 if (spec->cur_mux[c] == item)
6465 mute = AMP_IN_UNMUTE(idx);
6466 break;
6467 }
6468 }
6469 snd_hda_codec_write(codec, nid, 0,
6470 AC_VERB_SET_AMP_GAIN_MUTE, mute);
6471 }
6472 }
6473}
6474
6440/* add mic boosts if needed */ 6475/* add mic boosts if needed */
6441static int alc_auto_add_mic_boost(struct hda_codec *codec) 6476static int alc_auto_add_mic_boost(struct hda_codec *codec)
6442{ 6477{
@@ -6491,6 +6526,7 @@ static void alc882_auto_init(struct hda_codec *codec)
6491 alc882_auto_init_multi_out(codec); 6526 alc882_auto_init_multi_out(codec);
6492 alc882_auto_init_hp_out(codec); 6527 alc882_auto_init_hp_out(codec);
6493 alc882_auto_init_analog_input(codec); 6528 alc882_auto_init_analog_input(codec);
6529 alc882_auto_init_input_src(codec);
6494 if (spec->unsol_event) 6530 if (spec->unsol_event)
6495 alc_sku_automute(codec); 6531 alc_sku_automute(codec);
6496} 6532}
@@ -8285,6 +8321,8 @@ static void alc883_auto_init_analog_input(struct hda_codec *codec)
8285 } 8321 }
8286} 8322}
8287 8323
8324#define alc883_auto_init_input_src alc882_auto_init_input_src
8325
8288/* almost identical with ALC880 parser... */ 8326/* almost identical with ALC880 parser... */
8289static int alc883_parse_auto_config(struct hda_codec *codec) 8327static int alc883_parse_auto_config(struct hda_codec *codec)
8290{ 8328{
@@ -8315,6 +8353,7 @@ static void alc883_auto_init(struct hda_codec *codec)
8315 alc883_auto_init_multi_out(codec); 8353 alc883_auto_init_multi_out(codec);
8316 alc883_auto_init_hp_out(codec); 8354 alc883_auto_init_hp_out(codec);
8317 alc883_auto_init_analog_input(codec); 8355 alc883_auto_init_analog_input(codec);
8356 alc883_auto_init_input_src(codec);
8318 if (spec->unsol_event) 8357 if (spec->unsol_event)
8319 alc_sku_automute(codec); 8358 alc_sku_automute(codec);
8320} 8359}
@@ -8389,8 +8428,6 @@ static int patch_alc883(struct hda_codec *codec)
8389 codec->patch_ops = alc_patch_ops; 8428 codec->patch_ops = alc_patch_ops;
8390 if (board_config == ALC883_AUTO) 8429 if (board_config == ALC883_AUTO)
8391 spec->init_hook = alc883_auto_init; 8430 spec->init_hook = alc883_auto_init;
8392 else if (codec->vendor_id == 0x10ec0888)
8393 spec->init_hook = alc888_coef_init;
8394 8431
8395#ifdef CONFIG_SND_HDA_POWER_SAVE 8432#ifdef CONFIG_SND_HDA_POWER_SAVE
8396 if (!spec->loopback.amplist) 8433 if (!spec->loopback.amplist)
@@ -9663,6 +9700,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
9663#define alc262_auto_init_multi_out alc882_auto_init_multi_out 9700#define alc262_auto_init_multi_out alc882_auto_init_multi_out
9664#define alc262_auto_init_hp_out alc882_auto_init_hp_out 9701#define alc262_auto_init_hp_out alc882_auto_init_hp_out
9665#define alc262_auto_init_analog_input alc882_auto_init_analog_input 9702#define alc262_auto_init_analog_input alc882_auto_init_analog_input
9703#define alc262_auto_init_input_src alc882_auto_init_input_src
9666 9704
9667 9705
9668/* init callback for auto-configuration model -- overriding the default init */ 9706/* init callback for auto-configuration model -- overriding the default init */
@@ -9672,6 +9710,7 @@ static void alc262_auto_init(struct hda_codec *codec)
9672 alc262_auto_init_multi_out(codec); 9710 alc262_auto_init_multi_out(codec);
9673 alc262_auto_init_hp_out(codec); 9711 alc262_auto_init_hp_out(codec);
9674 alc262_auto_init_analog_input(codec); 9712 alc262_auto_init_analog_input(codec);
9713 alc262_auto_init_input_src(codec);
9675 if (spec->unsol_event) 9714 if (spec->unsol_event)
9676 alc_sku_automute(codec); 9715 alc_sku_automute(codec);
9677} 9716}
@@ -13330,6 +13369,8 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec)
13330 } 13369 }
13331} 13370}
13332 13371
13372#define alc861vd_auto_init_input_src alc882_auto_init_input_src
13373
13333#define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02) 13374#define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02)
13334#define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c) 13375#define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c)
13335 13376
@@ -13512,6 +13553,7 @@ static void alc861vd_auto_init(struct hda_codec *codec)
13512 alc861vd_auto_init_multi_out(codec); 13553 alc861vd_auto_init_multi_out(codec);
13513 alc861vd_auto_init_hp_out(codec); 13554 alc861vd_auto_init_hp_out(codec);
13514 alc861vd_auto_init_analog_input(codec); 13555 alc861vd_auto_init_analog_input(codec);
13556 alc861vd_auto_init_input_src(codec);
13515 if (spec->unsol_event) 13557 if (spec->unsol_event)
13516 alc_sku_automute(codec); 13558 alc_sku_automute(codec);
13517} 13559}
@@ -14677,6 +14719,8 @@ static void alc662_auto_init_analog_input(struct hda_codec *codec)
14677 } 14719 }
14678} 14720}
14679 14721
14722#define alc662_auto_init_input_src alc882_auto_init_input_src
14723
14680static int alc662_parse_auto_config(struct hda_codec *codec) 14724static int alc662_parse_auto_config(struct hda_codec *codec)
14681{ 14725{
14682 struct alc_spec *spec = codec->spec; 14726 struct alc_spec *spec = codec->spec;
@@ -14733,6 +14777,7 @@ static void alc662_auto_init(struct hda_codec *codec)
14733 alc662_auto_init_multi_out(codec); 14777 alc662_auto_init_multi_out(codec);
14734 alc662_auto_init_hp_out(codec); 14778 alc662_auto_init_hp_out(codec);
14735 alc662_auto_init_analog_input(codec); 14779 alc662_auto_init_analog_input(codec);
14780 alc662_auto_init_input_src(codec);
14736 if (spec->unsol_event) 14781 if (spec->unsol_event)
14737 alc_sku_automute(codec); 14782 alc_sku_automute(codec);
14738} 14783}