]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ALSA: hda/realtek - Update Initial AMP for EAPD control
authorKailang Yang <kailang@realtek.com>
Wed, 29 Oct 2014 08:10:13 +0000 (16:10 +0800)
committerTakashi Iwai <tiwai@suse.de>
Thu, 30 Oct 2014 08:01:17 +0000 (09:01 +0100)
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: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index 22d9d2104e9944cc7b8179f9bc5afd70998d7856..ba72fffa74609182e1a097b92993f69c830d67f1 100644 (file)
@@ -291,18 +291,14 @@ static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
 /* additional initialization for ALC888 variants */
 static void alc888_coef_init(struct hda_codec *codec)
 {
-       if (alc_get_coef0(codec) == 0x20)
-               /* alc888S-VC */
-               alc_write_coef_idx(codec, 7, 0x830);
-        else
-                /* alc888-VB */
-               alc_write_coef_idx(codec, 7, 0x3030);
-}
-
-/* additional initialization for ALC889 variants */
-static void alc889_coef_init(struct hda_codec *codec)
-{
-       alc_update_coef_idx(codec, 7, 0, 0x2010);
+       switch (alc_get_coef0(codec) & 0x00f0) {
+       /* alc888-VA */
+       case 0x00:
+       /* alc888-VB */
+       case 0x10:
+               alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
+               break;
+       }
 }
 
 /* turn on/off EAPD control (only if available) */
@@ -359,25 +355,15 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type)
                case 0x10ec0260:
                        alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
                        break;
-               case 0x10ec0262:
                case 0x10ec0880:
                case 0x10ec0882:
                case 0x10ec0883:
                case 0x10ec0885:
-               case 0x10ec0887:
-               /*case 0x10ec0889:*/ /* this causes an SPDIF problem */
-               case 0x10ec0900:
-                       alc889_coef_init(codec);
+                       alc_update_coef_idx(codec, 7, 0, 0x2030);
                        break;
                case 0x10ec0888:
                        alc888_coef_init(codec);
                        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;
        }
@@ -1710,7 +1696,7 @@ static void alc889_fixup_coef(struct hda_codec *codec,
 {
        if (action != HDA_FIXUP_ACT_INIT)
                return;
-       alc889_coef_init(codec);
+       alc_update_coef_idx(codec, 7, 0, 0x2030);
 }
 
 /* toggle speaker-output according to the hp-jack state */