Skip to content

Commit cd10bb8

Browse files
povikbroonie
authored andcommitted
ASoC: tas2764: Add post reset delays
Make sure there is at least 1 ms delay from reset to first command as is specified in the datasheet. This is a fix similar to commit 307f314 ("ASoC: tas2770: Insert post reset delay"). Fixes: 827ed8a ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220630075135.2221-1-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 94c65df commit cd10bb8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

sound/soc/codecs/tas2764.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ static void tas2764_reset(struct tas2764_priv *tas2764)
4242
gpiod_set_value_cansleep(tas2764->reset_gpio, 0);
4343
msleep(20);
4444
gpiod_set_value_cansleep(tas2764->reset_gpio, 1);
45+
usleep_range(1000, 2000);
4546
}
4647

4748
snd_soc_component_write(tas2764->component, TAS2764_SW_RST,
4849
TAS2764_RST);
50+
usleep_range(1000, 2000);
4951
}
5052

5153
static int tas2764_set_bias_level(struct snd_soc_component *component,
@@ -107,8 +109,10 @@ static int tas2764_codec_resume(struct snd_soc_component *component)
107109
struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component);
108110
int ret;
109111

110-
if (tas2764->sdz_gpio)
112+
if (tas2764->sdz_gpio) {
111113
gpiod_set_value_cansleep(tas2764->sdz_gpio, 1);
114+
usleep_range(1000, 2000);
115+
}
112116

113117
ret = snd_soc_component_update_bits(component, TAS2764_PWR_CTRL,
114118
TAS2764_PWR_CTRL_MASK,
@@ -501,8 +505,10 @@ static int tas2764_codec_probe(struct snd_soc_component *component)
501505

502506
tas2764->component = component;
503507

504-
if (tas2764->sdz_gpio)
508+
if (tas2764->sdz_gpio) {
505509
gpiod_set_value_cansleep(tas2764->sdz_gpio, 1);
510+
usleep_range(1000, 2000);
511+
}
506512

507513
tas2764_reset(tas2764);
508514

0 commit comments

Comments
 (0)