@@ -1130,6 +1130,28 @@ leave:
EXPORT_SYMBOL(thermal_zone_device_update);
/**
+ * thermal_zone_device_deactive - deactive cooling devices of thermal zone
+ * @tz: thermal zone device
+ *
+ * This function should be called in the thermal zone device .set_mode
+ * callback when the thermal zone is disabled.
+ */
+void thermal_zone_device_deactive(struct thermal_zone_device *tz)
+{
+ struct thermal_cooling_device_instance *instance;
+ struct thermal_cooling_device *cdev;
+
+ mutex_lock(&tz->lock);
+ list_for_each_entry(instance, &tz->cooling_devices, node) {
+ cdev = instance->cdev;
+ if (cdev->ops->set_cur_state)
+ cdev->ops->set_cur_state(cdev, 0);
+ }
+ mutex_unlock(&tz->lock);
+}
+EXPORT_SYMBOL(thermal_zone_device_deactive);
+
+/**
* create_trip_attrs - create attributes for trip points
* @tz: the thermal zone device
* @mask: Writeable trip point bitmap.
@@ -161,6 +161,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
struct thermal_cooling_device *);
void thermal_zone_device_update(struct thermal_zone_device *);
+void thermal_zone_device_deactive(struct thermal_zone_device *);
struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
const struct thermal_cooling_device_ops *);
void thermal_cooling_device_unregister(struct thermal_cooling_device *);