diff mbox series

mmc: sdhci-of-arasan: Add shutdown callback

Message ID 20250522094932.4187301-1-alvin.paulp@amd.com
State New
Headers show
Series mmc: sdhci-of-arasan: Add shutdown callback | expand

Commit Message

Paul Alvin May 22, 2025, 9:49 a.m. UTC
Implement shutdown hook to suspend host, power off PHY if enabled and
disable all mmc clocks.

Signed-off-by: Paul Alvin <alvin.paulp@amd.com>
---
 drivers/mmc/host/sdhci-of-arasan.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 8c29676ab662..af4643e24ecc 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -2056,6 +2056,13 @@  static void sdhci_arasan_remove(struct platform_device *pdev)
 	clk_disable_unprepare(clk_ahb);
 }
 
+static void sdhci_arasan_shutdown(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+
+	sdhci_arasan_suspend(dev);
+}
+
 static struct platform_driver sdhci_arasan_driver = {
 	.driver = {
 		.name = "sdhci-arasan",
@@ -2065,6 +2072,7 @@  static struct platform_driver sdhci_arasan_driver = {
 	},
 	.probe = sdhci_arasan_probe,
 	.remove = sdhci_arasan_remove,
+	.shutdown = sdhci_arasan_shutdown,
 };
 
 module_platform_driver(sdhci_arasan_driver);