[alsa-devel] [PATCH] hda: default dmuxes to first entry in dinput_mux

Matthew Ranostay mranostay at embeddedalley.com
Tue Jan 20 04:41:56 CET 2009


When using a custom spec->dinput_mux sometimes the value selected is
incorrect due to not have a previously selected default. To remedy this
patch selects the first items index in spec->dinput_mux and sets all the
dmuxes thusly to it. 

Signed-off-by: Matthew Ranostay <mranostay at embeddedalley.com>
---

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index e2b673a..3f5dc1b 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3663,7 +3663,17 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
 		spec->mixers[spec->num_mixers++] = spec->kctls.list;
 
 	spec->input_mux = &spec->private_imux;
-	if (!spec->dinput_mux)
+	if (spec->dinput_mux) {
+		int idx = spec->dinput_mux->items[0].index;
+		int i;
+
+		/* sometimes using a custom dinput_mux causes the incorrect
+ 		 * value to selected on startup, but sure a valid one is
+ 		 * selected by default */
+		for (i = 0; i < spec->num_dmuxes; i++)
+			snd_hda_codec_write_cache(codec, spec->dmux_nids[i], 0,
+				 AC_VERB_SET_CONNECT_SEL, idx);
+	} else
 		spec->dinput_mux = &spec->private_dimux;
 	spec->sinput_mux = &spec->private_smux;
 	spec->mono_mux = &spec->private_mono_mux;


More information about the Alsa-devel mailing list