summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-15 18:45:53 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-15 18:45:53 +0100
commitea46c3c87c35b90139b4dca43917d0f605d568ed (patch)
tree00306a2e42aeda1b7820b24e03e367cee5dd07f1 /sound/pci/hda/hda_generic.c
parentf038fcaca827a2330d502a5d653ab639419f45db (diff)
ALSA: hda - Add prefer_hp_amp flag to hda_gen_spec
Add a new flag to indicate whether HP amp is turned on as default for speaker or line-outs, and enable this for ALC260 codec, as many machines with this codec require the HP amp even for speakers. 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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 932e6a133f3d..e878a9effc96 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1284,6 +1284,7 @@ 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;
@@ -1421,13 +1422,18 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
spec->speaker_paths);
/* set initial pinctl targets */
- set_pin_targets(codec, cfg->line_outs, cfg->line_out_pins,
- cfg->line_out_type == AUTO_PIN_HP_OUT ? PIN_HP : PIN_OUT);
+ 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)
+ 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, PIN_OUT);
+ cfg->speaker_pins, val);
+ }
return badness;
}