Skip to contentSkip to conversation

hda: incorrect DAC mixer on 92hd71bxxx

PATCH In review Matthew Ranostay 2 participants 4 messages Feb 28, 2008 – Feb 29, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hda: incorrect DAC mixer on 92hd71bxxx

If there was two line_outs[] it would overrun into the dmic nid struct below and create a phantom "Surround" mixer.

---

pci/hda/patch_sigmatel.c +6 -6
diff -r 54a51b975975 pci/hda/patch_sigmatel.c
@@ -246,8 +246,8 @@ static hda_nid_t stac92hd71bxx_dmux_nids
 	0x1c,
 };
 
-static hda_nid_t stac92hd71bxx_dac_nids[1] = {
-	0x10, /*0x11, */
+static hda_nid_t stac92hd71bxx_dac_nids[2] = {
+	0x10, 0x11
 };
 
 #define STAC92HD71BXX_NUM_DMICS	2
@@ -2345,10 +2345,10 @@ static int stac92xx_auto_create_multi_ou
 
 
 	for (i = 0; i < cfg->line_outs; i++) {
-		if (!spec->multiout.dac_nids[i])
+		
+		nid = spec->multiout.dac_nids[i];
+		if (!nid || nid == spec->multiout.hp_nid)
 			continue;
-
-		nid = spec->multiout.dac_nids[i];
 
 		if (i == 2) {
 			/* Center/LFE */
@@ -3550,7 +3550,7 @@ again:
 	spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids);
 	spec->pwr_nids = stac92hd71bxx_pwr_nids;
 
-	spec->multiout.num_dacs = 1;
+	spec->multiout.num_dacs = ARRAY_SIZE(stac92hd71bxx_dac_nids);
 	spec->multiout.hp_nid = 0x11;
 	spec->multiout.dac_nids = stac92hd71bxx_dac_nids;
#1 lore raw

At Thu, 28 Feb 2008 17:03:36 -0500,

Quoted 3 lines · Matthew Ranostay

If there was two line_outs[] it would overrun into the dmic nid struct below and create a phantom "Surround" mixer.

My bad. But isn't the fix below simpler?

thanks,

Takashi

---

pci/hda/patch_sigmatel.c +1 -1
diff -r 54a51b975975 pci/hda/patch_sigmatel.c
@@ -2344,7 +2344,7 @@ static int stac92xx_auto_create_multi_ou
 	unsigned int wid_caps, pincap;
 
 
-	for (i = 0; i < cfg->line_outs; i++) {
+	for (i = 0; i < cfg->line_outs && i < spec->multiout.num_dacs; i++) {
 		if (!spec->multiout.dac_nids[i])
 			continue;
#2 lore raw
Quoted 9 lines · Takashi Iwai

At Thu, 28 Feb 2008 17:03:36 -0500,

Quoted 4 lines · Matthew Ranostay

If there was two line_outs[] it would overrun into the dmic nid struct below
and create a phantom "Surround" mixer.

My bad. But isn't the fix below simpler?

Yes it is :)

Quoted 20 lines

thanks,

Takashi

---
diff -r 54a51b975975 pci/hda/patch_sigmatel.c

pci/hda/patch_sigmatel.c +2 -1
@@ -2344,7 +2344,7 @@ static int stac92xx_auto_create_multi_ou
 	unsigned int wid_caps, pincap;
 
 
-	for (i = 0; i < cfg->line_outs; i++) {
+	for (i = 0; i < cfg->line_outs && i < spec->multiout.num_dacs; i+ 
+) {
 		if (!spec->multiout.dac_nids[i])
 			continue;
#3 lore raw

At Fri, 29 Feb 2008 07:55:00 -0500,

Quoted 7 lines · Matthew Ranostay
Quoted 3 lines · Takashi Iwai

At Thu, 28 Feb 2008 17:03:36 -0500,

Quoted 1 line · Matthew Ranostay
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

If there was two line_outs[] it would overrun into the dmic nid struct below
and create a phantom "Surround" mixer.

My bad. But isn't the fix below simpler?

Yes it is :)

OK, now fixed on HG. Thanks.

Takashi