public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: madera: Increase wait for silicon reset
@ 2018-10-01 14:33 Richard Fitzgerald
  2018-10-01 14:33 ` [PATCH 2/2] mfd: madera: Wait for BOOT_DONE before reading device ID Richard Fitzgerald
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Fitzgerald @ 2018-10-01 14:33 UTC (permalink / raw)
  To: lee.jones; +Cc: patches, linux-kernel, Richard Fitzgerald

Based on latest silicon validation we should allow at least
2 milliseconds after DCVDD enable or hard reset released before
trying to communicate with the silicon.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 drivers/mfd/madera-core.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/madera-core.c b/drivers/mfd/madera-core.c
index 440030cecbbd..3ff9a0615658 100644
--- a/drivers/mfd/madera-core.c
+++ b/drivers/mfd/madera-core.c
@@ -135,6 +135,15 @@ EXPORT_SYMBOL_GPL(madera_name_from_type);
 #define MADERA_BOOT_POLL_INTERVAL_USEC		5000
 #define MADERA_BOOT_POLL_TIMEOUT_USEC		25000
 
+static void madera_por_delay(void)
+{
+	/*
+	 * After DCVDD enable or hard reset released wait for internal
+	 * POR (power-on-reset) before trying to communicate with the silicon
+	 */
+	usleep_range(2000, 3000);
+}
+
 static int madera_wait_for_boot(struct madera *madera)
 {
 	ktime_t timeout;
@@ -209,7 +218,7 @@ static void madera_disable_hard_reset(struct madera *madera)
 		return;
 
 	gpiod_set_raw_value_cansleep(madera->pdata.reset, 1);
-	usleep_range(1000, 2000);
+	madera_por_delay();
 }
 
 static int __maybe_unused madera_runtime_resume(struct device *dev)
@@ -225,6 +234,7 @@ static int __maybe_unused madera_runtime_resume(struct device *dev)
 		return ret;
 	}
 
+	madera_por_delay();
 	regcache_cache_only(madera->regmap, false);
 	regcache_cache_only(madera->regmap_32bit, false);
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-02  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-01 14:33 [PATCH 1/2] mfd: madera: Increase wait for silicon reset Richard Fitzgerald
2018-10-01 14:33 ` [PATCH 2/2] mfd: madera: Wait for BOOT_DONE before reading device ID Richard Fitzgerald
2018-10-02  8:52   ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox