[Bugfix][CODEC] Disable soft ramp, optimize playback 44.1k noise issue
Only Configure: No
Affected branch: master
Affected module: codec
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: Yes
Change-Id: I53ffcb208021499de3c90e843dba2dbee23ea2eb
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/es8311.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/es8311.c
index fef445f..34410ce 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/es8311.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/es8311.c
@@ -766,35 +766,38 @@
/* set iface */
snd_soc_component_write(component, ES8311_SDPOUT_REG0A, iface);
}
-/* yu.dong@20240508[ZXW-277]Modified Platform CODEC ES8311 Compatible with I2S and TDM Modes start */
-#ifdef CONFIG_USE_TOP_TDM
+/* yu.dong@20240816[ZXW-277]Disable soft ramp, optimize playback 44.1k noise issue start */
+#if defined(CONFIG_USE_TOP_TDM)
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG02, 0x1a);
#else
- snd_soc_component_write(component, ES8311_CLK_MANAGER_REG02, 0x98);
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG02, 0x98);
+#endif
snd_soc_component_write(component, ES8311_CLK_MANAGER_REG03, 0x1b);
snd_soc_component_write(component, ES8311_CLK_MANAGER_REG04, 0x1b);
- /*
+
if(rate == 8000){
- snd_soc_component_write(component, ES8311_CLK_MANAGER_REG05, 0xbb);
- pr_info("%s rate:%d\n",__FUNCTION__,rate);
-
- }
- if(rate == 16000){
- snd_soc_component_write(component, ES8311_CLK_MANAGER_REG05, 0x55);
- pr_info("%s rate:%d\n",__FUNCTION__,rate);
-
- }
- */
- if(rate == 44100){
-
- snd_soc_component_write(component, ES8311_CLK_MANAGER_REG02, 0x90);
- snd_soc_component_write(component, ES8311_CLK_MANAGER_REG03, 0x1d);
- snd_soc_component_write(component, ES8311_CLK_MANAGER_REG04, 0x1d);
- snd_soc_component_write(component, ES8311_CLK_MANAGER_REG05, 0x00);
- pr_info("%s rate:%d\n",__FUNCTION__,rate);
-
- }
+#if defined(CONFIG_USE_TOP_TDM)
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG05, 0x00);
+#else
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG05, 0xbb);
#endif
-/* yu.dong@20240508[ZXW-277]Modified Platform CODEC ES8311 Compatible with I2S and TDM Modes end */
+ pr_info("%s rate:%d\n",__FUNCTION__,rate);
+
+ }
+
+ if(rate == 16000){
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG05, 0x55);
+ pr_info("%s rate:%d\n",__FUNCTION__,rate);
+ }
+
+ if(rate == 44100){
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG02, 0x00);
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG03, 0x10);
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG04, 0x20);
+ snd_soc_component_write(component, ES8311_CLK_MANAGER_REG05, 0x00);
+ pr_info("%s rate:%d\n",__FUNCTION__,rate);
+ }
+/* yu.dong@20240816[ZXW-277]Disable soft ramp, optimize playback 44.1k noise issue end */
snd_soc_component_write(component, ES8311_CLK_MANAGER_REG06, 0x18);
snd_soc_component_write(component, ES8311_CLK_MANAGER_REG07, 0x06);
@@ -893,7 +896,7 @@
snd_soc_component_write(component, ES8311_ADC_REG15, 0x40);
snd_soc_component_write(component, ES8311_ADC_REG1B, 0x0A);
snd_soc_component_write(component, ES8311_ADC_REG1C, 0x6A);
- snd_soc_component_write(component, ES8311_DAC_REG37, 0x48);
+ snd_soc_component_write(component, ES8311_DAC_REG37, 0x08); //0 – disable soft ramp
/* yu.dong@20240718[ZXW-277]Optimizing Recording in CODEC 8311 TDM Mode start*/
#if defined(CONFIG_USE_TOP_TDM)
snd_soc_component_write(component, ES8311_CLK_MANAGER_REG01, 0x9f);