Skip to contentSkip to conversation

hda: Cirrus: fixes for CS4207 coef setup

PATCH New Alexander Stein 2 participants 4 messages Nov 1, 2012 – Nov 2, 2012 Sound

lore
Share & tools
lore
#0 lore raw

Hi,

I'm noticing some problems using the CS4207 codec with out custom board. Output works fine so far, but I noticed that input on ADC1 (blue) is just mono and input on ADC2 (pink) is reversed stereo. Both tests were done by playing a wav on an output and directly feeding the input. After some investigations, I found out, that coef in the patch_cirrus driver don't match the CS4207 datasheet (CS4207-F4). As the driver also mentions CS4206 I'm aware that my pathces might not be suitable in general, but I couldn't find any datasheet for CS4206 so I can't compare the coef settings.
Summarized here:
* The beep bits were written to the wrong index (See CS4207-F4 6.15.6.5 BeepConfiguration(CIR=0004h))
* The DMIC enable signals were written to the wrong index (Same chapter as above)
As the drivers sets 2 DMIC bits each, while CS4207 has only 1 for each, the coef interface might be different on both codec.

Maybe someone with more detailed knowledge about the CS4206 can put his comments.

Best regards,
Alexander

#1 lore raw

PATCH 1/2 hda: Cirrus: Fix coefficient index for beep configuration

---
 sound/pci/hda/patch_cirrus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/pci/hda/patch_cirrus.c +1 -1
index 61a7113..3b7d67a 100644
@@ -1107,7 +1107,7 @@ static const struct hda_verb cs_coef_init_verbs[] = {
 	  | 0x0400 /* Disable Coefficient Auto increment */
 	  )},
 	/* Beep */
-	{0x11, AC_VERB_SET_COEF_INDEX, IDX_DAC_CFG},
+	{0x11, AC_VERB_SET_COEF_INDEX, IDX_BEEP_CFG},
 	{0x11, AC_VERB_SET_PROC_COEF, 0x0007}, /* Enable Beep thru DAC1/2/3 */
 
 	{} /* terminator */
Signature · 1 line
1.7.8.6
#2 lore raw

PATCH 2/2 hda: Cirrus: Fix wrong ADC config

In reply to Alexander Stein

Both ADCs were configured wrongly due to the DMIC setting bits written to the wrong index. Fix it according to CS4207-F4 datasheet.

---
 sound/pci/hda/patch_cirrus.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
sound/pci/hda/patch_cirrus.c +6 -3
index 3b7d67a..e18117c 100644
@@ -1079,14 +1079,17 @@ static void init_input(struct hda_codec *codec)
 			cs_automic(codec, NULL);
 
 		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))
-			coef |= 0x0500; /* DMIC2 2 chan on, GPIO1 off */
+			coef |= 0x1000; /* DMIC2 2 chan on, GPIO1 off */
 		if (is_active_pin(codec, CS_DMIC1_PIN_NID))
-			coef |= 0x1800; /* DMIC1 2 chan on, GPIO0 off
+			coef |= 0x0800; /* DMIC1 2 chan on, GPIO0 off
 					 * No effect if SPDIF_OUT2 is
 					 * selected in IDX_SPDIF_CTL.
 					*/
-		cs_vendor_coef_set(codec, IDX_ADC_CFG, coef);
+		cs_vendor_coef_set(codec, IDX_BEEP_CFG, coef);
 	} else {
 		if (spec->mic_detect)
 			cs_automic(codec, NULL);
Signature · 1 line
1.7.8.6
#3 lore raw
In reply to Alexander Stein

At Thu, 1 Nov 2012 13:42:36 +0100,

Quoted 19 lines · Alexander Stein

Hi,

I'm noticing some problems using the CS4207 codec with out custom board. Output works fine so far, but I noticed that input on ADC1 (blue) is just mono and input on ADC2 (pink) is reversed stereo. Both tests were done by playing a wav on an output and directly feeding the input. After some investigations, I found out, that coef in the patch_cirrus driver don't match the CS4207 datasheet (CS4207-F4). As the driver also mentions CS4206 I'm aware that my pathces might not be suitable in general, but I couldn't find any datasheet for CS4206 so I can't compare the coef settings.
Summarized here:
* The beep bits were written to the wrong index (See CS4207-F4 6.15.6.5 BeepConfiguration(CIR=0004h))
* The DMIC enable signals were written to the wrong index (Same chapter as above)
As the drivers sets 2 DMIC bits each, while CS4207 has only 1 for each, the coef interface might be different on both codec.

Quoted 2 lines

Maybe someone with more detailed knowledge about the CS4206 can put his comments.

Thanks for the patch. I'll take a look at these in the next week and queue as 3.7 fixes if they are OK (I suppose so, judging through a quick glance).

Takashi