diff options
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index d83649c25fb2..39001c47e627 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -3635,6 +3635,26 @@ static void stac92xx_auto_init_hp_out(struct hda_codec *codec) | |||
3635 | } | 3635 | } |
3636 | } | 3636 | } |
3637 | 3637 | ||
3638 | static int is_dual_headphones(struct hda_codec *codec) | ||
3639 | { | ||
3640 | struct sigmatel_spec *spec = codec->spec; | ||
3641 | int i, valid_hps; | ||
3642 | |||
3643 | if (spec->autocfg.line_out_type != AUTO_PIN_SPEAKER_OUT || | ||
3644 | spec->autocfg.hp_outs <= 1) | ||
3645 | return 0; | ||
3646 | valid_hps = 0; | ||
3647 | for (i = 0; i < spec->autocfg.hp_outs; i++) { | ||
3648 | hda_nid_t nid = spec->autocfg.hp_pins[i]; | ||
3649 | unsigned int cfg = snd_hda_codec_get_pincfg(codec, nid); | ||
3650 | if (get_defcfg_location(cfg) & AC_JACK_LOC_SEPARATE) | ||
3651 | continue; | ||
3652 | valid_hps++; | ||
3653 | } | ||
3654 | return (valid_hps > 1); | ||
3655 | } | ||
3656 | |||
3657 | |||
3638 | static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out, hda_nid_t dig_in) | 3658 | static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out, hda_nid_t dig_in) |
3639 | { | 3659 | { |
3640 | struct sigmatel_spec *spec = codec->spec; | 3660 | struct sigmatel_spec *spec = codec->spec; |
@@ -3651,8 +3671,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out | |||
3651 | /* If we have no real line-out pin and multiple hp-outs, HPs should | 3671 | /* If we have no real line-out pin and multiple hp-outs, HPs should |
3652 | * be set up as multi-channel outputs. | 3672 | * be set up as multi-channel outputs. |
3653 | */ | 3673 | */ |
3654 | if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT && | 3674 | if (is_dual_headphones(codec)) { |
3655 | spec->autocfg.hp_outs > 1) { | ||
3656 | /* Copy hp_outs to line_outs, backup line_outs in | 3675 | /* Copy hp_outs to line_outs, backup line_outs in |
3657 | * speaker_outs so that the following routines can handle | 3676 | * speaker_outs so that the following routines can handle |
3658 | * HP pins as primary outputs. | 3677 | * HP pins as primary outputs. |