summaryrefslogtreecommitdiff
authorTao Zeng <tao.zeng@amlogic.com>2015-04-15 10:04:08 (GMT)
committer tao.dong <tao.dong@amlogic.com>2015-04-17 02:54:39 (GMT)
commitd523a15ca70dc5b10c490161019a987aa299385c (patch)
tree3cfddb49f2892abe4a5612bd2f95fe5eaa2bbdab
parentf4fe0e805aaf7207760ed5b5fe53805b729e31da (diff)
downloadthermal-d523a15ca70dc5b10c490161019a987aa299385c.zip
thermal-d523a15ca70dc5b10c490161019a987aa299385c.tar.gz
thermal-d523a15ca70dc5b10c490161019a987aa299385c.tar.bz2
PD #96512: Add hibernate support for thermal
Change-Id: I4437665e60097f8195353fbcdc503ff6220b462b
Diffstat
-rwxr-xr-xamlogic_thermal_module.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/amlogic_thermal_module.c b/amlogic_thermal_module.c
index 8bbc63e..39942db 100755
--- a/amlogic_thermal_module.c
+++ b/amlogic_thermal_module.c
@@ -1021,6 +1021,31 @@ static const struct of_device_id amlogic_thermal_match[] = {
},
};
+#ifdef CONFIG_HIBERNATION
+static int amlogic_thermal_freeze(struct device *dev)
+{
+ return 0;
+}
+
+static int amlogic_thermal_thaw(struct device *dev)
+{
+ return 0;
+}
+
+static int amlogic_thermal_restore(struct device *dev)
+{
+ thermal_firmware_init();
+
+ return 0;
+}
+
+static struct dev_pm_ops amlogic_theraml_pm = {
+ .freeze = amlogic_thermal_freeze,
+ .thaw = amlogic_thermal_thaw,
+ .restore = amlogic_thermal_restore,
+};
+#endif
+
static int amlogic_thermal_probe(struct platform_device *pdev)
{
int ret, trim_flag;
@@ -1069,29 +1094,13 @@ static int amlogic_thermal_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int amlogic_thermal_suspend(struct device *dev)
-{
- return 0;
-}
-
-static int amlogic_thermal_resume(struct device *dev)
-{
- return 0;
-}
-
-static SIMPLE_DEV_PM_OPS(amlogic_thermal_pm,
- amlogic_thermal_suspend, amlogic_thermal_resume);
-#define amlogic_thermal_PM (&amlogic_thermal_pm)
-#else
-#define amlogic_thermal_PM NULL
-#endif
-
struct platform_driver amlogic_thermal_driver = {
.driver = {
.name = "amlogic-thermal",
.owner = THIS_MODULE,
- .pm = amlogic_thermal_PM,
+ #ifdef CONFIG_HIBERNATION
+ .pm = &amlogic_theraml_pm,
+ #endif
.of_match_table = of_match_ptr(amlogic_thermal_match),
},
.probe = amlogic_thermal_probe,