diff options
-rw-r--r-- | drivers/mfd/madera-core.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/mfd/madera-core.c b/drivers/mfd/madera-core.c index 4ed6ad8ce002..a9c6f0833f32 100644 --- a/drivers/mfd/madera-core.c +++ b/drivers/mfd/madera-core.c @@ -291,6 +291,8 @@ static int __maybe_unused madera_runtime_resume(struct device *dev) dev_dbg(dev, "Leaving sleep mode\n"); + madera_enable_hard_reset(madera); + ret = regulator_enable(madera->dcvdd); if (ret) { dev_err(dev, "Failed to enable DCVDD: %d\n", ret); @@ -300,7 +302,19 @@ static int __maybe_unused madera_runtime_resume(struct device *dev) regcache_cache_only(madera->regmap, false); regcache_cache_only(madera->regmap_32bit, false); - usleep_range(MADERA_RESET_MIN_US, MADERA_RESET_MAX_US); + madera_disable_hard_reset(madera); + + if (!madera->pdata.reset) { + ret = madera_wait_for_boot(madera); + if (ret) + goto err; + + ret = madera_soft_reset(madera); + if (ret) { + dev_err(dev, "Failed to reset: %d\n", ret); + goto err; + } + } ret = madera_wait_for_boot(madera); if (ret) |