Skip to content

Commit

Permalink
ASoC: cs42l42: Ensure a reset pulse meets minimum pulse width.
Browse files Browse the repository at this point in the history
The CS42L42 can accept very short reset pulses of a few microseconds
but there's no reason to force a very short pulse.
Allow a wide range for the usleep_range() so it can be relaxed about
the choice of timing source.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230913150012.604775-2-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Richard Fitzgerald authored and Mark Brown committed Sep 13, 2023
1 parent ec83a0b commit 41dac81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/codecs/cs42l42.c
Original file line number Diff line number Diff line change
@@ -2320,6 +2320,10 @@ int cs42l42_common_probe(struct cs42l42_private *cs42l42,

if (cs42l42->reset_gpio) {
dev_dbg(cs42l42->dev, "Found reset GPIO\n");

/* Ensure minimum reset pulse width */
usleep_range(10, 500);

gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
}
usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);

0 comments on commit 41dac81

Please sign in to comment.