Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8509c55f authored by Qipan Li's avatar Qipan Li Committed by Mark Brown
Browse files

spi: sirf: reset SPI controller in init stage



in SPI boot mode, romcode uses SPI controller to fetch data from NOR
flash. Here we need to reset the hardware IP to restore its state.

Signed-off-by: default avatarQipan Li <Qipan.Li@csr.com>
Signed-off-by: default avatarBarry Song <Baohua.Song@csr.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fcc50e5c
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/dmaengine.h>
#include <linux/dmaengine.h>
#include <linux/dma-direction.h>
#include <linux/dma-direction.h>
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/reset.h>


#define DRIVER_NAME "sirfsoc_spi"
#define DRIVER_NAME "sirfsoc_spi"


@@ -647,6 +648,12 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
	int irq;
	int irq;
	int i, ret;
	int i, ret;


	ret = device_reset(&pdev->dev);
	if (ret) {
		dev_err(&pdev->dev, "SPI reset failed!\n");
		return ret;
	}

	master = spi_alloc_master(&pdev->dev, sizeof(*sspi));
	master = spi_alloc_master(&pdev->dev, sizeof(*sspi));
	if (!master) {
	if (!master) {
		dev_err(&pdev->dev, "Unable to allocate SPI master\n");
		dev_err(&pdev->dev, "Unable to allocate SPI master\n");