Skip to content

Commit aea50cd

Browse files
marcanjannau
authored andcommitted
ASoC: tas2764: Wait for ramp-down after shutdown
When we shut down the amp, we need to wait for the built-in ramp-down before we can remove the TDM clocks. There is no documented status regiter to poll, so the best we can do is a delay. Datasheet says 5.9ms for ramp-down and 1.5ms between shutdown and next startup, so let's do 6ms after mute and 2ms after shutdown. That gives us a cumulative 8ms for ramp-down and guaratees the required minimum shutdown time. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent f12642e commit aea50cd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

sound/soc/codecs/tas2764.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ static int tas2764_codec_suspend(struct snd_soc_component *component)
163163
regcache_cache_only(tas2764->regmap, true);
164164
regcache_mark_dirty(tas2764->regmap);
165165

166+
usleep_range(6000, 7000);
167+
166168
return 0;
167169
}
168170

@@ -256,10 +258,16 @@ static int tas2764_mute(struct snd_soc_dai *dai, int mute, int direction)
256258
return ret;
257259

258260
if (mute) {
261+
/* Wait for ramp-down */
262+
usleep_range(6000, 7000);
263+
259264
tas2764->dac_powered = false;
260265
ret = tas2764_update_pwr_ctrl(tas2764);
261266
if (ret)
262267
return ret;
268+
269+
/* Wait a bit after shutdown */
270+
usleep_range(2000, 3000);
263271
}
264272

265273
return 0;

0 commit comments

Comments
 (0)