static int exynos_get_temp(void *p, int *temp)
{
struct exynos_tmu_data *data = p;
- struct thermal_cooling_device *cdev;
+ struct thermal_cooling_device *cdev = NULL;
+ struct thermal_zone_device *tz;
+ struct thermal_instance *instance;
#ifdef CONFIG_EXYNOS_MCINFO
unsigned int mcinfo_count;
unsigned int mcinfo_result[4] = {0, 0, 0, 0};
mutex_unlock(&data->lock);
- cdev = data->cool_dev;
+ tz = data->tzd;
+
+ list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
+ if (instance->cdev) {
+ cdev = instance->cdev;
+ break;
+ }
+ }
if (!cdev)
return 0;
unsigned long event, void *v)
{
struct exynos_tmu_data *devnode;
- struct thermal_cooling_device *cdev;
+ struct thermal_cooling_device *cdev = NULL;
+ struct thermal_zone_device *tz;
+ struct thermal_instance *instance;
switch (event) {
case PM_SUSPEND_PREPARE:
mutex_lock(&thermal_suspend_lock);
suspended = true;
list_for_each_entry(devnode, &dtm_dev_list, node) {
- cdev = devnode->cool_dev;
+ tz = devnode->tzd;
+ list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
+ if (instance->cdev) {
+ cdev = instance->cdev;
+ break;
+ }
+ }
if (cdev && cdev->ops->set_cur_temp && devnode->id != 1)
cdev->ops->set_cur_temp(cdev, suspended, 0);
suspended = false;
list_for_each_entry(devnode, &dtm_dev_list, node) {
cdev = devnode->cool_dev;
+ tz = devnode->tzd;
+ list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
+ if (instance->cdev) {
+ cdev = instance->cdev;
+ break;
+ }
+ }
if (cdev && cdev->ops->set_cur_temp && devnode->id != 1)
cdev->ops->set_cur_temp(cdev, suspended, devnode->tzd->temperature / 1000);