diff options
author | Kailang Yang <kailang@realtek.com> | 2015-04-08 03:01:17 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-04-08 05:30:59 -0400 |
commit | f3b703326541d0c1ce85f5e570f6d2b6bd4296ec (patch) | |
tree | af023fa1e3a3c6f1c204ce4e50a9e5dd09219831 /sound/pci | |
parent | 0a599838737a2527c35e4d94f794aefe59df1781 (diff) |
ALSA: hda/realtek - Support headset mode for ALC286/288
Support headset mode for ALC286 and ALC288 platforms.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7f46d063af57..ceb599a87803 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -3542,6 +3542,14 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) | |||
3542 | WRITE_COEF(0x32, 0x42a3), | 3542 | WRITE_COEF(0x32, 0x42a3), |
3543 | {} | 3543 | {} |
3544 | }; | 3544 | }; |
3545 | static struct coef_fw coef0288[] = { | ||
3546 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | ||
3547 | UPDATE_COEF(0x50, 0x2000, 0x2000), | ||
3548 | UPDATE_COEF(0x56, 0x0006, 0x0006), | ||
3549 | UPDATE_COEF(0x66, 0x0008, 0), | ||
3550 | UPDATE_COEF(0x67, 0x2000, 0), | ||
3551 | {} | ||
3552 | }; | ||
3545 | static struct coef_fw coef0292[] = { | 3553 | static struct coef_fw coef0292[] = { |
3546 | WRITE_COEF(0x76, 0x000e), | 3554 | WRITE_COEF(0x76, 0x000e), |
3547 | WRITE_COEF(0x6c, 0x2400), | 3555 | WRITE_COEF(0x6c, 0x2400), |
@@ -3573,6 +3581,10 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) | |||
3573 | case 0x10ec0283: | 3581 | case 0x10ec0283: |
3574 | alc_process_coef_fw(codec, coef0233); | 3582 | alc_process_coef_fw(codec, coef0233); |
3575 | break; | 3583 | break; |
3584 | case 0x10ec0286: | ||
3585 | case 0x10ec0288: | ||
3586 | alc_process_coef_fw(codec, coef0288); | ||
3587 | break; | ||
3576 | case 0x10ec0292: | 3588 | case 0x10ec0292: |
3577 | alc_process_coef_fw(codec, coef0292); | 3589 | alc_process_coef_fw(codec, coef0292); |
3578 | break; | 3590 | break; |
@@ -3602,6 +3614,14 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |||
3602 | WRITE_COEF(0x26, 0x008c), | 3614 | WRITE_COEF(0x26, 0x008c), |
3603 | {} | 3615 | {} |
3604 | }; | 3616 | }; |
3617 | static struct coef_fw coef0288[] = { | ||
3618 | UPDATE_COEF(0x50, 0x2000, 0), | ||
3619 | UPDATE_COEF(0x56, 0x0006, 0), | ||
3620 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | ||
3621 | UPDATE_COEF(0x66, 0x0008, 0x0008), | ||
3622 | UPDATE_COEF(0x67, 0x2000, 0x2000), | ||
3623 | {} | ||
3624 | }; | ||
3605 | static struct coef_fw coef0292[] = { | 3625 | static struct coef_fw coef0292[] = { |
3606 | WRITE_COEF(0x19, 0xa208), | 3626 | WRITE_COEF(0x19, 0xa208), |
3607 | WRITE_COEF(0x2e, 0xacf0), | 3627 | WRITE_COEF(0x2e, 0xacf0), |
@@ -3635,6 +3655,13 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |||
3635 | alc_process_coef_fw(codec, coef0233); | 3655 | alc_process_coef_fw(codec, coef0233); |
3636 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | 3656 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
3637 | break; | 3657 | break; |
3658 | case 0x10ec0286: | ||
3659 | case 0x10ec0288: | ||
3660 | alc_update_coef_idx(codec, 0x4f, 0x000c, 0); | ||
3661 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | ||
3662 | alc_process_coef_fw(codec, coef0288); | ||
3663 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | ||
3664 | break; | ||
3638 | case 0x10ec0292: | 3665 | case 0x10ec0292: |
3639 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | 3666 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
3640 | alc_process_coef_fw(codec, coef0292); | 3667 | alc_process_coef_fw(codec, coef0292); |
@@ -3670,6 +3697,14 @@ static void alc_headset_mode_default(struct hda_codec *codec) | |||
3670 | WRITE_COEF(0x32, 0x4ea3), | 3697 | WRITE_COEF(0x32, 0x4ea3), |
3671 | {} | 3698 | {} |
3672 | }; | 3699 | }; |
3700 | static struct coef_fw coef0288[] = { | ||
3701 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ | ||
3702 | UPDATE_COEF(0x50, 0x2000, 0x2000), | ||
3703 | UPDATE_COEF(0x56, 0x0006, 0x0006), | ||
3704 | UPDATE_COEF(0x66, 0x0008, 0), | ||
3705 | UPDATE_COEF(0x67, 0x2000, 0), | ||
3706 | {} | ||
3707 | }; | ||
3673 | static struct coef_fw coef0292[] = { | 3708 | static struct coef_fw coef0292[] = { |
3674 | WRITE_COEF(0x76, 0x000e), | 3709 | WRITE_COEF(0x76, 0x000e), |
3675 | WRITE_COEF(0x6c, 0x2400), | 3710 | WRITE_COEF(0x6c, 0x2400), |
@@ -3699,6 +3734,11 @@ static void alc_headset_mode_default(struct hda_codec *codec) | |||
3699 | case 0x10ec0283: | 3734 | case 0x10ec0283: |
3700 | alc_process_coef_fw(codec, coef0233); | 3735 | alc_process_coef_fw(codec, coef0233); |
3701 | break; | 3736 | break; |
3737 | case 0x10ec0286: | ||
3738 | case 0x10ec0288: | ||
3739 | alc_process_coef_fw(codec, coef0288); | ||
3740 | break; | ||
3741 | break; | ||
3702 | case 0x10ec0292: | 3742 | case 0x10ec0292: |
3703 | alc_process_coef_fw(codec, coef0292); | 3743 | alc_process_coef_fw(codec, coef0292); |
3704 | break; | 3744 | break; |
@@ -3727,6 +3767,13 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) | |||
3727 | WRITE_COEF(0x32, 0x4ea3), | 3767 | WRITE_COEF(0x32, 0x4ea3), |
3728 | {} | 3768 | {} |
3729 | }; | 3769 | }; |
3770 | static struct coef_fw coef0288[] = { | ||
3771 | UPDATE_COEF(0x50, 0x2000, 0x2000), | ||
3772 | UPDATE_COEF(0x56, 0x0006, 0x0006), | ||
3773 | UPDATE_COEF(0x66, 0x0008, 0), | ||
3774 | UPDATE_COEF(0x67, 0x2000, 0), | ||
3775 | {} | ||
3776 | }; | ||
3730 | static struct coef_fw coef0292[] = { | 3777 | static struct coef_fw coef0292[] = { |
3731 | WRITE_COEF(0x6b, 0xd429), | 3778 | WRITE_COEF(0x6b, 0xd429), |
3732 | WRITE_COEF(0x76, 0x0008), | 3779 | WRITE_COEF(0x76, 0x0008), |
@@ -3754,6 +3801,12 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) | |||
3754 | case 0x10ec0283: | 3801 | case 0x10ec0283: |
3755 | alc_process_coef_fw(codec, coef0233); | 3802 | alc_process_coef_fw(codec, coef0233); |
3756 | break; | 3803 | break; |
3804 | case 0x10ec0286: | ||
3805 | case 0x10ec0288: | ||
3806 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | ||
3807 | msleep(300); | ||
3808 | alc_process_coef_fw(codec, coef0288); | ||
3809 | break; | ||
3757 | case 0x10ec0292: | 3810 | case 0x10ec0292: |
3758 | alc_process_coef_fw(codec, coef0292); | 3811 | alc_process_coef_fw(codec, coef0292); |
3759 | break; | 3812 | break; |
@@ -3782,6 +3835,13 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) | |||
3782 | WRITE_COEF(0x32, 0x4ea3), | 3835 | WRITE_COEF(0x32, 0x4ea3), |
3783 | {} | 3836 | {} |
3784 | }; | 3837 | }; |
3838 | static struct coef_fw coef0288[] = { | ||
3839 | UPDATE_COEF(0x50, 0x2000, 0x2000), | ||
3840 | UPDATE_COEF(0x56, 0x0006, 0x0006), | ||
3841 | UPDATE_COEF(0x66, 0x0008, 0), | ||
3842 | UPDATE_COEF(0x67, 0x2000, 0), | ||
3843 | {} | ||
3844 | }; | ||
3785 | static struct coef_fw coef0292[] = { | 3845 | static struct coef_fw coef0292[] = { |
3786 | WRITE_COEF(0x6b, 0xe429), | 3846 | WRITE_COEF(0x6b, 0xe429), |
3787 | WRITE_COEF(0x76, 0x0008), | 3847 | WRITE_COEF(0x76, 0x0008), |
@@ -3809,6 +3869,12 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) | |||
3809 | case 0x10ec0283: | 3869 | case 0x10ec0283: |
3810 | alc_process_coef_fw(codec, coef0233); | 3870 | alc_process_coef_fw(codec, coef0233); |
3811 | break; | 3871 | break; |
3872 | case 0x10ec0286: | ||
3873 | case 0x10ec0288: | ||
3874 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); | ||
3875 | msleep(300); | ||
3876 | alc_process_coef_fw(codec, coef0288); | ||
3877 | break; | ||
3812 | case 0x10ec0292: | 3878 | case 0x10ec0292: |
3813 | alc_process_coef_fw(codec, coef0292); | 3879 | alc_process_coef_fw(codec, coef0292); |
3814 | break; | 3880 | break; |
@@ -3833,6 +3899,10 @@ static void alc_determine_headset_type(struct hda_codec *codec) | |||
3833 | conteol) */ | 3899 | conteol) */ |
3834 | {} | 3900 | {} |
3835 | }; | 3901 | }; |
3902 | static struct coef_fw coef0288[] = { | ||
3903 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ | ||
3904 | {} | ||
3905 | }; | ||
3836 | static struct coef_fw coef0293[] = { | 3906 | static struct coef_fw coef0293[] = { |
3837 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ | 3907 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
3838 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ | 3908 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
@@ -3861,6 +3931,13 @@ static void alc_determine_headset_type(struct hda_codec *codec) | |||
3861 | val = alc_read_coef_idx(codec, 0x46); | 3931 | val = alc_read_coef_idx(codec, 0x46); |
3862 | is_ctia = (val & 0x0070) == 0x0070; | 3932 | is_ctia = (val & 0x0070) == 0x0070; |
3863 | break; | 3933 | break; |
3934 | case 0x10ec0286: | ||
3935 | case 0x10ec0288: | ||
3936 | alc_process_coef_fw(codec, coef0288); | ||
3937 | msleep(350); | ||
3938 | val = alc_read_coef_idx(codec, 0x50); | ||
3939 | is_ctia = (val & 0x0070) == 0x0070; | ||
3940 | break; | ||
3864 | case 0x10ec0292: | 3941 | case 0x10ec0292: |
3865 | alc_write_coef_idx(codec, 0x6b, 0xd429); | 3942 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
3866 | msleep(300); | 3943 | msleep(300); |