Skip to content

Commit ec96690

Browse files
miquelraynalbroonie
authored andcommitted
ASoC: tlv320aic32x4: Enable fast charge
At power-up the analog circuits may take up to one full second before being charged with the default configuration. Using the analog blocks before they are ready generates a *very* crappy sound. Enable the fast charge feature, which will require a bit more power than normal charge but will definitely speed up the starting operation by shrinking this delay to up to 40 ms. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20200911173140.29984-4-miquel.raynal@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 40b3713 commit ec96690

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

sound/soc/codecs/tlv320aic32x4.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,14 @@ static int aic32x4_component_probe(struct snd_soc_component *component)
10131013
AIC32X4_LADC_EN | AIC32X4_RADC_EN);
10141014
snd_soc_component_write(component, AIC32X4_ADCSETUP, tmp_reg);
10151015

1016+
/*
1017+
* Enable the fast charging feature and ensure the needed 40ms ellapsed
1018+
* before using the analog circuits.
1019+
*/
1020+
snd_soc_component_write(component, AIC32X4_REFPOWERUP,
1021+
AIC32X4_REFPOWERUP_40MS);
1022+
msleep(40);
1023+
10161024
return 0;
10171025
}
10181026

sound/soc/codecs/tlv320aic32x4.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ int aic32x4_register_clocks(struct device *dev, const char *mclk_name);
9696
#define AIC32X4_FLOATINGINPUT AIC32X4_REG(1, 58)
9797
#define AIC32X4_LMICPGAVOL AIC32X4_REG(1, 59)
9898
#define AIC32X4_RMICPGAVOL AIC32X4_REG(1, 60)
99+
#define AIC32X4_REFPOWERUP AIC32X4_REG(1, 123)
99100

100101
/* Bits, masks, and shifts */
101102

@@ -205,6 +206,12 @@ int aic32x4_register_clocks(struct device *dev, const char *mclk_name);
205206
#define AIC32X4_RMICPGANIN_IN1L_10K 0x10
206207
#define AIC32X4_RMICPGANIN_CM1R_10K 0x40
207208

209+
/* AIC32X4_REFPOWERUP */
210+
#define AIC32X4_REFPOWERUP_SLOW 0x04
211+
#define AIC32X4_REFPOWERUP_40MS 0x05
212+
#define AIC32X4_REFPOWERUP_80MS 0x06
213+
#define AIC32X4_REFPOWERUP_120MS 0x07
214+
208215
/* Common mask and enable for all of the dividers */
209216
#define AIC32X4_DIVEN BIT(7)
210217
#define AIC32X4_DIV_MASK GENMASK(6, 0)

0 commit comments

Comments
 (0)