Commit 118eb0e5 authored by Florian Fainelli's avatar Florian Fainelli Committed by Mark Brown

spi: bcm2835: Implement shutdown callback

Make sure we clear the FIFOs, stop the block, disable the clock and
release the DMA channel.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20200528190605.24850-1-f.fainelli@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b7d73cb6
...@@ -1391,6 +1391,15 @@ static int bcm2835_spi_remove(struct platform_device *pdev) ...@@ -1391,6 +1391,15 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
return 0; return 0;
} }
static void bcm2835_spi_shutdown(struct platform_device *pdev)
{
int ret;
ret = bcm2835_spi_remove(pdev);
if (ret)
dev_err(&pdev->dev, "failed to shutdown\n");
}
static const struct of_device_id bcm2835_spi_match[] = { static const struct of_device_id bcm2835_spi_match[] = {
{ .compatible = "brcm,bcm2835-spi", }, { .compatible = "brcm,bcm2835-spi", },
{} {}
...@@ -1404,6 +1413,7 @@ static struct platform_driver bcm2835_spi_driver = { ...@@ -1404,6 +1413,7 @@ static struct platform_driver bcm2835_spi_driver = {
}, },
.probe = bcm2835_spi_probe, .probe = bcm2835_spi_probe,
.remove = bcm2835_spi_remove, .remove = bcm2835_spi_remove,
.shutdown = bcm2835_spi_shutdown,
}; };
module_platform_driver(bcm2835_spi_driver); module_platform_driver(bcm2835_spi_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment