int sensor_id)
{
/* Retrieve the critical trip point to enable the overheat interrupt */
- struct thermal_trip trip;
+ int temperature;
int ret;
- int i;
-
- for (i = 0; i < thermal_zone_get_num_trips(tz); i++) {
-
- ret = thermal_zone_get_trip(tz, i, &trip);
- if (ret)
- return ret;
-
- if (trip.type != THERMAL_TRIP_CRITICAL)
- continue;
-
- ret = armada_select_channel(priv, sensor_id);
- if (ret)
- return ret;
- armada_set_overheat_thresholds(priv, trip.temperature,
- trip.hysteresis);
- priv->overheat_sensor = tz;
- priv->interrupt_source = sensor_id;
+ ret = thermal_zone_get_crit_temp(tz, &temperature);
+ if (ret)
+ return ret;
- armada_enable_overheat_interrupt(priv);
+ ret = armada_select_channel(priv, sensor_id);
+ if (ret)
+ return ret;
- return 0;
- }
+ /*
+ * A critical temperature does not have a hysteresis
+ */
+ armada_set_overheat_thresholds(priv, temperature, 0);
+ priv->overheat_sensor = tz;
+ priv->interrupt_source = sensor_id;
+ armada_enable_overheat_interrupt(priv);
- return -EINVAL;
+ return 0;
}
static int armada_thermal_probe(struct platform_device *pdev)