Skip to content

Commit

Permalink
ALSA: hda/realtek - ALC256 speaker noise issue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kailangyang authored and tiwai committed May 30, 2016
1 parent 1a695a9 commit e69e7e0
Showing 1 changed file with 47 additions and 5 deletions.
52 changes: 47 additions & 5 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -3618,13 +3618,20 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
static void alc_headset_mode_unplugged(struct hda_codec *codec)
{
static struct coef_fw coef0255[] = {
WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
{}
};
static struct coef_fw coef0255_1[] = {
WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
{}
};
static struct coef_fw coef0256[] = {
WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
{}
};
static struct coef_fw coef0233[] = {
WRITE_COEF(0x1b, 0x0c0b),
WRITE_COEF(0x45, 0xc429),
Expand Down Expand Up @@ -3677,7 +3684,11 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)

switch (codec->core.vendor_id) {
case 0x10ec0255:
alc_process_coef_fw(codec, coef0255_1);
alc_process_coef_fw(codec, coef0255);
break;
case 0x10ec0256:
alc_process_coef_fw(codec, coef0256);
alc_process_coef_fw(codec, coef0255);
break;
case 0x10ec0233:
Expand Down Expand Up @@ -3896,6 +3907,12 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
WRITE_COEFEX(0x57, 0x03, 0x8ea6),
{}
};
static struct coef_fw coef0256[] = {
WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
WRITE_COEF(0x1b, 0x0c6b),
WRITE_COEFEX(0x57, 0x03, 0x8ea6),
{}
};
static struct coef_fw coef0233[] = {
WRITE_COEF(0x45, 0xd429),
WRITE_COEF(0x1b, 0x0c2b),
Expand Down Expand Up @@ -3936,9 +3953,11 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)

switch (codec->core.vendor_id) {
case 0x10ec0255:
case 0x10ec0256:
alc_process_coef_fw(codec, coef0255);
break;
case 0x10ec0256:
alc_process_coef_fw(codec, coef0256);
break;
case 0x10ec0233:
case 0x10ec0283:
alc_process_coef_fw(codec, coef0233);
Expand Down Expand Up @@ -3978,6 +3997,12 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
WRITE_COEFEX(0x57, 0x03, 0x8ea6),
{}
};
static struct coef_fw coef0256[] = {
WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
WRITE_COEF(0x1b, 0x0c6b),
WRITE_COEFEX(0x57, 0x03, 0x8ea6),
{}
};
static struct coef_fw coef0233[] = {
WRITE_COEF(0x45, 0xe429),
WRITE_COEF(0x1b, 0x0c2b),
Expand Down Expand Up @@ -4018,9 +4043,11 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)

switch (codec->core.vendor_id) {
case 0x10ec0255:
case 0x10ec0256:
alc_process_coef_fw(codec, coef0255);
break;
case 0x10ec0256:
alc_process_coef_fw(codec, coef0256);
break;
case 0x10ec0233:
case 0x10ec0283:
alc_process_coef_fw(codec, coef0233);
Expand Down Expand Up @@ -4266,15 +4293,30 @@ static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
static void alc255_set_default_jack_type(struct hda_codec *codec)
{
/* Set to iphone type */
static struct coef_fw fw[] = {
static struct coef_fw alc255fw[] = {
WRITE_COEF(0x1b, 0x880b),
WRITE_COEF(0x45, 0xd089),
WRITE_COEF(0x1b, 0x080b),
WRITE_COEF(0x46, 0x0004),
WRITE_COEF(0x1b, 0x0c0b),
{}
};
alc_process_coef_fw(codec, fw);
static struct coef_fw alc256fw[] = {
WRITE_COEF(0x1b, 0x884b),
WRITE_COEF(0x45, 0xd089),
WRITE_COEF(0x1b, 0x084b),
WRITE_COEF(0x46, 0x0004),
WRITE_COEF(0x1b, 0x0c4b),
{}
};
switch (codec->core.vendor_id) {
case 0x10ec0255:
alc_process_coef_fw(codec, alc255fw);
break;
case 0x10ec0256:
alc_process_coef_fw(codec, alc256fw);
break;
}
msleep(30);
}

Expand Down

0 comments on commit e69e7e0

Please sign in to comment.