diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-09-20 08:56:32 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-09-20 08:56:32 -0400 |
commit | f6837bbd599c2a4e1f621441f84286434bcc91ae (patch) | |
tree | 885564ff51b7c42dd33223fe7b4bc1e35b7ac1b8 /sound/pci | |
parent | 84eb01be18df7012ac31bf678da5aaf1accc6a77 (diff) |
ALSA: hda - Fix up autocfg output pin numbers in realtek parser
When quirks are applied, the numbers of output pins in autocfg aren't
set up properly but only pin arrays are changed. Let's fix it up so that
the rest of the parser can use autocfg.line_outs & co safely.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6045f281b225..bb3cf3b7282b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -876,6 +876,28 @@ static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid, | |||
876 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val); | 876 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val); |
877 | } | 877 | } |
878 | 878 | ||
879 | static void alc_fixup_autocfg_pin_nums(struct hda_codec *codec) | ||
880 | { | ||
881 | struct alc_spec *spec = codec->spec; | ||
882 | struct auto_pin_cfg *cfg = &spec->autocfg; | ||
883 | |||
884 | if (!cfg->line_outs) { | ||
885 | while (cfg->line_outs < AUTO_CFG_MAX_OUTS && | ||
886 | cfg->line_out_pins[cfg->line_outs]) | ||
887 | cfg->line_outs++; | ||
888 | } | ||
889 | if (!cfg->speaker_outs) { | ||
890 | while (cfg->speaker_outs < AUTO_CFG_MAX_OUTS && | ||
891 | cfg->speaker_pins[cfg->speaker_outs]) | ||
892 | cfg->speaker_outs++; | ||
893 | } | ||
894 | if (!cfg->hp_outs) { | ||
895 | while (cfg->hp_outs < AUTO_CFG_MAX_OUTS && | ||
896 | cfg->hp_pins[cfg->hp_outs]) | ||
897 | cfg->hp_outs++; | ||
898 | } | ||
899 | } | ||
900 | |||
879 | /* | 901 | /* |
880 | */ | 902 | */ |
881 | static void add_mixer(struct alc_spec *spec, struct snd_kcontrol_new *mix) | 903 | static void add_mixer(struct alc_spec *spec, struct snd_kcontrol_new *mix) |
@@ -944,6 +966,8 @@ static void setup_preset(struct hda_codec *codec, | |||
944 | 966 | ||
945 | if (preset->setup) | 967 | if (preset->setup) |
946 | preset->setup(codec); | 968 | preset->setup(codec); |
969 | |||
970 | alc_fixup_autocfg_pin_nums(codec); | ||
947 | } | 971 | } |
948 | 972 | ||
949 | /* Enable GPIO mask and set output */ | 973 | /* Enable GPIO mask and set output */ |