Skip to content

Commit c20504a

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 12a1a28 commit c20504a

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
@@ -165,6 +165,8 @@ static int tas2764_codec_suspend(struct snd_soc_component *component)
165165
regcache_cache_only(tas2764->regmap, true);
166166
regcache_mark_dirty(tas2764->regmap);
167167

168+
usleep_range(6000, 7000);
169+
168170
return 0;
169171
}
170172

@@ -258,10 +260,16 @@ static int tas2764_mute(struct snd_soc_dai *dai, int mute, int direction)
258260
return ret;
259261

260262
if (mute) {
263+
/* Wait for ramp-down */
264+
usleep_range(6000, 7000);
265+
261266
tas2764->dac_powered = false;
262267
ret = tas2764_update_pwr_ctrl(tas2764);
263268
if (ret)
264269
return ret;
270+
271+
/* Wait a bit after shutdown */
272+
usleep_range(2000, 3000);
265273
}
266274

267275
return 0;

0 commit comments

Comments
 (0)