Skip to content

Commit 307f314

Browse files
povikbroonie
authored andcommitted
ASoC: tas2770: Insert post reset delay
Per TAS2770 datasheet there must be a 1 ms delay from reset to first command. So insert delays into the driver where appropriate. Fixes: 1a476ab ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20220204095301.5554-1-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 946eb87 commit 307f314

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sound/soc/codecs/tas2770.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ static void tas2770_reset(struct tas2770_priv *tas2770)
3838
gpiod_set_value_cansleep(tas2770->reset_gpio, 0);
3939
msleep(20);
4040
gpiod_set_value_cansleep(tas2770->reset_gpio, 1);
41+
usleep_range(1000, 2000);
4142
}
4243

4344
snd_soc_component_write(tas2770->component, TAS2770_SW_RST,
4445
TAS2770_RST);
46+
usleep_range(1000, 2000);
4547
}
4648

4749
static int tas2770_set_bias_level(struct snd_soc_component *component,
@@ -110,6 +112,7 @@ static int tas2770_codec_resume(struct snd_soc_component *component)
110112

111113
if (tas2770->sdz_gpio) {
112114
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
115+
usleep_range(1000, 2000);
113116
} else {
114117
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
115118
TAS2770_PWR_CTRL_MASK,
@@ -510,8 +513,10 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
510513

511514
tas2770->component = component;
512515

513-
if (tas2770->sdz_gpio)
516+
if (tas2770->sdz_gpio) {
514517
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
518+
usleep_range(1000, 2000);
519+
}
515520

516521
tas2770_reset(tas2770);
517522

0 commit comments

Comments
 (0)