aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorMatthew Ranostay <mranostay@embeddedalley.com>2009-02-12 16:50:01 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-13 02:35:08 -0500
commit8bb0ac5573ff0879fef511e1a80a4a4db0316daa (patch)
tree2f2734519b42feb2c020cb0b49917dbed62b3cff /sound/pci/hda/patch_sigmatel.c
parentae374d667a54fb5e2c9c0c4e87b206bd665f3ad6 (diff)
ALSA: hda: Add STAC_DELL_S14 quirk
Add STAC_DELL_S14 quirk for new laptop series. Removed un-needed pins in pin_nids for stac92hd83xxx. Also reorganized connection selection code for the respective ports per quirk define. Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com> 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.c52
1 files changed, 35 insertions, 17 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 3c84817ccd2e..1ebb36ca2e00 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -83,6 +83,7 @@ enum {
83enum { 83enum {
84 STAC_92HD83XXX_REF, 84 STAC_92HD83XXX_REF,
85 STAC_92HD83XXX_PWR_REF, 85 STAC_92HD83XXX_PWR_REF,
86 STAC_DELL_S14,
86 STAC_92HD83XXX_MODELS 87 STAC_92HD83XXX_MODELS
87}; 88};
88 89
@@ -480,10 +481,9 @@ static hda_nid_t stac92hd73xx_pin_nids[13] = {
480 0x14, 0x22, 0x23 481 0x14, 0x22, 0x23
481}; 482};
482 483
483static hda_nid_t stac92hd83xxx_pin_nids[14] = { 484static hda_nid_t stac92hd83xxx_pin_nids[10] = {
484 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 485 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
485 0x0f, 0x10, 0x11, 0x12, 0x13, 486 0x0f, 0x10, 0x11, 0x1f, 0x20,
486 0x1d, 0x1e, 0x1f, 0x20
487}; 487};
488 488
489#define STAC92HD71BXX_NUM_PINS 13 489#define STAC92HD71BXX_NUM_PINS 13
@@ -857,9 +857,9 @@ static struct hda_verb stac92hd73xx_10ch_core_init[] = {
857}; 857};
858 858
859static struct hda_verb stac92hd83xxx_core_init[] = { 859static struct hda_verb stac92hd83xxx_core_init[] = {
860 { 0xa, AC_VERB_SET_CONNECT_SEL, 0x0}, 860 { 0xa, AC_VERB_SET_CONNECT_SEL, 0x1},
861 { 0xb, AC_VERB_SET_CONNECT_SEL, 0x0}, 861 { 0xb, AC_VERB_SET_CONNECT_SEL, 0x1},
862 { 0xd, AC_VERB_SET_CONNECT_SEL, 0x1}, 862 { 0xd, AC_VERB_SET_CONNECT_SEL, 0x0},
863 863
864 /* power state controls amps */ 864 /* power state controls amps */
865 { 0x01, AC_VERB_SET_EAPD, 1 << 2}, 865 { 0x01, AC_VERB_SET_EAPD, 1 << 2},
@@ -1730,21 +1730,28 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1730 {} /* terminator */ 1730 {} /* terminator */
1731}; 1731};
1732 1732
1733static unsigned int ref92hd83xxx_pin_configs[14] = { 1733static unsigned int ref92hd83xxx_pin_configs[10] = {
1734 0x02214030, 0x02211010, 0x02a19020, 0x02170130, 1734 0x02214030, 0x02211010, 0x02a19020, 0x02170130,
1735 0x01014050, 0x01819040, 0x01014020, 0x90a3014e, 1735 0x01014050, 0x01819040, 0x01014020, 0x90a3014e,
1736 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x40f000f0,
1737 0x01451160, 0x98560170, 1736 0x01451160, 0x98560170,
1738}; 1737};
1739 1738
1739static unsigned int dell_s14_pin_configs[10] = {
1740 0x02214030, 0x02211010, 0x02a19020, 0x01014050,
1741 0x40f000f0, 0x01819040, 0x40f000f0, 0x90a60160,
1742 0x40f000f0, 0x40f000f0,
1743};
1744
1740static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = { 1745static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = {
1741 [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs, 1746 [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs,
1742 [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs, 1747 [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs,
1748 [STAC_DELL_S14] = dell_s14_pin_configs,
1743}; 1749};
1744 1750
1745static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { 1751static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
1746 [STAC_92HD83XXX_REF] = "ref", 1752 [STAC_92HD83XXX_REF] = "ref",
1747 [STAC_92HD83XXX_PWR_REF] = "mic-ref", 1753 [STAC_92HD83XXX_PWR_REF] = "mic-ref",
1754 [STAC_DELL_S14] = "dell-s14",
1748}; 1755};
1749 1756
1750static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { 1757static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
@@ -1753,6 +1760,8 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
1753 "DFI LanParty", STAC_92HD83XXX_REF), 1760 "DFI LanParty", STAC_92HD83XXX_REF),
1754 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, 1761 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
1755 "DFI LanParty", STAC_92HD83XXX_REF), 1762 "DFI LanParty", STAC_92HD83XXX_REF),
1763 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba,
1764 "unknown Dell", STAC_DELL_S14),
1756 {} /* terminator */ 1765 {} /* terminator */
1757}; 1766};
1758 1767
@@ -4822,6 +4831,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
4822 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1]; 4831 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1];
4823 int err; 4832 int err;
4824 int num_dacs; 4833 int num_dacs;
4834 hda_nid_t nid;
4825 4835
4826 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 4836 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
4827 if (spec == NULL) 4837 if (spec == NULL)
@@ -4840,15 +4850,6 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
4840 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); 4850 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
4841 spec->multiout.dac_nids = spec->dac_nids; 4851 spec->multiout.dac_nids = spec->dac_nids;
4842 4852
4843
4844 /* set port 0xe to select the last DAC
4845 */
4846 num_dacs = snd_hda_get_connections(codec, 0x0e,
4847 conn, STAC92HD83_DAC_COUNT + 1) - 1;
4848
4849 snd_hda_codec_write_cache(codec, 0xe, 0,
4850 AC_VERB_SET_CONNECT_SEL, num_dacs);
4851
4852 spec->init = stac92hd83xxx_core_init; 4853 spec->init = stac92hd83xxx_core_init;
4853 spec->mixer = stac92hd83xxx_mixer; 4854 spec->mixer = stac92hd83xxx_mixer;
4854 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); 4855 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids);
@@ -4900,6 +4901,23 @@ again:
4900 return err; 4901 return err;
4901 } 4902 }
4902 4903
4904 switch (spec->board_config) {
4905 case STAC_DELL_S14:
4906 nid = 0xf;
4907 break;
4908 default:
4909 nid = 0xe;
4910 break;
4911 }
4912
4913 num_dacs = snd_hda_get_connections(codec, nid,
4914 conn, STAC92HD83_DAC_COUNT + 1) - 1;
4915
4916 /* set port X to select the last DAC
4917 */
4918 snd_hda_codec_write_cache(codec, nid, 0,
4919 AC_VERB_SET_CONNECT_SEL, num_dacs);
4920
4903 codec->patch_ops = stac92xx_patch_ops; 4921 codec->patch_ops = stac92xx_patch_ops;
4904 4922
4905 codec->proc_widget_hook = stac92hd_proc_hook; 4923 codec->proc_widget_hook = stac92hd_proc_hook;