Skip to content

Commit

Permalink
ASoC: cs42l42: Always wait at least 3ms after reset
Browse files Browse the repository at this point in the history
This delay is part of the power-up sequence defined in the datasheet.
A runtime_resume is a power-up so must also include the delay.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210305173442.195740-6-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Lucas Tanure authored and Mark Brown committed Mar 8, 2021
1 parent 9ad4f9e commit ddaa9be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/codecs/cs42l42.c
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ static int cs42l42_i2c_probe(struct i2c_client *i2c_client,
dev_dbg(&i2c_client->dev, "Found reset GPIO\n");
gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
}
mdelay(3);
usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);

/* Request IRQ */
ret = devm_request_threaded_irq(&i2c_client->dev,
Expand Down Expand Up @@ -1881,6 +1881,7 @@ static int cs42l42_runtime_resume(struct device *dev)
}

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

regcache_cache_only(cs42l42->regmap, false);
regcache_sync(cs42l42->regmap);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/cs42l42.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@
#define CS42L42_FRAC2_VAL(val) (((val) & 0xff0000) >> 16)

#define CS42L42_NUM_SUPPLIES 5
#define CS42L42_BOOT_TIME_US 3000

static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = {
"VA",
Expand Down

0 comments on commit ddaa9be

Please sign in to comment.