--- ../../../../patch_via.c 2012-09-24 14:33:19.000000000 +0200 +++ patch_via.c 2012-11-06 18:07:02.069073574 +0100 @@ -1868,31 +1868,28 @@ static int via_auto_fill_dac_nids(struct { 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.dac_nids = spec->private_dac_nids; - dac_num = 0; + spec->multiout.num_dacs = 0; for (i = 0; i < cfg->line_outs; i++) { hda_nid_t dac = 0; nid = cfg->line_out_pins[i]; if (!nid) continue; - if (parse_output_path(codec, nid, 0, 0, &spec->out_path[i])) - dac = spec->out_path[i].path[0]; + if (parse_output_path(codec, nid, 0, 0, &spec->out_path[spec->multiout.num_dacs])) + dac = spec->out_path[spec->multiout.num_dacs].path[0]; 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; } @@ -3326,7 +3323,6 @@ static int add_secret_dac_path(struct hd return 0; } - static int patch_vt1718S(struct hda_codec *codec) { struct via_spec *spec; @@ -3692,6 +3688,40 @@ static const struct snd_pci_quirk vt2002 {} }; +/* Fixes for Asus G75 subwoofer + pin 24 is marked as speaker by bios -- should mark as line + pin 33 has a wrong connection to out-of-range nid #3e +*/ + static int fix_asus_g75_subwoofer(struct hda_codec *codec) + { + /* right connection to pin widget #33 */ + hda_nid_t conn[8] = {0x1c}; + unsigned int conf; + + /* Fix connection of pin widget #33 on VT1802p + * reported connection (33-1e) refers to non-existent widget #1e which in turn + * reports a connection to #1c; we skip nonexistent 1e widget landing directly + * on 1c one + */ + snd_hda_override_conn_list(codec, 0x33, 1, conn); + + // pin 24 should be marked as line out pin (not speaker as in bios) + // and as AC_JACK_PORT_COMPLEX connection to avoid to be taken by autoparser as a speaker + conf = snd_hda_codec_get_pincfg(codec, 0x24); + conf = conf & ~AC_DEFCFG_DEVICE; + conf = (conf & ~AC_DEFCFG_PORT_CONN) | (AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT); + snd_hda_codec_set_pincfg(codec, 0x24, conf); + + // pin 33 should be marked as line out pin (not speaker as in bios) + // and as AC_JACK_PORT_COMPLEX, not AC_JACK_PORT_NONE as in bios + conf = snd_hda_codec_get_pincfg(codec, 0x33); + conf = conf & ~AC_DEFCFG_DEVICE; + conf = (conf & ~AC_DEFCFG_PORT_CONN) | (AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT); + snd_hda_codec_set_pincfg(codec, 0x33, conf); + + return 0; +} + /* patch for vt2002P */ static int patch_vt2002P(struct hda_codec *codec) { @@ -3703,6 +3733,10 @@ static int patch_vt2002P(struct hda_code if (spec == NULL) return -ENOMEM; + /* should check for asus g75 model instead...*/ + if (spec->codec_type == VT1802) + fix_asus_g75_subwoofer(codec); + spec->aa_mix_nid = 0x21; override_mic_boost(codec, 0x2b, 0, 3, 40); override_mic_boost(codec, 0x29, 0, 3, 40);