Commit 16337e02 authored by Daniel J Blueman's avatar Daniel J Blueman Committed by Takashi Iwai

ALSA: HDA: Fix digital microphone on CS420x

Correctly enable the digital microphones with the right bits in the
right coeffecient registers on Cirrus CS4206/7 codecs. It also
prevents misconfiguring ADC1/2.

This fixes the digital mic on the Macbook Pro 10,1/Retina.
Based-on-patch-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: default avatarDaniel J Blueman <daniel@quora.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5a83b4b5
...@@ -101,8 +101,8 @@ enum { ...@@ -101,8 +101,8 @@ enum {
#define CS420X_VENDOR_NID 0x11 #define CS420X_VENDOR_NID 0x11
#define CS_DIG_OUT1_PIN_NID 0x10 #define CS_DIG_OUT1_PIN_NID 0x10
#define CS_DIG_OUT2_PIN_NID 0x15 #define CS_DIG_OUT2_PIN_NID 0x15
#define CS_DMIC1_PIN_NID 0x12 #define CS_DMIC1_PIN_NID 0x0e
#define CS_DMIC2_PIN_NID 0x0e #define CS_DMIC2_PIN_NID 0x12
/* coef indices */ /* coef indices */
#define IDX_SPDIF_STAT 0x0000 #define IDX_SPDIF_STAT 0x0000
...@@ -1079,14 +1079,18 @@ static void init_input(struct hda_codec *codec) ...@@ -1079,14 +1079,18 @@ static void init_input(struct hda_codec *codec)
cs_automic(codec, NULL); cs_automic(codec, NULL);
coef = 0x000a; /* ADC1/2 - Digital and Analog Soft Ramp */ coef = 0x000a; /* ADC1/2 - Digital and Analog Soft Ramp */
cs_vendor_coef_set(codec, IDX_ADC_CFG, coef);
coef = cs_vendor_coef_get(codec, IDX_BEEP_CFG);
if (is_active_pin(codec, CS_DMIC2_PIN_NID)) if (is_active_pin(codec, CS_DMIC2_PIN_NID))
coef |= 0x0500; /* DMIC2 2 chan on, GPIO1 off */ coef |= 1 << 4; /* DMIC2 2 chan on, GPIO1 off */
if (is_active_pin(codec, CS_DMIC1_PIN_NID)) if (is_active_pin(codec, CS_DMIC1_PIN_NID))
coef |= 0x1800; /* DMIC1 2 chan on, GPIO0 off coef |= 1 << 3; /* DMIC1 2 chan on, GPIO0 off
* No effect if SPDIF_OUT2 is * No effect if SPDIF_OUT2 is
* selected in IDX_SPDIF_CTL. * selected in IDX_SPDIF_CTL.
*/ */
cs_vendor_coef_set(codec, IDX_ADC_CFG, coef);
cs_vendor_coef_set(codec, IDX_BEEP_CFG, coef);
} else { } else {
if (spec->mic_detect) if (spec->mic_detect)
cs_automic(codec, NULL); cs_automic(codec, NULL);
......
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