From d4b7ddca58fc2cc32ad5ba4d1f409c11e159dfc9 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Wed, 5 Oct 2011 09:49:05 +0200 Subject: [PATCH] --- yaml --- r: 270381 b: refs/heads/master c: 48718eab5a719cb537466124d9585b3066e27fae h: refs/heads/master i: 270379: 5316c288898f3e3f484b2cd9b798f2494b7acf7c v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/patch_sigmatel.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 898a86cc6bd5..9f53a3139632 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ce662bb205abdb2545252bce5a0ba11070c29305 +refs/heads/master: 48718eab5a719cb537466124d9585b3066e27fae diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index dd977b647e78..1e0b3387e700 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -2972,8 +2972,9 @@ static int check_all_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid) static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t nid) { struct sigmatel_spec *spec = codec->spec; + struct auto_pin_cfg *cfg = &spec->autocfg; int j, conn_len; - hda_nid_t conn[HDA_MAX_CONNECTIONS]; + hda_nid_t conn[HDA_MAX_CONNECTIONS], fallback_dac; unsigned int wcaps, wtype; conn_len = snd_hda_get_connections(codec, nid, conn, @@ -3001,10 +3002,21 @@ static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t nid) return conn[j]; } } - /* if all DACs are already assigned, connect to the primary DAC */ + + /* if all DACs are already assigned, connect to the primary DAC, + unless we're assigning a secondary headphone */ + fallback_dac = spec->multiout.dac_nids[0]; + if (spec->multiout.hp_nid) { + for (j = 0; j < cfg->hp_outs; j++) + if (cfg->hp_pins[j] == nid) { + fallback_dac = spec->multiout.hp_nid; + break; + } + } + if (conn_len > 1) { for (j = 0; j < conn_len; j++) { - if (conn[j] == spec->multiout.dac_nids[0]) { + if (conn[j] == fallback_dac) { snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, j); break;