aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com>2016-05-30 03:58:28 -0400
committerTakashi Iwai <tiwai@suse.de>2016-05-30 08:11:05 -0400
commite69e7e03ed225abf3e1c43545aa3bcb68dc81d5f (patch)
tree5151a0b9f8b135514871dba94ae12317840ff36c
parent1a695a905c18548062509178b98bc91e67510864 (diff)
ALSA: hda/realtek - ALC256 speaker noise issue
That is some different register for ALC255 and ALC256. ALC256 can't fit with some ALC255 register. This issue is cause from LDO output voltage control. This patch is updated the right LDO register value. Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c52
1 files changed, 47 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index d53c25e7a1c1..daf4f64f2c24 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3618,13 +3618,20 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
3618static void alc_headset_mode_unplugged(struct hda_codec *codec) 3618static void alc_headset_mode_unplugged(struct hda_codec *codec)
3619{ 3619{
3620 static struct coef_fw coef0255[] = { 3620 static struct coef_fw coef0255[] = {
3621 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
3622 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ 3621 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
3623 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 3622 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
3624 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ 3623 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
3625 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ 3624 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
3626 {} 3625 {}
3627 }; 3626 };
3627 static struct coef_fw coef0255_1[] = {
3628 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
3629 {}
3630 };
3631 static struct coef_fw coef0256[] = {
3632 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
3633 {}
3634 };
3628 static struct coef_fw coef0233[] = { 3635 static struct coef_fw coef0233[] = {
3629 WRITE_COEF(0x1b, 0x0c0b), 3636 WRITE_COEF(0x1b, 0x0c0b),
3630 WRITE_COEF(0x45, 0xc429), 3637 WRITE_COEF(0x45, 0xc429),
@@ -3677,7 +3684,11 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
3677 3684
3678 switch (codec->core.vendor_id) { 3685 switch (codec->core.vendor_id) {
3679 case 0x10ec0255: 3686 case 0x10ec0255:
3687 alc_process_coef_fw(codec, coef0255_1);
3688 alc_process_coef_fw(codec, coef0255);
3689 break;
3680 case 0x10ec0256: 3690 case 0x10ec0256:
3691 alc_process_coef_fw(codec, coef0256);
3681 alc_process_coef_fw(codec, coef0255); 3692 alc_process_coef_fw(codec, coef0255);
3682 break; 3693 break;
3683 case 0x10ec0233: 3694 case 0x10ec0233:
@@ -3896,6 +3907,12 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
3896 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 3907 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
3897 {} 3908 {}
3898 }; 3909 };
3910 static struct coef_fw coef0256[] = {
3911 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
3912 WRITE_COEF(0x1b, 0x0c6b),
3913 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
3914 {}
3915 };
3899 static struct coef_fw coef0233[] = { 3916 static struct coef_fw coef0233[] = {
3900 WRITE_COEF(0x45, 0xd429), 3917 WRITE_COEF(0x45, 0xd429),
3901 WRITE_COEF(0x1b, 0x0c2b), 3918 WRITE_COEF(0x1b, 0x0c2b),
@@ -3936,9 +3953,11 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
3936 3953
3937 switch (codec->core.vendor_id) { 3954 switch (codec->core.vendor_id) {
3938 case 0x10ec0255: 3955 case 0x10ec0255:
3939 case 0x10ec0256:
3940 alc_process_coef_fw(codec, coef0255); 3956 alc_process_coef_fw(codec, coef0255);
3941 break; 3957 break;
3958 case 0x10ec0256:
3959 alc_process_coef_fw(codec, coef0256);
3960 break;
3942 case 0x10ec0233: 3961 case 0x10ec0233:
3943 case 0x10ec0283: 3962 case 0x10ec0283:
3944 alc_process_coef_fw(codec, coef0233); 3963 alc_process_coef_fw(codec, coef0233);
@@ -3978,6 +3997,12 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
3978 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 3997 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
3979 {} 3998 {}
3980 }; 3999 };
4000 static struct coef_fw coef0256[] = {
4001 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4002 WRITE_COEF(0x1b, 0x0c6b),
4003 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4004 {}
4005 };
3981 static struct coef_fw coef0233[] = { 4006 static struct coef_fw coef0233[] = {
3982 WRITE_COEF(0x45, 0xe429), 4007 WRITE_COEF(0x45, 0xe429),
3983 WRITE_COEF(0x1b, 0x0c2b), 4008 WRITE_COEF(0x1b, 0x0c2b),
@@ -4018,9 +4043,11 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
4018 4043
4019 switch (codec->core.vendor_id) { 4044 switch (codec->core.vendor_id) {
4020 case 0x10ec0255: 4045 case 0x10ec0255:
4021 case 0x10ec0256:
4022 alc_process_coef_fw(codec, coef0255); 4046 alc_process_coef_fw(codec, coef0255);
4023 break; 4047 break;
4048 case 0x10ec0256:
4049 alc_process_coef_fw(codec, coef0256);
4050 break;
4024 case 0x10ec0233: 4051 case 0x10ec0233:
4025 case 0x10ec0283: 4052 case 0x10ec0283:
4026 alc_process_coef_fw(codec, coef0233); 4053 alc_process_coef_fw(codec, coef0233);
@@ -4266,7 +4293,7 @@ static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
4266static void alc255_set_default_jack_type(struct hda_codec *codec) 4293static void alc255_set_default_jack_type(struct hda_codec *codec)
4267{ 4294{
4268 /* Set to iphone type */ 4295 /* Set to iphone type */
4269 static struct coef_fw fw[] = { 4296 static struct coef_fw alc255fw[] = {
4270 WRITE_COEF(0x1b, 0x880b), 4297 WRITE_COEF(0x1b, 0x880b),
4271 WRITE_COEF(0x45, 0xd089), 4298 WRITE_COEF(0x45, 0xd089),
4272 WRITE_COEF(0x1b, 0x080b), 4299 WRITE_COEF(0x1b, 0x080b),
@@ -4274,7 +4301,22 @@ static void alc255_set_default_jack_type(struct hda_codec *codec)
4274 WRITE_COEF(0x1b, 0x0c0b), 4301 WRITE_COEF(0x1b, 0x0c0b),
4275 {} 4302 {}
4276 }; 4303 };
4277 alc_process_coef_fw(codec, fw); 4304 static struct coef_fw alc256fw[] = {
4305 WRITE_COEF(0x1b, 0x884b),
4306 WRITE_COEF(0x45, 0xd089),
4307 WRITE_COEF(0x1b, 0x084b),
4308 WRITE_COEF(0x46, 0x0004),
4309 WRITE_COEF(0x1b, 0x0c4b),
4310 {}
4311 };
4312 switch (codec->core.vendor_id) {
4313 case 0x10ec0255:
4314 alc_process_coef_fw(codec, alc255fw);
4315 break;
4316 case 0x10ec0256:
4317 alc_process_coef_fw(codec, alc256fw);
4318 break;
4319 }
4278 msleep(30); 4320 msleep(30);
4279} 4321}
4280 4322