diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7e99763ca527..fea976793ae5 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -275,13 +275,13 @@ struct alc_spec { | |||
275 | */ | 275 | */ |
276 | unsigned int num_init_verbs; | 276 | unsigned int num_init_verbs; |
277 | 277 | ||
278 | char stream_name_analog[16]; /* analog PCM stream */ | 278 | char stream_name_analog[32]; /* analog PCM stream */ |
279 | struct hda_pcm_stream *stream_analog_playback; | 279 | struct hda_pcm_stream *stream_analog_playback; |
280 | struct hda_pcm_stream *stream_analog_capture; | 280 | struct hda_pcm_stream *stream_analog_capture; |
281 | struct hda_pcm_stream *stream_analog_alt_playback; | 281 | struct hda_pcm_stream *stream_analog_alt_playback; |
282 | struct hda_pcm_stream *stream_analog_alt_capture; | 282 | struct hda_pcm_stream *stream_analog_alt_capture; |
283 | 283 | ||
284 | char stream_name_digital[16]; /* digital PCM stream */ | 284 | char stream_name_digital[32]; /* digital PCM stream */ |
285 | struct hda_pcm_stream *stream_digital_playback; | 285 | struct hda_pcm_stream *stream_digital_playback; |
286 | struct hda_pcm_stream *stream_digital_capture; | 286 | struct hda_pcm_stream *stream_digital_capture; |
287 | 287 | ||
@@ -559,7 +559,7 @@ static int alc_pin_mode_get(struct snd_kcontrol *kcontrol, | |||
559 | 559 | ||
560 | /* Find enumerated value for current pinctl setting */ | 560 | /* Find enumerated value for current pinctl setting */ |
561 | i = alc_pin_mode_min(dir); | 561 | i = alc_pin_mode_min(dir); |
562 | while (alc_pin_mode_values[i] != pinctl && i <= alc_pin_mode_max(dir)) | 562 | while (i <= alc_pin_mode_max(dir) && alc_pin_mode_values[i] != pinctl) |
563 | i++; | 563 | i++; |
564 | *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); | 564 | *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); |
565 | return 0; | 565 | return 0; |
@@ -10631,6 +10631,18 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec, | |||
10631 | alc262_lenovo_3000_automute(codec, 1); | 10631 | alc262_lenovo_3000_automute(codec, 1); |
10632 | } | 10632 | } |
10633 | 10633 | ||
10634 | static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid, | ||
10635 | int dir, int idx, long *valp) | ||
10636 | { | ||
10637 | int i, change = 0; | ||
10638 | |||
10639 | for (i = 0; i < 2; i++, valp++) | ||
10640 | change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx, | ||
10641 | HDA_AMP_MUTE, | ||
10642 | *valp ? 0 : HDA_AMP_MUTE); | ||
10643 | return change; | ||
10644 | } | ||
10645 | |||
10634 | /* bind hp and internal speaker mute (with plug check) */ | 10646 | /* bind hp and internal speaker mute (with plug check) */ |
10635 | static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, | 10647 | static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, |
10636 | struct snd_ctl_elem_value *ucontrol) | 10648 | struct snd_ctl_elem_value *ucontrol) |
@@ -10639,13 +10651,8 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10639 | long *valp = ucontrol->value.integer.value; | 10651 | long *valp = ucontrol->value.integer.value; |
10640 | int change; | 10652 | int change; |
10641 | 10653 | ||
10642 | change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, | 10654 | change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); |
10643 | HDA_AMP_MUTE, | 10655 | change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); |
10644 | valp ? 0 : HDA_AMP_MUTE); | ||
10645 | change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, | ||
10646 | HDA_AMP_MUTE, | ||
10647 | valp ? 0 : HDA_AMP_MUTE); | ||
10648 | |||
10649 | if (change) | 10656 | if (change) |
10650 | alc262_fujitsu_automute(codec, 0); | 10657 | alc262_fujitsu_automute(codec, 0); |
10651 | return change; | 10658 | return change; |
@@ -10680,10 +10687,7 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10680 | long *valp = ucontrol->value.integer.value; | 10687 | long *valp = ucontrol->value.integer.value; |
10681 | int change; | 10688 | int change; |
10682 | 10689 | ||
10683 | change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, | 10690 | change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); |
10684 | HDA_AMP_MUTE, | ||
10685 | valp ? 0 : HDA_AMP_MUTE); | ||
10686 | |||
10687 | if (change) | 10691 | if (change) |
10688 | alc262_lenovo_3000_automute(codec, 0); | 10692 | alc262_lenovo_3000_automute(codec, 0); |
10689 | return change; | 10693 | return change; |
@@ -11854,12 +11858,7 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol, | |||
11854 | long *valp = ucontrol->value.integer.value; | 11858 | long *valp = ucontrol->value.integer.value; |
11855 | int change; | 11859 | int change; |
11856 | 11860 | ||
11857 | change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, | 11861 | change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); |
11858 | HDA_AMP_MUTE, | ||
11859 | valp[0] ? 0 : HDA_AMP_MUTE); | ||
11860 | change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, | ||
11861 | HDA_AMP_MUTE, | ||
11862 | valp[1] ? 0 : HDA_AMP_MUTE); | ||
11863 | if (change) | 11862 | if (change) |
11864 | alc268_acer_automute(codec, 0); | 11863 | alc268_acer_automute(codec, 0); |
11865 | return change; | 11864 | return change; |
@@ -13564,6 +13563,8 @@ static int patch_alc269(struct hda_codec *codec) | |||
13564 | set_capture_mixer(spec); | 13563 | set_capture_mixer(spec); |
13565 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 13564 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
13566 | 13565 | ||
13566 | spec->vmaster_nid = 0x02; | ||
13567 | |||
13567 | codec->patch_ops = alc_patch_ops; | 13568 | codec->patch_ops = alc_patch_ops; |
13568 | if (board_config == ALC269_AUTO) | 13569 | if (board_config == ALC269_AUTO) |
13569 | spec->init_hook = alc269_auto_init; | 13570 | spec->init_hook = alc269_auto_init; |
@@ -15158,7 +15159,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { | |||
15158 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), | 15159 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), |
15159 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), | 15160 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), |
15160 | /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/ | 15161 | /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/ |
15161 | SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), | 15162 | SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO), |
15162 | SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO), | 15163 | SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO), |
15163 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS), | 15164 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS), |
15164 | SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG), | 15165 | SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG), |
@@ -15578,9 +15579,12 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
15578 | spec->stream_digital_playback = &alc861vd_pcm_digital_playback; | 15579 | spec->stream_digital_playback = &alc861vd_pcm_digital_playback; |
15579 | spec->stream_digital_capture = &alc861vd_pcm_digital_capture; | 15580 | spec->stream_digital_capture = &alc861vd_pcm_digital_capture; |
15580 | 15581 | ||
15581 | spec->adc_nids = alc861vd_adc_nids; | 15582 | if (!spec->adc_nids) { |
15582 | spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); | 15583 | spec->adc_nids = alc861vd_adc_nids; |
15583 | spec->capsrc_nids = alc861vd_capsrc_nids; | 15584 | spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); |
15585 | } | ||
15586 | if (!spec->capsrc_nids) | ||
15587 | spec->capsrc_nids = alc861vd_capsrc_nids; | ||
15584 | 15588 | ||
15585 | set_capture_mixer(spec); | 15589 | set_capture_mixer(spec); |
15586 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 15590 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
@@ -17497,9 +17501,12 @@ static int patch_alc662(struct hda_codec *codec) | |||
17497 | spec->stream_digital_playback = &alc662_pcm_digital_playback; | 17501 | spec->stream_digital_playback = &alc662_pcm_digital_playback; |
17498 | spec->stream_digital_capture = &alc662_pcm_digital_capture; | 17502 | spec->stream_digital_capture = &alc662_pcm_digital_capture; |
17499 | 17503 | ||
17500 | spec->adc_nids = alc662_adc_nids; | 17504 | if (!spec->adc_nids) { |
17501 | spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); | 17505 | spec->adc_nids = alc662_adc_nids; |
17502 | spec->capsrc_nids = alc662_capsrc_nids; | 17506 | spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); |
17507 | } | ||
17508 | if (!spec->capsrc_nids) | ||
17509 | spec->capsrc_nids = alc662_capsrc_nids; | ||
17503 | 17510 | ||
17504 | if (!spec->cap_mixer) | 17511 | if (!spec->cap_mixer) |
17505 | set_capture_mixer(spec); | 17512 | set_capture_mixer(spec); |