Commit 1df8874b authored by Kailang Yang's avatar Kailang Yang Committed by Takashi Iwai

ALSA: hda/realtek - Update Initial AMP for EAPD control

The default EAPD control uses verb command to control EAPD. Some codec
does not have verb command for EAPD. It needs to control by hidden
register.

This update will avoid wrong behavior for some codec.  This patch will
fix double setup for EAPD.  It just needs to turn on by one site for
verb command or hidden register controlled.

Detailed changes:
- alc889_coef_init() is replaced with alc_update_coef_idx() with a
  correct COEF value.
- for ALC262, ALC887 and ALC900, the EAPD setup via the hidden
  register is removed because this rather conflicts with the EAPD verb
  setup.
-  For ALC888-VC, also the hidden register access is removed in
  alc888_coef_init().
- Remove the dead #if 0 code for ALC267/ALC268.
Signed-off-by: default avatarKailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cf51eb9d
...@@ -291,18 +291,14 @@ static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) ...@@ -291,18 +291,14 @@ static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
/* additional initialization for ALC888 variants */ /* additional initialization for ALC888 variants */
static void alc888_coef_init(struct hda_codec *codec) static void alc888_coef_init(struct hda_codec *codec)
{ {
if (alc_get_coef0(codec) == 0x20) switch (alc_get_coef0(codec) & 0x00f0) {
/* alc888S-VC */ /* alc888-VA */
alc_write_coef_idx(codec, 7, 0x830); case 0x00:
else
/* alc888-VB */ /* alc888-VB */
alc_write_coef_idx(codec, 7, 0x3030); case 0x10:
} alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
break;
/* additional initialization for ALC889 variants */ }
static void alc889_coef_init(struct hda_codec *codec)
{
alc_update_coef_idx(codec, 7, 0, 0x2010);
} }
/* turn on/off EAPD control (only if available) */ /* turn on/off EAPD control (only if available) */
...@@ -359,25 +355,15 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type) ...@@ -359,25 +355,15 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type)
case 0x10ec0260: case 0x10ec0260:
alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
break; break;
case 0x10ec0262:
case 0x10ec0880: case 0x10ec0880:
case 0x10ec0882: case 0x10ec0882:
case 0x10ec0883: case 0x10ec0883:
case 0x10ec0885: case 0x10ec0885:
case 0x10ec0887: alc_update_coef_idx(codec, 7, 0, 0x2030);
/*case 0x10ec0889:*/ /* this causes an SPDIF problem */
case 0x10ec0900:
alc889_coef_init(codec);
break; break;
case 0x10ec0888: case 0x10ec0888:
alc888_coef_init(codec); alc888_coef_init(codec);
break; break;
#if 0 /* XXX: This may cause the silent output on speaker on some machines */
case 0x10ec0267:
case 0x10ec0268:
alc_update_coef_idx(codec, 7, 0, 0x3000);
break;
#endif /* XXX */
} }
break; break;
} }
...@@ -1710,7 +1696,7 @@ static void alc889_fixup_coef(struct hda_codec *codec, ...@@ -1710,7 +1696,7 @@ static void alc889_fixup_coef(struct hda_codec *codec,
{ {
if (action != HDA_FIXUP_ACT_INIT) if (action != HDA_FIXUP_ACT_INIT)
return; return;
alc889_coef_init(codec); alc_update_coef_idx(codec, 7, 0, 0x2030);
} }
/* toggle speaker-output according to the hp-jack state */ /* toggle speaker-output according to the hp-jack state */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment