Skip to content

Commit 118eb0e

Browse files
ffainellibroonie
authored andcommitted
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: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b7d73cb commit 118eb0e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/spi/spi-bcm2835.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,15 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
13911391
return 0;
13921392
}
13931393

1394+
static void bcm2835_spi_shutdown(struct platform_device *pdev)
1395+
{
1396+
int ret;
1397+
1398+
ret = bcm2835_spi_remove(pdev);
1399+
if (ret)
1400+
dev_err(&pdev->dev, "failed to shutdown\n");
1401+
}
1402+
13941403
static const struct of_device_id bcm2835_spi_match[] = {
13951404
{ .compatible = "brcm,bcm2835-spi", },
13961405
{}
@@ -1404,6 +1413,7 @@ static struct platform_driver bcm2835_spi_driver = {
14041413
},
14051414
.probe = bcm2835_spi_probe,
14061415
.remove = bcm2835_spi_remove,
1416+
.shutdown = bcm2835_spi_shutdown,
14071417
};
14081418
module_platform_driver(bcm2835_spi_driver);
14091419

0 commit comments

Comments
 (0)