diff options
author | Irina Patru <ioana-irina.patru@nxp.com> | 2019-07-10 11:13:28 +0000 |
---|---|---|
committer | Viorel Suman <viorel.suman@nxp.com> | 2019-07-11 11:37:43 +0300 |
commit | 4528b9d31a5c6245643aba787e59cf0416867af8 (patch) | |
tree | 2b78ec08c522f00eb50432eecc8da990a72a8bb3 /sound | |
parent | 90f40d4d891cc7b321a52bd99b2ff4fe1c98cb93 (diff) |
MLK-22247 sound: asoc: change micfil default settings
Previous default settings resulted in loose dynamic
range and low sound level.
New default configuration changes:
- outgain = 2
- quality mode = VLQ0
- dc remover = bypass
Signed-off-by: Irina Patru <ioana-irina.patru@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit b7c20c96fb132f8d8e216ce570df82b0ddb24de3)
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/fsl_micfil.c | 25 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_micfil.h | 4 |
2 files changed, 23 insertions, 6 deletions
diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 6e78191046bc..ac3bcd11ce7f 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -1730,19 +1730,32 @@ static int fsl_micfil_dai_probe(struct snd_soc_dai *cpu_dai) int ret; int i; - /* set qsel to medium */ + /* set qsel to very low quality 0 */ ret = regmap_update_bits(micfil->regmap, REG_MICFIL_CTRL2, - MICFIL_CTRL2_QSEL_MASK, MICFIL_MEDIUM_QUALITY); + MICFIL_CTRL2_QSEL_MASK, MICFIL_VLOW0_QUALITY); if (ret) { dev_err(dev, "failed to set quality mode bits, reg 0x%X\n", REG_MICFIL_CTRL2); return ret; } - /* set default gain to max_gain */ - regmap_write(micfil->regmap, REG_MICFIL_OUT_CTRL, 0x77777777); - for (i = 0; i < 8; i++) - micfil->channel_gain[i] = 0xF; + /* set default gain to 2 */ + regmap_write(micfil->regmap, REG_MICFIL_OUT_CTRL, 0x22222222); + for (i = 0; i < MICFIL_OUTPUT_CHANNELS; i++) + micfil->channel_gain[i] = 0xA; + + /* set DC Remover in bypass mode*/ + val = 0; + for (i = 0; i < MICFIL_OUTPUT_CHANNELS; i++) + val |= MICFIL_DC_MODE(MICFIL_DC_BYPASS, i); + ret = regmap_update_bits(micfil->regmap, REG_MICFIL_DC_CTRL, + MICFIL_DC_CTRL_MASK, val); + if (ret) { + dev_err(dev, "failed to set DC Remover mode bits, reg 0x%X\n", + REG_MICFIL_DC_CTRL); + return ret; + } + micfil->dc_remover = MICFIL_DC_BYPASS; snd_soc_dai_init_dma_data(cpu_dai, NULL, &micfil->dma_params_rx); diff --git a/sound/soc/fsl/fsl_micfil.h b/sound/soc/fsl/fsl_micfil.h index 64c25f71646a..28d585f5fb64 100644 --- a/sound/soc/fsl/fsl_micfil.h +++ b/sound/soc/fsl/fsl_micfil.h @@ -287,6 +287,10 @@ << MICFIL_DC_CHX_SHIFT(v)) #define MICFIL_DC_MODE(v1, v2) (((v1) << MICFIL_DC_CHX_SHIFT(v2)) \ & MICFIL_DC_CHX_MASK(v2)) +#define MICFIL_DC_CUTOFF_21HZ 0 +#define MICFIL_DC_CUTOFF_83HZ 1 +#define MICFIL_DC_CUTOFF_152Hz 2 +#define MICFIL_DC_BYPASS 3 /* MICFIL Output Control Register */ #define MICFIL_OUTGAIN_CHX_SHIFT(v) (4 * (v)) |