aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>2009-02-04 11:23:19 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-05 01:54:32 -0500
commit616f89e74cd954e04ae4f8bad6a3dc8730a4a47a (patch)
treec07dbf7a2b9267faa82e3ff69c9c1bbe6c166bc9 /sound/pci/hda/patch_sigmatel.c
parent306f47bd639b352b29193a3b69ef1d3546003efb (diff)
ALSA: hda - Additional pin nids for STAC92HD71Bx and STAC92HD75Bx codecs
Current code for STAC92HD71Bx and STAC92HD75Bx doesn't consider pin complexes 0x20 and 0x27. Also for 4 port models, nids 0x0e and 0x0f are vendor reserved. This commit changes code so it'll consider the additional pin complexes for models that have it, and avoid reserved nids to be touched on 4 port models. Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c59
1 files changed, 43 insertions, 16 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index a7df81efed23..58c9ff9d27f5 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -481,10 +481,17 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
481 0x0f, 0x10, 0x11, 0x12, 0x13, 481 0x0f, 0x10, 0x11, 0x12, 0x13,
482 0x1d, 0x1e, 0x1f, 0x20 482 0x1d, 0x1e, 0x1f, 0x20
483}; 483};
484static hda_nid_t stac92hd71bxx_pin_nids[11] = { 484
485#define STAC92HD71BXX_NUM_PINS 13
486static hda_nid_t stac92hd71bxx_pin_nids_4port[STAC92HD71BXX_NUM_PINS] = {
487 0x0a, 0x0b, 0x0c, 0x0d, 0x00,
488 0x00, 0x14, 0x18, 0x19, 0x1e,
489 0x1f, 0x20, 0x27
490};
491static hda_nid_t stac92hd71bxx_pin_nids_6port[STAC92HD71BXX_NUM_PINS] = {
485 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 492 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
486 0x0f, 0x14, 0x18, 0x19, 0x1e, 493 0x0f, 0x14, 0x18, 0x19, 0x1e,
487 0x1f, 494 0x1f, 0x20, 0x27
488}; 495};
489 496
490static hda_nid_t stac927x_pin_nids[14] = { 497static hda_nid_t stac927x_pin_nids[14] = {
@@ -1745,28 +1752,32 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
1745 {} /* terminator */ 1752 {} /* terminator */
1746}; 1753};
1747 1754
1748static unsigned int ref92hd71bxx_pin_configs[11] = { 1755static unsigned int ref92hd71bxx_pin_configs[STAC92HD71BXX_NUM_PINS] = {
1749 0x02214030, 0x02a19040, 0x01a19020, 0x01014010, 1756 0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
1750 0x0181302e, 0x01014010, 0x01019020, 0x90a000f0, 1757 0x0181302e, 0x01014010, 0x01019020, 0x90a000f0,
1751 0x90a000f0, 0x01452050, 0x01452050, 1758 0x90a000f0, 0x01452050, 0x01452050, 0x00000000,
1759 0x00000000
1752}; 1760};
1753 1761
1754static unsigned int dell_m4_1_pin_configs[11] = { 1762static unsigned int dell_m4_1_pin_configs[STAC92HD71BXX_NUM_PINS] = {
1755 0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110, 1763 0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
1756 0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0, 1764 0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
1757 0x40f000f0, 0x4f0000f0, 0x4f0000f0, 1765 0x40f000f0, 0x4f0000f0, 0x4f0000f0, 0x00000000,
1766 0x00000000
1758}; 1767};
1759 1768
1760static unsigned int dell_m4_2_pin_configs[11] = { 1769static unsigned int dell_m4_2_pin_configs[STAC92HD71BXX_NUM_PINS] = {
1761 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110, 1770 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
1762 0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0, 1771 0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
1763 0x40f000f0, 0x044413b0, 0x044413b0, 1772 0x40f000f0, 0x044413b0, 0x044413b0, 0x00000000,
1773 0x00000000
1764}; 1774};
1765 1775
1766static unsigned int dell_m4_3_pin_configs[11] = { 1776static unsigned int dell_m4_3_pin_configs[STAC92HD71BXX_NUM_PINS] = {
1767 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110, 1777 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
1768 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x90a000f0, 1778 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x90a000f0,
1769 0x40f000f0, 0x044413b0, 0x044413b0, 1779 0x40f000f0, 0x044413b0, 0x044413b0, 0x00000000,
1780 0x00000000
1770}; 1781};
1771 1782
1772static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { 1783static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -2311,7 +2322,9 @@ static int stac92xx_save_bios_config_regs(struct hda_codec *codec)
2311 for (i = 0; i < spec->num_pins; i++) { 2322 for (i = 0; i < spec->num_pins; i++) {
2312 hda_nid_t nid = spec->pin_nids[i]; 2323 hda_nid_t nid = spec->pin_nids[i];
2313 unsigned int pin_cfg; 2324 unsigned int pin_cfg;
2314 2325
2326 if (!nid)
2327 continue;
2315 pin_cfg = snd_hda_codec_read(codec, nid, 0, 2328 pin_cfg = snd_hda_codec_read(codec, nid, 0,
2316 AC_VERB_GET_CONFIG_DEFAULT, 0x00); 2329 AC_VERB_GET_CONFIG_DEFAULT, 0x00);
2317 snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x bios pin config %8.8x\n", 2330 snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x bios pin config %8.8x\n",
@@ -2354,8 +2367,9 @@ static void stac92xx_set_config_regs(struct hda_codec *codec)
2354 return; 2367 return;
2355 2368
2356 for (i = 0; i < spec->num_pins; i++) 2369 for (i = 0; i < spec->num_pins; i++)
2357 stac92xx_set_config_reg(codec, spec->pin_nids[i], 2370 if (spec->pin_nids[i] && spec->pin_configs[i])
2358 spec->pin_configs[i]); 2371 stac92xx_set_config_reg(codec, spec->pin_nids[i],
2372 spec->pin_configs[i]);
2359} 2373}
2360 2374
2361static int stac_save_pin_cfgs(struct hda_codec *codec, unsigned int *pins) 2375static int stac_save_pin_cfgs(struct hda_codec *codec, unsigned int *pins)
@@ -4952,9 +4966,21 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
4952 4966
4953 codec->spec = spec; 4967 codec->spec = spec;
4954 codec->patch_ops = stac92xx_patch_ops; 4968 codec->patch_ops = stac92xx_patch_ops;
4955 spec->num_pins = ARRAY_SIZE(stac92hd71bxx_pin_nids); 4969 spec->num_pins = STAC92HD71BXX_NUM_PINS;
4970 switch (codec->vendor_id) {
4971 case 0x111d76b6:
4972 case 0x111d76b7:
4973 spec->pin_nids = stac92hd71bxx_pin_nids_4port;
4974 break;
4975 case 0x111d7603:
4976 case 0x111d7608:
4977 /* On 92HD75Bx 0x27 isn't a pin nid */
4978 spec->num_pins--;
4979 /* fallthrough */
4980 default:
4981 spec->pin_nids = stac92hd71bxx_pin_nids_6port;
4982 }
4956 spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids); 4983 spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids);
4957 spec->pin_nids = stac92hd71bxx_pin_nids;
4958 memcpy(&spec->private_dimux, &stac92hd71bxx_dmux, 4984 memcpy(&spec->private_dimux, &stac92hd71bxx_dmux,
4959 sizeof(stac92hd71bxx_dmux)); 4985 sizeof(stac92hd71bxx_dmux));
4960 spec->board_config = snd_hda_check_board_config(codec, 4986 spec->board_config = snd_hda_check_board_config(codec,
@@ -5018,7 +5044,8 @@ again:
5018 /* disable VSW */ 5044 /* disable VSW */
5019 spec->init = &stac92hd71bxx_analog_core_init[HD_DISABLE_PORTF]; 5045 spec->init = &stac92hd71bxx_analog_core_init[HD_DISABLE_PORTF];
5020 unmute_init++; 5046 unmute_init++;
5021 stac_change_pin_config(codec, 0xf, 0x40f000f0); 5047 stac_change_pin_config(codec, 0x0f, 0x40f000f0);
5048 stac_change_pin_config(codec, 0x19, 0x40f000f3);
5022 break; 5049 break;
5023 case 0x111d7603: /* 6 Port with Analog Mixer */ 5050 case 0x111d7603: /* 6 Port with Analog Mixer */
5024 if ((codec->revision_id & 0xf) == 1) 5051 if ((codec->revision_id & 0xf) == 1)