Skip to content

Commit 40ef1f9

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 445a093 commit 40ef1f9

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

167+
usleep_range(6000, 7000);
168+
167169
return 0;
168170
}
169171

@@ -257,10 +259,16 @@ static int tas2764_mute(struct snd_soc_dai *dai, int mute, int direction)
257259
return ret;
258260

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

266274
return 0;

0 commit comments

Comments
 (0)