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