aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 15:58:37 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 15:58:37 -0400
commit0a3fd051c7036ef71b58863f8e5da7c3dabd9d3f (patch)
tree43388a81494ded94008afff66777f9f6e8cb5484 /sound/pci/hda/patch_sigmatel.c
parent57a44415beee38d1afcd8e1b5fad66f3414d2dac (diff)
parentc911d1e16dfc1f0338bbc245ff724322c0113395 (diff)
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: (122 commits) [ALSA] version 1.0.14rc4 [ALSA] Add speaker pin sequencing to hda_codec.c:snd_hda_parse_pin_def_config() [ALSA] hda-codec - Add ALC861VD Lenovo support [ALSA] hda-codec - Fix connection list in generic parser [ALSA] usb-audio: work around wrong wMaxPacketSize on ESI M4U [ALSA] usb-audio: work around broken M-Audio MidiSport Uno firmware [ALSA] usb-audio: explicitly match Logitech QuickCam [ALSA] hda-codec - Fix a typo [ALSA] hda-codec - Fix ALC880 uniwill auto-mutes [ALSA] hda-codec - Fix AD1988 SPDIF playback route control [ALSA] wm8750 typo fix [ALSA] wavefront: only declare isapnp on CONFIG_PNP [ALSA] hda-codec - bug fixes for stac92xx HDA codecs. [ALSA] add MODULE_FIRMWARE entries [ALSA] do not depend on FW_LOADER when internal firmware images are used [ALSA] hda-codec - Fix resume of STAC92xx codecs [ALSA] usbaudio - Revert the minimal period size fix patch [ALSA] hda-codec - Add support for new HP DV series laptops [ALSA] usb-audio - Fix the minimum period size per transfer mode [ALSA] sound/pcmcia/vx/vxpocket.c: fix an if() condition ...
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c178
1 files changed, 127 insertions, 51 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index c94291bc5367..93ae9c250767 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -62,6 +62,7 @@ enum {
62 STAC_MACBOOK, 62 STAC_MACBOOK,
63 STAC_MACBOOK_PRO_V1, 63 STAC_MACBOOK_PRO_V1,
64 STAC_MACBOOK_PRO_V2, 64 STAC_MACBOOK_PRO_V2,
65 STAC_IMAC_INTEL,
65 STAC_922X_MODELS 66 STAC_922X_MODELS
66}; 67};
67 68
@@ -175,8 +176,8 @@ static hda_nid_t stac9205_mux_nids[2] = {
175 0x19, 0x1a 176 0x19, 0x1a
176}; 177};
177 178
178static hda_nid_t stac9205_dmic_nids[3] = { 179static hda_nid_t stac9205_dmic_nids[2] = {
179 0x17, 0x18, 0 180 0x17, 0x18,
180}; 181};
181 182
182static hda_nid_t stac9200_pin_nids[8] = { 183static hda_nid_t stac9200_pin_nids[8] = {
@@ -524,12 +525,6 @@ static unsigned int d945gtp5_pin_configs[10] = {
524 0x02a19320, 0x40000100, 525 0x02a19320, 0x40000100,
525}; 526};
526 527
527static unsigned int macbook_pin_configs[10] = {
528 0x0321e230, 0x03a1e020, 0x400000fd, 0x9017e110,
529 0x400000fe, 0x0381e021, 0x1345e240, 0x13c5e22e,
530 0x400000fc, 0x400000fb,
531};
532
533static unsigned int macbook_pro_v1_pin_configs[10] = { 528static unsigned int macbook_pro_v1_pin_configs[10] = {
534 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, 529 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010,
535 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, 530 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e,
@@ -542,14 +537,21 @@ static unsigned int macbook_pro_v2_pin_configs[10] = {
542 0x400000fc, 0x400000fb, 537 0x400000fc, 0x400000fb,
543}; 538};
544 539
540static unsigned int imac_intel_pin_configs[10] = {
541 0x0121e230, 0x90a70120, 0x9017e110, 0x400000fe,
542 0x400000fd, 0x0181e021, 0x1145e040, 0x400000fa,
543 0x400000fc, 0x400000fb,
544};
545
545static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { 546static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
546 [STAC_D945_REF] = ref922x_pin_configs, 547 [STAC_D945_REF] = ref922x_pin_configs,
547 [STAC_D945GTP3] = d945gtp3_pin_configs, 548 [STAC_D945GTP3] = d945gtp3_pin_configs,
548 [STAC_D945GTP5] = d945gtp5_pin_configs, 549 [STAC_D945GTP5] = d945gtp5_pin_configs,
549 [STAC_MACMINI] = d945gtp5_pin_configs, 550 [STAC_MACMINI] = macbook_pro_v1_pin_configs,
550 [STAC_MACBOOK] = macbook_pin_configs, 551 [STAC_MACBOOK] = macbook_pro_v1_pin_configs,
551 [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, 552 [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs,
552 [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, 553 [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,
554 [STAC_IMAC_INTEL] = imac_intel_pin_configs,
553}; 555};
554 556
555static const char *stac922x_models[STAC_922X_MODELS] = { 557static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -560,6 +562,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
560 [STAC_MACBOOK] = "macbook", 562 [STAC_MACBOOK] = "macbook",
561 [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1", 563 [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1",
562 [STAC_MACBOOK_PRO_V2] = "macbook-pro", 564 [STAC_MACBOOK_PRO_V2] = "macbook-pro",
565 [STAC_IMAC_INTEL] = "imac-intel",
563}; 566};
564 567
565static struct snd_pci_quirk stac922x_cfg_tbl[] = { 568static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -820,6 +823,17 @@ static int stac92xx_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
820 return snd_hda_multi_out_dig_close(codec, &spec->multiout); 823 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
821} 824}
822 825
826static int stac92xx_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
827 struct hda_codec *codec,
828 unsigned int stream_tag,
829 unsigned int format,
830 struct snd_pcm_substream *substream)
831{
832 struct sigmatel_spec *spec = codec->spec;
833 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout,
834 stream_tag, format, substream);
835}
836
823 837
824/* 838/*
825 * Analog capture callbacks 839 * Analog capture callbacks
@@ -854,7 +868,8 @@ static struct hda_pcm_stream stac92xx_pcm_digital_playback = {
854 /* NID is set in stac92xx_build_pcms */ 868 /* NID is set in stac92xx_build_pcms */
855 .ops = { 869 .ops = {
856 .open = stac92xx_dig_playback_pcm_open, 870 .open = stac92xx_dig_playback_pcm_open,
857 .close = stac92xx_dig_playback_pcm_close 871 .close = stac92xx_dig_playback_pcm_close,
872 .prepare = stac92xx_dig_playback_pcm_prepare
858 }, 873 },
859}; 874};
860 875
@@ -1055,11 +1070,23 @@ static int stac92xx_add_control(struct sigmatel_spec *spec, int type, const char
1055static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cfg *cfg) 1070static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cfg *cfg)
1056{ 1071{
1057 struct sigmatel_spec *spec = codec->spec; 1072 struct sigmatel_spec *spec = codec->spec;
1073 unsigned int wcaps, wtype;
1074 int i, num_dacs = 0;
1075
1076 /* use the wcaps cache to count all DACs available for line-outs */
1077 for (i = 0; i < codec->num_nodes; i++) {
1078 wcaps = codec->wcaps[i];
1079 wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
1080 if (wtype == AC_WID_AUD_OUT && !(wcaps & AC_WCAP_DIGITAL))
1081 num_dacs++;
1082 }
1058 1083
1084 snd_printdd("%s: total dac count=%d\n", __func__, num_dacs);
1085
1059 switch (cfg->line_outs) { 1086 switch (cfg->line_outs) {
1060 case 3: 1087 case 3:
1061 /* add line-in as side */ 1088 /* add line-in as side */
1062 if (cfg->input_pins[AUTO_PIN_LINE]) { 1089 if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 3) {
1063 cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_LINE]; 1090 cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_LINE];
1064 spec->line_switch = 1; 1091 spec->line_switch = 1;
1065 cfg->line_outs++; 1092 cfg->line_outs++;
@@ -1067,12 +1094,12 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
1067 break; 1094 break;
1068 case 2: 1095 case 2:
1069 /* add line-in as clfe and mic as side */ 1096 /* add line-in as clfe and mic as side */
1070 if (cfg->input_pins[AUTO_PIN_LINE]) { 1097 if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 2) {
1071 cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_LINE]; 1098 cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_LINE];
1072 spec->line_switch = 1; 1099 spec->line_switch = 1;
1073 cfg->line_outs++; 1100 cfg->line_outs++;
1074 } 1101 }
1075 if (cfg->input_pins[AUTO_PIN_MIC]) { 1102 if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 3) {
1076 cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_MIC]; 1103 cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_MIC];
1077 spec->mic_switch = 1; 1104 spec->mic_switch = 1;
1078 cfg->line_outs++; 1105 cfg->line_outs++;
@@ -1080,12 +1107,12 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
1080 break; 1107 break;
1081 case 1: 1108 case 1:
1082 /* add line-in as surr and mic as clfe */ 1109 /* add line-in as surr and mic as clfe */
1083 if (cfg->input_pins[AUTO_PIN_LINE]) { 1110 if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 1) {
1084 cfg->line_out_pins[1] = cfg->input_pins[AUTO_PIN_LINE]; 1111 cfg->line_out_pins[1] = cfg->input_pins[AUTO_PIN_LINE];
1085 spec->line_switch = 1; 1112 spec->line_switch = 1;
1086 cfg->line_outs++; 1113 cfg->line_outs++;
1087 } 1114 }
1088 if (cfg->input_pins[AUTO_PIN_MIC]) { 1115 if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 2) {
1089 cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_MIC]; 1116 cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_MIC];
1090 spec->mic_switch = 1; 1117 spec->mic_switch = 1;
1091 cfg->line_outs++; 1118 cfg->line_outs++;
@@ -1096,33 +1123,76 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
1096 return 0; 1123 return 0;
1097} 1124}
1098 1125
1126
1127static int is_in_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid)
1128{
1129 int i;
1130
1131 for (i = 0; i < spec->multiout.num_dacs; i++) {
1132 if (spec->multiout.dac_nids[i] == nid)
1133 return 1;
1134 }
1135
1136 return 0;
1137}
1138
1099/* 1139/*
1100 * XXX The line_out pin widget connection list may not be set to the 1140 * Fill in the dac_nids table from the parsed pin configuration
1101 * desired DAC nid. This is the case on 927x where ports A and B can 1141 * This function only works when every pin in line_out_pins[]
1102 * be routed to several DACs. 1142 * contains atleast one DAC in its connection list. Some 92xx
1103 * 1143 * codecs are not connected directly to a DAC, such as the 9200
1104 * This requires an analysis of the line-out/hp pin configuration 1144 * and 9202/925x. For those, dac_nids[] must be hard-coded.
1105 * to provide a best fit for pin/DAC configurations that are routable.
1106 * For now, 927x DAC4 is not supported and 927x DAC1 output to ports
1107 * A and B is not supported.
1108 */ 1145 */
1109/* fill in the dac_nids table from the parsed pin configuration */
1110static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec, 1146static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec,
1111 const struct auto_pin_cfg *cfg) 1147 const struct auto_pin_cfg *cfg)
1112{ 1148{
1113 struct sigmatel_spec *spec = codec->spec; 1149 struct sigmatel_spec *spec = codec->spec;
1114 hda_nid_t nid; 1150 int i, j, conn_len = 0;
1115 int i; 1151 hda_nid_t nid, conn[HDA_MAX_CONNECTIONS];
1116 1152 unsigned int wcaps, wtype;
1117 /* check the pins hardwired to audio widget */ 1153
1118 for (i = 0; i < cfg->line_outs; i++) { 1154 for (i = 0; i < cfg->line_outs; i++) {
1119 nid = cfg->line_out_pins[i]; 1155 nid = cfg->line_out_pins[i];
1120 spec->multiout.dac_nids[i] = snd_hda_codec_read(codec, nid, 0, 1156 conn_len = snd_hda_get_connections(codec, nid, conn,
1121 AC_VERB_GET_CONNECT_LIST, 0) & 0xff; 1157 HDA_MAX_CONNECTIONS);
1122 } 1158 for (j = 0; j < conn_len; j++) {
1159 wcaps = snd_hda_param_read(codec, conn[j],
1160 AC_PAR_AUDIO_WIDGET_CAP);
1161 wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
1162
1163 if (wtype != AC_WID_AUD_OUT ||
1164 (wcaps & AC_WCAP_DIGITAL))
1165 continue;
1166 /* conn[j] is a DAC routed to this line-out */
1167 if (!is_in_dac_nids(spec, conn[j]))
1168 break;
1169 }
1170
1171 if (j == conn_len) {
1172 /* error out, no available DAC found */
1173 snd_printk(KERN_ERR
1174 "%s: No available DAC for pin 0x%x\n",
1175 __func__, nid);
1176 return -ENODEV;
1177 }
1123 1178
1124 spec->multiout.num_dacs = cfg->line_outs; 1179 spec->multiout.dac_nids[i] = conn[j];
1180 spec->multiout.num_dacs++;
1181 if (conn_len > 1) {
1182 /* select this DAC in the pin's input mux */
1183 snd_hda_codec_write(codec, nid, 0,
1184 AC_VERB_SET_CONNECT_SEL, j);
1185
1186 }
1187 }
1125 1188
1189 snd_printd("dac_nids=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
1190 spec->multiout.num_dacs,
1191 spec->multiout.dac_nids[0],
1192 spec->multiout.dac_nids[1],
1193 spec->multiout.dac_nids[2],
1194 spec->multiout.dac_nids[3],
1195 spec->multiout.dac_nids[4]);
1126 return 0; 1196 return 0;
1127} 1197}
1128 1198
@@ -1189,12 +1259,8 @@ static int stac92xx_auto_create_multi_out_ctls(struct sigmatel_spec *spec,
1189 1259
1190static int check_in_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid) 1260static int check_in_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid)
1191{ 1261{
1192 int i; 1262 if (is_in_dac_nids(spec, nid))
1193 1263 return 1;
1194 for (i = 0; i < spec->multiout.num_dacs; i++) {
1195 if (spec->multiout.dac_nids[i] == nid)
1196 return 1;
1197 }
1198 if (spec->multiout.hp_nid == nid) 1264 if (spec->multiout.hp_nid == nid)
1199 return 1; 1265 return 1;
1200 return 0; 1266 return 0;
@@ -1236,12 +1302,10 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
1236 add_spec_dacs(spec, nid); 1302 add_spec_dacs(spec, nid);
1237 } 1303 }
1238 for (i = 0; i < cfg->speaker_outs; i++) { 1304 for (i = 0; i < cfg->speaker_outs; i++) {
1239 nid = snd_hda_codec_read(codec, cfg->speaker_pins[0], 0, 1305 nid = snd_hda_codec_read(codec, cfg->speaker_pins[i], 0,
1240 AC_VERB_GET_CONNECT_LIST, 0) & 0xff; 1306 AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
1241 if (check_in_dac_nids(spec, nid)) 1307 if (check_in_dac_nids(spec, nid))
1242 nid = 0; 1308 nid = 0;
1243 if (check_in_dac_nids(spec, nid))
1244 nid = 0;
1245 if (! nid) 1309 if (! nid)
1246 continue; 1310 continue;
1247 add_spec_dacs(spec, nid); 1311 add_spec_dacs(spec, nid);
@@ -1355,7 +1419,7 @@ static int stac92xx_auto_create_analog_input_ctls(struct hda_codec *codec, const
1355 imux->num_items++; 1419 imux->num_items++;
1356 } 1420 }
1357 1421
1358 if (imux->num_items == 1) { 1422 if (imux->num_items) {
1359 /* 1423 /*
1360 * Set the current input for the muxes. 1424 * Set the current input for the muxes.
1361 * The STAC9221 has two input muxes with identical source 1425 * The STAC9221 has two input muxes with identical source
@@ -1675,8 +1739,12 @@ static void stac92xx_set_pinctl(struct hda_codec *codec, hda_nid_t nid,
1675{ 1739{
1676 unsigned int pin_ctl = snd_hda_codec_read(codec, nid, 1740 unsigned int pin_ctl = snd_hda_codec_read(codec, nid,
1677 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00); 1741 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00);
1678 if (flag == AC_PINCTL_OUT_EN && (pin_ctl & AC_PINCTL_IN_EN)) 1742
1679 return; 1743 /* if setting pin direction bits, clear the current
1744 direction bits first */
1745 if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))
1746 pin_ctl &= ~(AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN);
1747
1680 snd_hda_codec_write(codec, nid, 0, 1748 snd_hda_codec_write(codec, nid, 0,
1681 AC_VERB_SET_PIN_WIDGET_CONTROL, 1749 AC_VERB_SET_PIN_WIDGET_CONTROL,
1682 pin_ctl | flag); 1750 pin_ctl | flag);
@@ -1751,6 +1819,7 @@ static int stac92xx_resume(struct hda_codec *codec)
1751 1819
1752 stac92xx_init(codec); 1820 stac92xx_init(codec);
1753 stac92xx_set_config_regs(codec); 1821 stac92xx_set_config_regs(codec);
1822 snd_hda_resume_ctls(codec, spec->mixer);
1754 for (i = 0; i < spec->num_mixers; i++) 1823 for (i = 0; i < spec->num_mixers; i++)
1755 snd_hda_resume_ctls(codec, spec->mixers[i]); 1824 snd_hda_resume_ctls(codec, spec->mixers[i]);
1756 if (spec->multiout.dig_out_nid) 1825 if (spec->multiout.dig_out_nid)
@@ -1905,12 +1974,18 @@ static int patch_stac922x(struct hda_codec *codec)
1905 */ 1974 */
1906 printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id); 1975 printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id);
1907 switch (codec->subsystem_id) { 1976 switch (codec->subsystem_id) {
1977 case 0x106b0a00: /* MacBook First generatoin */
1978 spec->board_config = STAC_MACBOOK;
1979 break;
1908 case 0x106b0200: /* MacBook Pro first generation */ 1980 case 0x106b0200: /* MacBook Pro first generation */
1909 spec->board_config = STAC_MACBOOK_PRO_V1; 1981 spec->board_config = STAC_MACBOOK_PRO_V1;
1910 break; 1982 break;
1911 case 0x106b1e00: /* MacBook Pro second generation */ 1983 case 0x106b1e00: /* MacBook Pro second generation */
1912 spec->board_config = STAC_MACBOOK_PRO_V2; 1984 spec->board_config = STAC_MACBOOK_PRO_V2;
1913 break; 1985 break;
1986 case 0x106b0700: /* Intel-based iMac */
1987 spec->board_config = STAC_IMAC_INTEL;
1988 break;
1914 } 1989 }
1915 } 1990 }
1916 1991
@@ -1931,7 +2006,7 @@ static int patch_stac922x(struct hda_codec *codec)
1931 2006
1932 spec->adc_nids = stac922x_adc_nids; 2007 spec->adc_nids = stac922x_adc_nids;
1933 spec->mux_nids = stac922x_mux_nids; 2008 spec->mux_nids = stac922x_mux_nids;
1934 spec->num_muxes = 2; 2009 spec->num_muxes = ARRAY_SIZE(stac922x_mux_nids);
1935 spec->num_dmics = 0; 2010 spec->num_dmics = 0;
1936 2011
1937 spec->init = stac922x_core_init; 2012 spec->init = stac922x_core_init;
@@ -1992,7 +2067,7 @@ static int patch_stac927x(struct hda_codec *codec)
1992 case STAC_D965_3ST: 2067 case STAC_D965_3ST:
1993 spec->adc_nids = stac927x_adc_nids; 2068 spec->adc_nids = stac927x_adc_nids;
1994 spec->mux_nids = stac927x_mux_nids; 2069 spec->mux_nids = stac927x_mux_nids;
1995 spec->num_muxes = 3; 2070 spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids);
1996 spec->num_dmics = 0; 2071 spec->num_dmics = 0;
1997 spec->init = d965_core_init; 2072 spec->init = d965_core_init;
1998 spec->mixer = stac9227_mixer; 2073 spec->mixer = stac9227_mixer;
@@ -2000,7 +2075,7 @@ static int patch_stac927x(struct hda_codec *codec)
2000 case STAC_D965_5ST: 2075 case STAC_D965_5ST:
2001 spec->adc_nids = stac927x_adc_nids; 2076 spec->adc_nids = stac927x_adc_nids;
2002 spec->mux_nids = stac927x_mux_nids; 2077 spec->mux_nids = stac927x_mux_nids;
2003 spec->num_muxes = 3; 2078 spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids);
2004 spec->num_dmics = 0; 2079 spec->num_dmics = 0;
2005 spec->init = d965_core_init; 2080 spec->init = d965_core_init;
2006 spec->mixer = stac9227_mixer; 2081 spec->mixer = stac9227_mixer;
@@ -2008,7 +2083,7 @@ static int patch_stac927x(struct hda_codec *codec)
2008 default: 2083 default:
2009 spec->adc_nids = stac927x_adc_nids; 2084 spec->adc_nids = stac927x_adc_nids;
2010 spec->mux_nids = stac927x_mux_nids; 2085 spec->mux_nids = stac927x_mux_nids;
2011 spec->num_muxes = 3; 2086 spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids);
2012 spec->num_dmics = 0; 2087 spec->num_dmics = 0;
2013 spec->init = stac927x_core_init; 2088 spec->init = stac927x_core_init;
2014 spec->mixer = stac927x_mixer; 2089 spec->mixer = stac927x_mixer;
@@ -2067,9 +2142,9 @@ static int patch_stac9205(struct hda_codec *codec)
2067 2142
2068 spec->adc_nids = stac9205_adc_nids; 2143 spec->adc_nids = stac9205_adc_nids;
2069 spec->mux_nids = stac9205_mux_nids; 2144 spec->mux_nids = stac9205_mux_nids;
2070 spec->num_muxes = 2; 2145 spec->num_muxes = ARRAY_SIZE(stac9205_mux_nids);
2071 spec->dmic_nids = stac9205_dmic_nids; 2146 spec->dmic_nids = stac9205_dmic_nids;
2072 spec->num_dmics = 2; 2147 spec->num_dmics = ARRAY_SIZE(stac9205_dmic_nids);
2073 spec->dmux_nid = 0x1d; 2148 spec->dmux_nid = 0x1d;
2074 2149
2075 spec->init = stac9205_core_init; 2150 spec->init = stac9205_core_init;
@@ -2294,6 +2369,7 @@ static struct snd_pci_quirk stac9872_cfg_tbl[] = {
2294 SND_PCI_QUIRK(0x104d, 0x81e6, "Sony VAIO F/S", CXD9872RD_VAIO), 2369 SND_PCI_QUIRK(0x104d, 0x81e6, "Sony VAIO F/S", CXD9872RD_VAIO),
2295 SND_PCI_QUIRK(0x104d, 0x81ef, "Sony VAIO F/S", CXD9872RD_VAIO), 2370 SND_PCI_QUIRK(0x104d, 0x81ef, "Sony VAIO F/S", CXD9872RD_VAIO),
2296 SND_PCI_QUIRK(0x104d, 0x81fd, "Sony VAIO AR", CXD9872AKD_VAIO), 2371 SND_PCI_QUIRK(0x104d, 0x81fd, "Sony VAIO AR", CXD9872AKD_VAIO),
2372 SND_PCI_QUIRK(0x104d, 0x8205, "Sony VAIO AR", CXD9872AKD_VAIO),
2297 {} 2373 {}
2298}; 2374};
2299 2375