History

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 307f31452078 ("ASoC: tas2770: Insert post reset delay").

Martin Povišer committed 4 years ago

Commit cd10bb81 parent 94c65df1 file · +8 −2Browse files

Unified · Split

sound/soc/codecs/tas2764.c+8−2
@@ -42,10 +42,12 @@ static void tas2764_reset(struct tas2764_priv *tas2764) · 41 unmodified lines
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) · 55 unmodified lines
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) · 386 unmodified lines
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