diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-15 12:45:53 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-15 12:45:53 -0500 |
commit | ea46c3c87c35b90139b4dca43917d0f605d568ed (patch) | |
tree | 00306a2e42aeda1b7820b24e03e367cee5dd07f1 /sound/pci/hda/hda_generic.c | |
parent | f038fcaca827a2330d502a5d653ab639419f45db (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.c | 14 |
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, | |||
1284 | struct hda_gen_spec *spec = codec->spec; | 1284 | struct hda_gen_spec *spec = codec->spec; |
1285 | struct auto_pin_cfg *cfg = &spec->autocfg; | 1285 | struct auto_pin_cfg *cfg = &spec->autocfg; |
1286 | int i, err, badness; | 1286 | int i, err, badness; |
1287 | unsigned int val; | ||
1287 | 1288 | ||
1288 | /* set num_dacs once to full for look_for_dac() */ | 1289 | /* set num_dacs once to full for look_for_dac() */ |
1289 | spec->multiout.num_dacs = cfg->line_outs; | 1290 | spec->multiout.num_dacs = cfg->line_outs; |
@@ -1421,13 +1422,18 @@ static int fill_and_eval_dacs(struct hda_codec *codec, | |||
1421 | spec->speaker_paths); | 1422 | spec->speaker_paths); |
1422 | 1423 | ||
1423 | /* set initial pinctl targets */ | 1424 | /* set initial pinctl targets */ |
1424 | set_pin_targets(codec, cfg->line_outs, cfg->line_out_pins, | 1425 | if (spec->prefer_hp_amp || cfg->line_out_type == AUTO_PIN_HP_OUT) |
1425 | cfg->line_out_type == AUTO_PIN_HP_OUT ? PIN_HP : PIN_OUT); | 1426 | val = PIN_HP; |
1427 | else | ||
1428 | val = PIN_OUT; | ||
1429 | set_pin_targets(codec, cfg->line_outs, cfg->line_out_pins, val); | ||
1426 | if (cfg->line_out_type != AUTO_PIN_HP_OUT) | 1430 | if (cfg->line_out_type != AUTO_PIN_HP_OUT) |
1427 | set_pin_targets(codec, cfg->hp_outs, cfg->hp_pins, PIN_HP); | 1431 | set_pin_targets(codec, cfg->hp_outs, cfg->hp_pins, PIN_HP); |
1428 | if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) | 1432 | if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { |
1433 | val = spec->prefer_hp_amp ? PIN_HP : PIN_OUT; | ||
1429 | set_pin_targets(codec, cfg->speaker_outs, | 1434 | set_pin_targets(codec, cfg->speaker_outs, |
1430 | cfg->speaker_pins, PIN_OUT); | 1435 | cfg->speaker_pins, val); |
1436 | } | ||
1431 | 1437 | ||
1432 | return badness; | 1438 | return badness; |
1433 | } | 1439 | } |