linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: dw: assert reset before deasserting reset
@ 2022-03-01 11:17 Niklas Cassel
  2022-03-11 14:25 ` Serge Semin
  0 siblings, 1 reply; 9+ messages in thread
From: Niklas Cassel @ 2022-03-01 11:17 UTC (permalink / raw)
  To: Serge Semin, Mark Brown, Philipp Zabel; +Cc: Niklas Cassel, linux-spi

From: Niklas Cassel <niklas.cassel@wdc.com>

Simply deasserting reset just ensures that the hardware is taken out of
reset, if it was booted with the hardware reset asserted.

In order actually reset the SPI controller, we need to assert reset before
deasserting.

By doing this, we ensure that the hardware is not in some bad state, and we
ensure that the hardware registers get set to their reset default, clearing
any setting set by e.g. a bootloader.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
---
 drivers/spi/spi-dw-mmio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 5101c4c6017b..eb1dacb45ca2 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -289,6 +289,8 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 		ret = PTR_ERR(dwsmmio->rstc);
 		goto out_clk;
 	}
+	reset_control_assert(dwsmmio->rstc);
+	udelay(2);
 	reset_control_deassert(dwsmmio->rstc);
 
 	dws->bus_num = pdev->id;
-- 
2.35.1

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

end of thread, other threads:[~2022-03-22 11:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 11:17 [PATCH] spi: dw: assert reset before deasserting reset Niklas Cassel
2022-03-11 14:25 ` Serge Semin
2022-03-11 15:51   ` Niklas Cassel
2022-03-11 16:06     ` Mark Brown
2022-03-11 17:05     ` Serge Semin
2022-03-16 14:11       ` Niklas Cassel
2022-03-17 10:17         ` Philipp Zabel
2022-03-22 10:32           ` Niklas Cassel
2022-03-22 11:08             ` Philipp Zabel

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).