diff options
author | Jiang Zhe <zhe.jiang@intel.com> | 2007-12-20 07:13:13 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:44 -0500 |
commit | a9b3aa8a0a203b9b62e15c465ba7d4797a6a2c79 (patch) | |
tree | 865d369d57ab308743e34f52cbea1e393967b4d1 /sound/pci | |
parent | 6b7eb1960d3fd713205277e86da72a6e3979c9ac (diff) |
[ALSA] hda-codec - alc268 input_mux should be a selector instead of mixer
According to the [0003659], the node 0x23,0x24 is a selector.
I checked the alc268 spec on the REALTEK website and it showed that they
were selectors indeed.
However, current code implement the alc268 input_mux in a mixer way.
Signed-off-by: Jiang Zhe <zhe.jiang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a9d7fe9ac6f1..617f3ee304b1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -9196,19 +9196,13 @@ static struct hda_verb alc268_base_init_verbs[] = { | |||
9196 | {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 9196 | {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
9197 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, | 9197 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, |
9198 | 9198 | ||
9199 | /* FIXME: use matrix-type input source selection */ | 9199 | /* Unmute Selector 23h,24h and set the default input to mic-in */ |
9200 | /* Mixer elements: 0x18, 19, 1a, 1c, 14, 15, 0b */ | 9200 | |
9201 | /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */ | 9201 | {0x23, AC_VERB_SET_CONNECT_SEL, 0x00}, |
9202 | /* Input mixer2 */ | 9202 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
9203 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, | 9203 | {0x24, AC_VERB_SET_CONNECT_SEL, 0x00}, |
9204 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, | 9204 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
9205 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))}, | ||
9206 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))}, | ||
9207 | 9205 | ||
9208 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, | ||
9209 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, | ||
9210 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))}, | ||
9211 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))}, | ||
9212 | { } | 9206 | { } |
9213 | }; | 9207 | }; |
9214 | 9208 | ||
@@ -9253,29 +9247,14 @@ static int alc268_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
9253 | { | 9247 | { |
9254 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 9248 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
9255 | struct alc_spec *spec = codec->spec; | 9249 | struct alc_spec *spec = codec->spec; |
9256 | const struct hda_input_mux *imux = spec->input_mux; | 9250 | |
9257 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 9251 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
9258 | static hda_nid_t capture_mixers[3] = { 0x23, 0x24 }; | 9252 | static hda_nid_t capture_mixers[3] = { 0x23, 0x24 }; |
9259 | hda_nid_t nid = capture_mixers[adc_idx]; | 9253 | hda_nid_t nid = capture_mixers[adc_idx]; |
9260 | unsigned int *cur_val = &spec->cur_mux[adc_idx]; | ||
9261 | unsigned int i, idx; | ||
9262 | 9254 | ||
9263 | idx = ucontrol->value.enumerated.item[0]; | 9255 | return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, |
9264 | if (idx >= imux->num_items) | 9256 | nid, |
9265 | idx = imux->num_items - 1; | 9257 | &spec->cur_mux[adc_idx]); |
9266 | if (*cur_val == idx) | ||
9267 | return 0; | ||
9268 | for (i = 0; i < imux->num_items; i++) { | ||
9269 | unsigned int v = (i == idx) ? 0 : HDA_AMP_MUTE; | ||
9270 | snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT, | ||
9271 | imux->items[i].index, | ||
9272 | HDA_AMP_MUTE, v); | ||
9273 | snd_hda_codec_write_cache(codec, nid, 0, | ||
9274 | AC_VERB_SET_CONNECT_SEL, | ||
9275 | idx ); | ||
9276 | } | ||
9277 | *cur_val = idx; | ||
9278 | return 1; | ||
9279 | } | 9258 | } |
9280 | 9259 | ||
9281 | static struct snd_kcontrol_new alc268_capture_alt_mixer[] = { | 9260 | static struct snd_kcontrol_new alc268_capture_alt_mixer[] = { |