diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-07-12 10:28:50 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-12 11:25:45 -0400 |
commit | 32e0191d7909022e5016beb75dda6710a28b3c61 (patch) | |
tree | 99d250136215f2245c1ce6e80b290ee32a5f3a4f /sound/pci | |
parent | f8fb27bd4aac6b5b16fa37761aeffe8976d445da (diff) |
ALSA: HDA: VT1708S: fix Smart5.1 mode
Correctly configure bidirectional pins when resuming; do not power down
widgets when they are needed for Smart5.1 output; and on 3-jack boards,
create the streams and controls needed for six channels.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Reported-and-tested-by: Viliam Kubis <viliam.kubis@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_via.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 73453814e098..ae3acb2b42d1 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -552,24 +552,30 @@ static void via_auto_init_hp_out(struct hda_codec *codec) | |||
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
555 | static int is_smart51_pins(struct via_spec *spec, hda_nid_t pin); | ||
556 | |||
555 | static void via_auto_init_analog_input(struct hda_codec *codec) | 557 | static void via_auto_init_analog_input(struct hda_codec *codec) |
556 | { | 558 | { |
557 | struct via_spec *spec = codec->spec; | 559 | struct via_spec *spec = codec->spec; |
560 | unsigned int ctl; | ||
558 | int i; | 561 | int i; |
559 | 562 | ||
560 | for (i = 0; i < AUTO_PIN_LAST; i++) { | 563 | for (i = 0; i < AUTO_PIN_LAST; i++) { |
561 | hda_nid_t nid = spec->autocfg.input_pins[i]; | 564 | hda_nid_t nid = spec->autocfg.input_pins[i]; |
565 | if (!nid) | ||
566 | continue; | ||
562 | 567 | ||
568 | if (spec->smart51_enabled && is_smart51_pins(spec, nid)) | ||
569 | ctl = PIN_OUT; | ||
570 | else if (i <= AUTO_PIN_FRONT_MIC) | ||
571 | ctl = PIN_VREF50; | ||
572 | else | ||
573 | ctl = PIN_IN; | ||
563 | snd_hda_codec_write(codec, nid, 0, | 574 | snd_hda_codec_write(codec, nid, 0, |
564 | AC_VERB_SET_PIN_WIDGET_CONTROL, | 575 | AC_VERB_SET_PIN_WIDGET_CONTROL, ctl); |
565 | (i <= AUTO_PIN_FRONT_MIC ? | ||
566 | PIN_VREF50 : PIN_IN)); | ||
567 | |||
568 | } | 576 | } |
569 | } | 577 | } |
570 | 578 | ||
571 | static int is_smart51_pins(struct via_spec *spec, hda_nid_t pin); | ||
572 | |||
573 | static void set_pin_power_state(struct hda_codec *codec, hda_nid_t nid, | 579 | static void set_pin_power_state(struct hda_codec *codec, hda_nid_t nid, |
574 | unsigned int *affected_parm) | 580 | unsigned int *affected_parm) |
575 | { | 581 | { |
@@ -658,6 +664,8 @@ static void set_jack_power_state(struct hda_codec *codec) | |||
658 | /* PW0 (19h), SW1 (18h), AOW1 (11h) */ | 664 | /* PW0 (19h), SW1 (18h), AOW1 (11h) */ |
659 | parm = AC_PWRST_D3; | 665 | parm = AC_PWRST_D3; |
660 | set_pin_power_state(codec, 0x19, &parm); | 666 | set_pin_power_state(codec, 0x19, &parm); |
667 | if (spec->smart51_enabled) | ||
668 | parm = AC_PWRST_D0; | ||
661 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_POWER_STATE, | 669 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_POWER_STATE, |
662 | parm); | 670 | parm); |
663 | snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_POWER_STATE, | 671 | snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_POWER_STATE, |
@@ -667,6 +675,8 @@ static void set_jack_power_state(struct hda_codec *codec) | |||
667 | if (is_8ch) { | 675 | if (is_8ch) { |
668 | parm = AC_PWRST_D3; | 676 | parm = AC_PWRST_D3; |
669 | set_pin_power_state(codec, 0x22, &parm); | 677 | set_pin_power_state(codec, 0x22, &parm); |
678 | if (spec->smart51_enabled) | ||
679 | parm = AC_PWRST_D0; | ||
670 | snd_hda_codec_write(codec, 0x26, 0, | 680 | snd_hda_codec_write(codec, 0x26, 0, |
671 | AC_VERB_SET_POWER_STATE, parm); | 681 | AC_VERB_SET_POWER_STATE, parm); |
672 | snd_hda_codec_write(codec, 0x24, 0, | 682 | snd_hda_codec_write(codec, 0x24, 0, |
@@ -3915,6 +3925,13 @@ static int vt1708S_auto_fill_dac_nids(struct via_spec *spec, | |||
3915 | } | 3925 | } |
3916 | } | 3926 | } |
3917 | 3927 | ||
3928 | /* for Smart 5.1, line/mic inputs double as output pins */ | ||
3929 | if (cfg->line_outs == 1) { | ||
3930 | spec->multiout.num_dacs = 3; | ||
3931 | spec->multiout.dac_nids[AUTO_SEQ_SURROUND] = 0x11; | ||
3932 | spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x24; | ||
3933 | } | ||
3934 | |||
3918 | return 0; | 3935 | return 0; |
3919 | } | 3936 | } |
3920 | 3937 | ||
@@ -3932,7 +3949,8 @@ static int vt1708S_auto_create_multi_out_ctls(struct via_spec *spec, | |||
3932 | for (i = 0; i <= AUTO_SEQ_SIDE; i++) { | 3949 | for (i = 0; i <= AUTO_SEQ_SIDE; i++) { |
3933 | nid = cfg->line_out_pins[i]; | 3950 | nid = cfg->line_out_pins[i]; |
3934 | 3951 | ||
3935 | if (!nid) | 3952 | /* for Smart 5.1, there are always at least six channels */ |
3953 | if (!nid && i > AUTO_SEQ_CENLFE) | ||
3936 | continue; | 3954 | continue; |
3937 | 3955 | ||
3938 | nid_vol = nid_vols[i]; | 3956 | nid_vol = nid_vols[i]; |