From: Qipan Li Date: Thu, 20 Nov 2014 14:33:07 +0000 (+0800) Subject: spi: sirf: reset SPI controller in init stage X-Git-Tag: firefly_0821_release~176^2~2723^2~1^6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8509c55fcb5192b7f70ec596a8752c2ec39942e3;p=firefly-linux-kernel-4.4.55.git 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: Qipan Li Signed-off-by: Barry Song Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index bf3c6bc77530..0a96a65f580f 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -23,6 +23,7 @@ #include #include #include +#include #define DRIVER_NAME "sirfsoc_spi" @@ -647,6 +648,12 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) int irq; 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)); if (!master) { dev_err(&pdev->dev, "Unable to allocate SPI master\n");