[PATCH] spi: dw: assert reset before deasserting reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Niklas Cassel <niklas.cassel@xxxxxxx>

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@xxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux