return 0; /* hw sets this state */
}
+static struct thermal_cooling_device *soctherm_hw_critical_cdev;
+static struct thermal_cooling_device *soctherm_hw_hot_cdev;
static struct thermal_cooling_device_ops soctherm_hw_action_ops = {
.get_max_state = soctherm_hw_action_get_max_state,
.get_cur_state = soctherm_hw_action_get_cur_state,
for (j = 0; j < therm->num_trips; j++) {
switch (therm->trips[j].trip_type) {
case THERMAL_TRIP_CRITICAL:
- thermal_cooling_device_register(
+ if (soctherm_hw_critical_cdev)
+ break;
+ soctherm_hw_critical_cdev =
+ thermal_cooling_device_register(
therm->trips[j].cdev_type,
&therm->trips[j],
&soctherm_hw_action_ops);
&& k == THROTTLE_OC5))
continue;
- thermal_cooling_device_register(
- therm->trips[j].cdev_type,
- &therm->trips[j],
- &soctherm_hw_action_ops);
+ if (soctherm_hw_hot_cdev)
+ continue;
+ soctherm_hw_hot_cdev =
+ thermal_cooling_device_register(
+ therm->trips[j].cdev_type,
+ &therm->trips[j],
+ &soctherm_hw_action_ops);
}
break;