linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] spi: imx: mx51-ecspi: Fix CONFIGREG delay comment
@ 2021-07-27 16:04 Marek Vasut
  2021-07-28  8:37 ` Uwe Kleine-König
  2021-07-28 23:27 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2021-07-27 16:04 UTC (permalink / raw)
  To: linux-spi; +Cc: Marek Vasut, Uwe Kleine-König, Mark Brown

For (2 * 1000000) / min_speed_hz < 10 to be true in naturals with zero,
the min_speed_hz must be above 200000 (i.e. 200001 rounds down to 9, so
the condition triggers). Update the comment. No functional change.

Fixes: 6fd8b8503a0dc ("spi: spi-imx: Fix out-of-order CS/SCLK operation at low speeds")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Mark Brown <broonie@kernel.org>
---
V2: It is not 100 kHz, 181 kHz, 222 kHz, it is 200 kHz. Make it so.
---
 drivers/spi/spi-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 75a82d6cac785..e3231b501ae06 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -598,7 +598,7 @@ static int mx51_ecspi_prepare_message(struct spi_imx_data *spi_imx,
 	}
 
 	delay = (2 * 1000000) / min_speed_hz;
-	if (likely(delay < 10))	/* SCLK is faster than 100 kHz */
+	if (likely(delay < 10))	/* SCLK is faster than 200 kHz */
 		udelay(delay);
 	else			/* SCLK is _very_ slow */
 		usleep_range(delay, delay + 10);
-- 
2.30.2


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

end of thread, other threads:[~2021-07-28 23:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-27 16:04 [PATCH V2] spi: imx: mx51-ecspi: Fix CONFIGREG delay comment Marek Vasut
2021-07-28  8:37 ` Uwe Kleine-König
2021-07-28 23:27 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).