Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lategoodbye/7e360eab2f134b7e5d1ff56d91296697 to your computer and use it in GitHub Desktop.
Save lategoodbye/7e360eab2f134b7e5d1ff56d91296697 to your computer and use it in GitHub Desktop.
HACK: firmware: raspberrypi: Prevent suspend to idle
From 5b1e5b66ec4f1e53d0abe6ca44e6f79499bfd855 Mon Sep 17 00:00:00 2001
From: Stefan Wahren <[email protected]>
Date: Sun, 8 Sep 2024 19:08:30 +0200
Subject: [PATCH] HACK: firmware: raspberrypi: Prevent suspend to idle
This ugly hack prevents suspend to idle on all Raspberry Pi
boards. This might be a temporary solutions for distributions
which needs to enable suspend to idle in general, but prevent
it for the Raspberry Pi which doesn't support it yet.
Signed-off-by: Stefan Wahren <[email protected]>
---
drivers/firmware/raspberrypi.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
index 18cc34987108..d0569658af88 100644
--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -399,10 +399,24 @@ struct rpi_firmware *devm_rpi_firmware_get(struct device *dev,
}
EXPORT_SYMBOL_GPL(devm_rpi_firmware_get);
+static int rpi_firmware_suspend(struct device *dev)
+{
+ return -EOPNOTSUPP;
+}
+
+static int rpi_firmware_resume(struct device *dev)
+{
+ return -EOPNOTSUPP;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(rpi_firmware_dev_pm_ops, rpi_firmware_suspend,
+ rpi_firmware_resume);
+
static struct platform_driver rpi_firmware_driver = {
.driver = {
.name = "raspberrypi-firmware",
.of_match_table = rpi_firmware_of_match,
+ .pm = pm_ptr(&rpi_firmware_dev_pm_ops),
},
.probe = rpi_firmware_probe,
.shutdown = rpi_firmware_shutdown,
--
2.34.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment