ASoC: codecs: rk3506: set AUDIO_ADC_PGA0 to get better THD performance

Before: THD is -91.34dB.
After: THD is -103.13dB.

Change-Id: Ieaf326326a36ca320effcd924825dce33c5775fc
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
Jason Zhu
2024-07-23 11:44:59 +08:00
parent 7ac61bc898
commit 69adc7f1a9
2 changed files with 5 additions and 0 deletions

View File

@@ -164,6 +164,9 @@ static int rk3506_codec_reset(struct snd_soc_component *component)
snd_soc_component_update_bits(component, AUDIO_ADC_PGA2,
PGA_BUF_IB_SEL_MSK | PGA_BUF_CHOP_SEL_MSK,
PGA_BUF_IB_SEL_167_PCT | PGA_BUF_CHOP_SEL_400K);
snd_soc_component_update_bits(component, AUDIO_ADC_PGA0,
PGA_INPUT_DEC_MSK | PGA_GAIN_MASK,
PGA_INPUT_DEC_N4_34DB | PGA_GAIN_3DB);
clk_disable_unprepare(rk3506->pclk);

View File

@@ -153,6 +153,8 @@
#define PGA_INPUT_DEC_N7_34DB (0x2 << 1)
#define PGA_INPUT_DEC_N10_34DB (0x3 << 1)
#define PGA_GAIN_SHIFT (0x3)
#define PGA_GAIN_MASK (0x1f << PGA_GAIN_SHIFT)
#define PGA_GAIN_3DB (0x10 << PGA_GAIN_SHIFT)
#define PGA_GAIN_MIN (0x0)
#define PGA_GAIN_MAX (0x1f)