ALSA: hda - Add ALC670 codec support

- Fixed alc_subsystem_id( ) typo and add new function.
- !(ass & 0x100000)) ==> Delete this check. It is unnecessary check.
- Add porti
- ALC670 support

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by Kailang Yang and committed by Takashi Iwai 6227cdce dd2b4a7a

+24 -16
+24 -16
sound/pci/hda/patch_realtek.c
··· 1254 1254 */ 1255 1255 static int alc_subsystem_id(struct hda_codec *codec, 1256 1256 hda_nid_t porta, hda_nid_t porte, 1257 - hda_nid_t portd) 1257 + hda_nid_t portd, hda_nid_t porti) 1258 1258 { 1259 1259 unsigned int ass, tmp, i; 1260 1260 unsigned nid; ··· 1280 1280 snd_printd("realtek: No valid SSID, " 1281 1281 "checking pincfg 0x%08x for NID 0x%x\n", 1282 1282 ass, nid); 1283 - if (!(ass & 1) && !(ass & 0x100000)) 1283 + if (!(ass & 1)) 1284 1284 return 0; 1285 1285 if ((ass >> 30) != 1) /* no physical connection */ 1286 1286 return 0; ··· 1340 1340 nid = porte; 1341 1341 else if (tmp == 2) 1342 1342 nid = portd; 1343 + else if (tmp == 3) 1344 + nid = porti; 1343 1345 else 1344 1346 return 1; 1345 1347 for (i = 0; i < spec->autocfg.line_outs; i++) ··· 1356 1354 } 1357 1355 1358 1356 static void alc_ssid_check(struct hda_codec *codec, 1359 - hda_nid_t porta, hda_nid_t porte, hda_nid_t portd) 1357 + hda_nid_t porta, hda_nid_t porte, 1358 + hda_nid_t portd, hda_nid_t porti) 1360 1359 { 1361 - if (!alc_subsystem_id(codec, porta, porte, portd)) { 1360 + if (!alc_subsystem_id(codec, porta, porte, portd, porti)) { 1362 1361 struct alc_spec *spec = codec->spec; 1363 1362 snd_printd("realtek: " 1364 1363 "Enable default setup for auto mode as fallback\n"); ··· 4862 4859 spec->num_mux_defs = 1; 4863 4860 spec->input_mux = &spec->private_imux[0]; 4864 4861 4865 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 4862 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 4866 4863 4867 4864 return 1; 4868 4865 } ··· 6396 6393 spec->num_mux_defs = 1; 6397 6394 spec->input_mux = &spec->private_imux[0]; 6398 6395 6399 - alc_ssid_check(codec, 0x10, 0x15, 0x0f); 6396 + alc_ssid_check(codec, 0x10, 0x15, 0x0f, 0); 6400 6397 6401 6398 return 1; 6402 6399 } ··· 10227 10224 spec->num_mux_defs = 1; 10228 10225 spec->input_mux = &spec->private_imux[0]; 10229 10226 10230 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 10227 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 10231 10228 10232 10229 err = alc_auto_add_mic_boost(codec); 10233 10230 if (err < 0) ··· 11785 11782 if (err < 0) 11786 11783 return err; 11787 11784 11788 - alc_ssid_check(codec, 0x15, 0x14, 0x1b); 11785 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 11789 11786 11790 11787 return 1; 11791 11788 } ··· 12736 12733 dac = 0x02; 12737 12734 break; 12738 12735 case 0x15: 12739 - case 0x21: 12740 12736 dac = 0x03; 12741 12737 break; 12742 12738 default: ··· 12956 12954 if (err < 0) 12957 12955 return err; 12958 12956 12959 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 12957 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 12960 12958 12961 12959 return 1; 12962 12960 } ··· 13847 13845 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010) { 13848 13846 add_verb(spec, alc269vb_init_verbs); 13849 13847 real_capsrc_nids = alc269vb_capsrc_nids[0]; 13850 - alc_ssid_check(codec, 0x21, 0x1b, 0x14); 13848 + alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21); 13851 13849 } else { 13852 13850 add_verb(spec, alc269_init_verbs); 13853 13851 real_capsrc_nids = alc269_capsrc_nids[0]; 13854 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 13852 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 13855 13853 } 13856 13854 13857 13855 spec->num_mux_defs = 1; ··· 15015 15013 spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids); 15016 15014 set_capture_mixer(codec); 15017 15015 15018 - alc_ssid_check(codec, 0x0e, 0x0f, 0x0b); 15016 + alc_ssid_check(codec, 0x0e, 0x0f, 0x0b, 0); 15019 15017 15020 15018 return 1; 15021 15019 } ··· 15906 15904 static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, 15907 15905 const struct auto_pin_cfg *cfg) 15908 15906 { 15909 - return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x22, 0); 15907 + return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); 15910 15908 } 15911 15909 15912 15910 ··· 16142 16140 if (err < 0) 16143 16141 return err; 16144 16142 16145 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 16143 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 16146 16144 16147 16145 return 1; 16148 16146 } ··· 17629 17627 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), 17630 17628 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", 17631 17629 ALC662_3ST_6ch_DIG), 17630 + SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13), 17632 17631 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG), 17633 17632 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA), 17634 17633 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E), ··· 18260 18257 if (err < 0) 18261 18258 return err; 18262 18259 18263 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 18260 + if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 || 18261 + codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670) 18262 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0x21); 18263 + else 18264 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 18264 18265 18265 18266 return 1; 18266 18267 } ··· 18414 18407 .patch = patch_alc662 }, 18415 18408 { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, 18416 18409 { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, 18410 + { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, 18417 18411 { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, 18418 18412 { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, 18419 18413 { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 },