|
@@ -477,11 +477,31 @@ static int altr_sdram_remove(struct platform_device *pdev)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * If you want to suspend, need to disable EDAC by removing it
|
|
|
+ * from the device tree or defconfig.
|
|
|
+ */
|
|
|
+#ifdef CONFIG_PM
|
|
|
+static int altr_sdram_prepare(struct device *dev)
|
|
|
+{
|
|
|
+ pr_err("Suspend not allowed when EDAC is enabled.\n");
|
|
|
+
|
|
|
+ return -EPERM;
|
|
|
+}
|
|
|
+
|
|
|
+static const struct dev_pm_ops altr_sdram_pm_ops = {
|
|
|
+ .prepare = altr_sdram_prepare,
|
|
|
+};
|
|
|
+#endif
|
|
|
+
|
|
|
static struct platform_driver altr_sdram_edac_driver = {
|
|
|
.probe = altr_sdram_probe,
|
|
|
.remove = altr_sdram_remove,
|
|
|
.driver = {
|
|
|
.name = "altr_sdram_edac",
|
|
|
+#ifdef CONFIG_PM
|
|
|
+ .pm = &altr_sdram_pm_ops,
|
|
|
+#endif
|
|
|
.of_match_table = altr_sdram_ctrl_of_match,
|
|
|
},
|
|
|
};
|