static int anatop_thermal_suspend(struct platform_device *pdev,
pm_message_t state)
{
+ /* turn off alarm */
+ anatop_update_alarm(0);
+ suspend_flag = true;
/* Power down anatop thermal sensor */
__raw_writel(BM_ANADIG_TEMPSENSE0_MEASURE_TEMP,
anatop_base + HW_ANADIG_TEMPSENSE0_CLR);
anatop_base + HW_ANADIG_TEMPSENSE0_SET);
__raw_writel(BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF,
anatop_base + HW_ANADIG_ANA_MISC0_CLR);
- /* turn off alarm */
- anatop_update_alarm(0);
- suspend_flag = true;
-
return 0;
}
static int anatop_thermal_resume(struct platform_device *pdev)
kfree(cdev);
}
}
+static int thermal_suspend(struct device *dev, pm_message_t state)
+{
+ struct thermal_zone_device *tz;
+ if (!strncmp(dev_name(dev), "thermal_zone", strlen("thermal_zone"))) {
+ tz = to_thermal_zone(dev);
+ thermal_zone_device_set_polling(tz, 0);
+ }
+ return 0;
+}
+static int themal_resume(struct device *dev)
+{
+ struct thermal_zone_device *tz;
+ if (!strncmp(dev_name(dev), "thermal_zone", strlen("thermal_zone"))) {
+ tz = to_thermal_zone(dev);
+ if (tz->passive)
+ thermal_zone_device_set_polling(tz, tz->passive_delay);
+ else if (tz->polling_delay)
+ thermal_zone_device_set_polling(tz, tz->polling_delay);
+ }
+ return 0;
+}
static struct class thermal_class = {
.name = "thermal",
.dev_release = thermal_release,
+ .suspend = thermal_suspend,
+ .resume = themal_resume,
};
/**