Skip to content

Commit 728815e

Browse files
Danny Smithbroonie
authored andcommitted
ASoC: adau17x1: Do not reload dsp-fw if samplerate has not changed
Reloading fw causes an audiable popping sound, we can avoid this by not reloading if the samplerate is the same as before. Signed-off-by: Danny Smith <dannys@axis.com> Signed-off-by: Robert Rosengren <robert.rosengren@axis.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 953de78 commit 728815e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎sound/soc/codecs/adau17x1.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,15 @@ int adau17x1_setup_firmware(struct snd_soc_component *component,
843843
struct adau *adau = snd_soc_component_get_drvdata(component);
844844
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
845845

846+
/* Check if sample rate is the same as before. If it is there is no
847+
* point in performing the below steps as the call to
848+
* sigmadsp_setup(...) will return directly when it finds the sample
849+
* rate to be the same as before. By checking this we can prevent an
850+
* audiable popping noise which occours when toggling DSP_RUN.
851+
*/
852+
if (adau->sigmadsp->current_samplerate == rate)
853+
return 0;
854+
846855
snd_soc_dapm_mutex_lock(dapm);
847856

848857
ret = regmap_read(adau->regmap, ADAU17X1_DSP_SAMPLING_RATE, &dspsr);

0 commit comments

Comments
 (0)