hda: default dmuxes to first entry in dinput_mux
PATCH 1/1 hda: default dmuxes to first entry in dinput_mux
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 <[email protected]>
---
sound/pci/hda/patch_sigmatel.c +11 -1
@@ -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;
At Mon, 19 Jan 2009 22:41:56 -0500,
Quoted 5 lines · Matthew Ranostay
When using a custom
spec->dinput_muxsometimes the value selected is incorrect due to not have a previously selected default. To remedy this patch selects the first items index inspec->dinput_muxand sets all the dmuxes thusly to it.
Shouldn't we initialize the item selection even for the BIOS dinput_mux? (Who can trust BIOS setup? ;)
thanks,
Takashi
Quoted 28 lines
Signed-off-by Matthew Ranostay <[email protected]>---
sound/pci/hda/patch_sigmatel.c +11
-1@@ -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;