Skip to contentSkip to conversation

ASUS G75 fixes

PATCH Superseded [email protected] 1 participant 5 messages Nov 7, 2012 Sound

lore
Share & tools
lore
#0 lore raw

cover ASUS G75 fixes

Hi Massimo,

this is a patch series for fixing ASUS G75.
Could you check whether these work for you? Once when confirmed, I'll queue these to the upstream.

thanks,

Takashi

#1 lore raw

PATCH 1/3 ALSA: hda - Fix empty DAC filling in patch_via.c

From: Takashi Iwai <[email protected]>

In via_auto_fill_adc_nids(), the parser tries to fill dac_nids[] at the point of the current line-out (i). When no valid path is found for this output, this results in dac = 0, thus it creates a hole in dac_nids[]. This confuses is_empty_dac() and trims the detected DAC in later reference.

This patch fixes the bug by appending DAC properly to dac_nids[] in via_auto_fill_adc_nids().

---
 sound/pci/hda/patch_via.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_via.c +1 -1
index 72a2f60..1c1367b 100644
@@ -1825,7 +1825,7 @@ static int via_auto_fill_dac_nids(struct hda_codec *codec)
 					    &spec->out_mix_path))
 			dac = spec->out_mix_path.path[0];
 		if (dac) {
-			spec->private_dac_nids[i] = dac;
+			spec->private_dac_nids[dac_num] = dac;
 			dac_num++;
 		}
 	}
Signature · 1 line
1.8.0
#2 lore raw

PATCH v2 1/3 ALSA: hda - Fix empty DAC filling in patch_via.c

In via_auto_fill_adc_nids(), the parser tries to fill dac_nids[] at the point of the current line-out (i). When no valid path is found for this output, this results in dac = 0, thus it creates a hole in dac_nids[]. This confuses is_empty_dac() and trims the detected DAC in later reference.

This patch fixes the bug by appending DAC properly to dac_nids[] in via_auto_fill_adc_nids().

---
v1->v2: adjust multiout.num_dacs appropriately to take effect in

        is_empty_dac(); code clean ups
 sound/pci/hda/patch_via.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
sound/pci/hda/patch_via.c +4 -7
index 72a2f60..bf57fa6 100644
@@ -1809,11 +1809,11 @@ static int via_auto_fill_dac_nids(struct hda_codec *codec)
 {
 	struct via_spec *spec = codec->spec;
 	const struct auto_pin_cfg *cfg = &spec->autocfg;
-	int i, dac_num;
+	int i;
 	hda_nid_t nid;
 
+	spec->multiout.num_dacs = 0;
 	spec->multiout.dac_nids = spec->private_dac_nids;
-	dac_num = 0;
 	for (i = 0; i < cfg->line_outs; i++) {
 		hda_nid_t dac = 0;
 		nid = cfg->line_out_pins[i];
@@ -1824,16 +1824,13 @@ static int via_auto_fill_dac_nids(struct hda_codec *codec)
 		if (!i && parse_output_path(codec, nid, dac, 1,
 					    &spec->out_mix_path))
 			dac = spec->out_mix_path.path[0];
-		if (dac) {
-			spec->private_dac_nids[i] = dac;
-			dac_num++;
-		}
+		if (dac)
+			spec->private_dac_nids[spec->multiout.num_dacs++] = dac;
 	}
 	if (!spec->out_path[0].depth && spec->out_mix_path.depth) {
 		spec->out_path[0] = spec->out_mix_path;
 		spec->out_mix_path.depth = 0;
 	}
-	spec->multiout.num_dacs = dac_num;
 	return 0;
 }
 
Signature · 1 line
1.8.0
#3 lore raw

PATCH 2/3 ALSA: hda - Fix invalid connections in VT1802 codec

In reply to [email protected]

From: Takashi Iwai <[email protected]>

VT1802 codec provides the invalid connection lists of NID 0x24 and 0x33 containing the routes to a non-exist widget 0x3e. This confuses the auto-parser. Fix it up in the driver by overriding these connections.

---
 sound/pci/hda/patch_via.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
sound/pci/hda/patch_via.c +14 -0
index 1c1367b..34b7f2a 100644
@@ -3649,6 +3649,18 @@ static const struct snd_pci_quirk vt2002p_fixups[] = {
 	{}
 };
 
+/* NIDs 0x24 and 0x33 on VT1802 have connections to non-existing NID 0x3e
+ * Replace this with mixer NID 0x1c
+ */
+static void fix_vt1802_connections(struct hda_codec *codec)
+{
+	static hda_nid_t conn_24[] = { 0x14, 0x1c };
+	static hda_nid_t conn_33[] = { 0x1c };
+
+	snd_hda_override_conn_list(codec, 0x24, ARRAY_SIZE(conn_24), conn_24);
+	snd_hda_override_conn_list(codec, 0x33, ARRAY_SIZE(conn_33), conn_33);
+}
+
 /* patch for vt2002P */
 static int patch_vt2002P(struct hda_codec *codec)
 {
@@ -3663,6 +3675,8 @@ static int patch_vt2002P(struct hda_codec *codec)
 	spec->aa_mix_nid = 0x21;
 	override_mic_boost(codec, 0x2b, 0, 3, 40);
 	override_mic_boost(codec, 0x29, 0, 3, 40);
+	if (spec->codec_type == VT1802)
+		fix_vt1802_connections(codec);
 	add_secret_dac_path(codec);
 
 	snd_hda_pick_fixup(codec, NULL, vt2002p_fixups, via_fixups);
Signature · 1 line
1.8.0
#4 lore raw

PATCH 3/3 ALSA: hda - Add pin fixups for ASUS G75

In reply to [email protected]

From: Takashi Iwai <[email protected]>

To parse properly the subwoofer outputs on ASUS G75 laptop with VT1802 codec, correct the default configurations of speaker pins 0x24 and 0x33.

---
 sound/pci/hda/patch_via.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
sound/pci/hda/patch_via.c +11 -0
index 34b7f2a..0fad5b0 100644
@@ -3628,6 +3628,7 @@ static void set_widgets_power_state_vt2002P(struct hda_codec *codec)
  */
 enum {
 	VIA_FIXUP_INTMIC_BOOST,
+	VIA_FIXUP_ASUS_G75,
 };
 
 static void via_fixup_intmic_boost(struct hda_codec *codec,
@@ -3642,9 +3643,19 @@ static const struct hda_fixup via_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = via_fixup_intmic_boost,
 	},
+	[VIA_FIXUP_ASUS_G75] = {
+		.type = HDA_FIXUP_PINS,
+		.v.pins = (const struct hda_pintbl[]) {
+			/* set 0x24 and 0x33 as speakers */
+			{ 0x24, 0x991301f0 },
+			{ 0x33, 0x991301f1 }, /* subwoofer */
+			{ }
+		}
+	},
 };
 
 static const struct snd_pci_quirk vt2002p_fixups[] = {
+	SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75),
 	SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST),
 	{}
 };
Signature · 1 line
1.8.0