diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-21 10:49:05 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-21 11:09:03 +0100 |
commit | 9314a5813f62e85c8173adf7fd7e088af3b58942 (patch) | |
tree | 4a4cbc1caeda9887d0cf5041512541d8981146f2 /sound/pci/hda/hda_generic.c | |
parent | a769409cf325b697c439acef5d7c0dc4b6a591ba (diff) |
ALSA: hda - Set the pin targets after deciding output config
Since fill_and_eval_dacs() may be called repeatedly with different
configurations, setting pinctls at each time there isn't optimal.
We can set it better only once after deciding the output configuration
in parse_output_paths().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 37d7ed7af2a5..7b739b589818 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -1352,7 +1352,6 @@ static int fill_and_eval_dacs(struct hda_codec *codec, struct hda_gen_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg; int i, err, badness; - unsigned int val; /* set num_dacs once to full for look_for_dac() */ spec->multiout.num_dacs = cfg->line_outs; @@ -1489,20 +1488,6 @@ static int fill_and_eval_dacs(struct hda_codec *codec, spec->multiout.extra_out_nid, spec->speaker_paths); - /* set initial pinctl targets */ - if (spec->prefer_hp_amp || cfg->line_out_type == AUTO_PIN_HP_OUT) - val = PIN_HP; - else - val = PIN_OUT; - set_pin_targets(codec, cfg->line_outs, cfg->line_out_pins, val); - if (cfg->line_out_type != AUTO_PIN_HP_OUT) - set_pin_targets(codec, cfg->hp_outs, cfg->hp_pins, PIN_HP); - if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { - val = spec->prefer_hp_amp ? PIN_HP : PIN_OUT; - set_pin_targets(codec, cfg->speaker_outs, - cfg->speaker_pins, val); - } - return badness; } @@ -1604,6 +1589,7 @@ static int parse_output_paths(struct hda_codec *codec) struct hda_gen_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg; struct auto_pin_cfg *best_cfg; + unsigned int val; int best_badness = INT_MAX; int badness; bool fill_hardwired = true, fill_mio_first = true; @@ -1693,6 +1679,20 @@ static int parse_output_paths(struct hda_codec *codec) HDA_OUTPUT, spec->vmaster_tlv); } + /* set initial pinctl targets */ + if (spec->prefer_hp_amp || cfg->line_out_type == AUTO_PIN_HP_OUT) + val = PIN_HP; + else + val = PIN_OUT; + set_pin_targets(codec, cfg->line_outs, cfg->line_out_pins, val); + if (cfg->line_out_type != AUTO_PIN_HP_OUT) + set_pin_targets(codec, cfg->hp_outs, cfg->hp_pins, PIN_HP); + if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { + val = spec->prefer_hp_amp ? PIN_HP : PIN_OUT; + set_pin_targets(codec, cfg->speaker_outs, + cfg->speaker_pins, val); + } + kfree(best_cfg); return 0; } |