Loading drivers/thermal/of-thermal.c +32 −7 Original line number Diff line number Diff line Loading @@ -578,12 +578,8 @@ int of_thermal_aggregate_trip(struct thermal_zone_device *tz, } EXPORT_SYMBOL(of_thermal_aggregate_trip); /* * of_thermal_handle_trip - Handle thermal trip from sensors * * @tz: pointer to the primary thermal zone. */ void of_thermal_handle_trip(struct thermal_zone_device *tz) static void handle_thermal_trip(struct thermal_zone_device *tz, bool temp_valid, int trip_temp) { struct thermal_zone_device *zone; struct __thermal_zone *data = tz->devdata; Loading @@ -594,8 +590,37 @@ void of_thermal_handle_trip(struct thermal_zone_device *tz) zone = data->tzd; if (data->mode == THERMAL_DEVICE_DISABLED) continue; thermal_zone_device_update(zone, THERMAL_EVENT_UNSPECIFIED); if (!temp_valid) { thermal_zone_device_update(zone, THERMAL_EVENT_UNSPECIFIED); } else { thermal_zone_device_update_temp(zone, THERMAL_EVENT_UNSPECIFIED, trip_temp); } } } /* * of_thermal_handle_trip_temp - Handle thermal trip from sensors * * @tz: pointer to the primary thermal zone. * @trip_temp: The temperature */ void of_thermal_handle_trip_temp(struct thermal_zone_device *tz, int trip_temp) { return handle_thermal_trip(tz, true, trip_temp); } EXPORT_SYMBOL(of_thermal_handle_trip_temp); /* * of_thermal_handle_trip - Handle thermal trip from sensors * * @tz: pointer to the primary thermal zone. */ void of_thermal_handle_trip(struct thermal_zone_device *tz) { return handle_thermal_trip(tz, false, 0); } EXPORT_SYMBOL(of_thermal_handle_trip); Loading drivers/thermal/thermal_core.c +37 −13 Original line number Diff line number Diff line Loading @@ -458,7 +458,7 @@ static void handle_critical_trips(struct thermal_zone_device *tz, } } void handle_thermal_trip(struct thermal_zone_device *tz, int trip) static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) { enum thermal_trip_type type; Loading Loading @@ -576,19 +576,8 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz) } EXPORT_SYMBOL_GPL(thermal_zone_set_trips); static void update_temperature(struct thermal_zone_device *tz) static void store_temperature(struct thermal_zone_device *tz, int temp) { int temp, ret; ret = thermal_zone_get_temp(tz, &temp); if (ret) { if (ret != -EAGAIN) dev_warn(&tz->device, "failed to read out thermal zone (%d)\n", ret); return; } mutex_lock(&tz->lock); tz->last_temperature = tz->temperature; tz->temperature = temp; Loading @@ -604,6 +593,21 @@ static void update_temperature(struct thermal_zone_device *tz) tz->last_temperature, tz->temperature); } static void update_temperature(struct thermal_zone_device *tz) { int temp, ret; ret = thermal_zone_get_temp(tz, &temp); if (ret) { if (ret != -EAGAIN) dev_warn(&tz->device, "failed to read out thermal zone (%d)\n", ret); return; } store_temperature(tz, temp); } static void thermal_zone_device_reset(struct thermal_zone_device *tz) { struct thermal_instance *pos; Loading @@ -614,6 +618,26 @@ static void thermal_zone_device_reset(struct thermal_zone_device *tz) pos->initialized = false; } void thermal_zone_device_update_temp(struct thermal_zone_device *tz, enum thermal_notify_event event, int temp) { int count; if (atomic_read(&in_suspend)) return; trace_thermal_device_update(tz, event); store_temperature(tz, temp); thermal_zone_set_trips(tz); tz->notify_event = event; for (count = 0; count < tz->trips; count++) handle_thermal_trip(tz, count); } EXPORT_SYMBOL(thermal_zone_device_update_temp); void thermal_zone_device_update(struct thermal_zone_device *tz, enum thermal_notify_event event) { Loading drivers/thermal/thermal_core.h +6 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ struct thermal_instance { int thermal_register_governor(struct thermal_governor *); void thermal_unregister_governor(struct thermal_governor *); void handle_thermal_trip(struct thermal_zone_device *tz, int trip); #ifdef CONFIG_THERMAL_GOV_STEP_WISE int thermal_gov_step_wise_register(void); Loading Loading @@ -122,6 +121,8 @@ int of_thermal_aggregate_trip(struct thermal_zone_device *tz, enum thermal_trip_type type, int *low, int *high); void of_thermal_handle_trip(struct thermal_zone_device *tz); void of_thermal_handle_trip_temp(struct thermal_zone_device *tz, int trip_temp); #else static inline int of_parse_thermal_zones(void) { return 0; } static inline void of_thermal_destroy_zones(void) { } Loading @@ -148,6 +149,10 @@ static inline int of_thermal_aggregate_trip(struct thermal_zone_device *tz, static inline void of_thermal_handle_trip(struct thermal_zone_device *tz) { } static inline void of_thermal_handle_trip_temp(struct thermal_zone_device *tz, int trip_temp) { } #endif #endif /* __THERMAL_CORE_H__ */ include/linux/thermal.h +6 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,8 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, struct thermal_cooling_device *); void thermal_zone_device_update(struct thermal_zone_device *, enum thermal_notify_event); void thermal_zone_device_update_temp(struct thermal_zone_device *tz, enum thermal_notify_event event, int temp); void thermal_zone_set_trips(struct thermal_zone_device *); struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, Loading Loading @@ -584,6 +586,10 @@ static inline int thermal_zone_unbind_cooling_device( static inline void thermal_zone_device_update(struct thermal_zone_device *tz, enum thermal_notify_event event) { } static inline void thermal_zone_device_update_temp( struct thermal_zone_device *tz, enum thermal_notify_event event, int temp) { } static inline void thermal_zone_set_trips(struct thermal_zone_device *tz) { } static inline struct thermal_cooling_device * Loading Loading
drivers/thermal/of-thermal.c +32 −7 Original line number Diff line number Diff line Loading @@ -578,12 +578,8 @@ int of_thermal_aggregate_trip(struct thermal_zone_device *tz, } EXPORT_SYMBOL(of_thermal_aggregate_trip); /* * of_thermal_handle_trip - Handle thermal trip from sensors * * @tz: pointer to the primary thermal zone. */ void of_thermal_handle_trip(struct thermal_zone_device *tz) static void handle_thermal_trip(struct thermal_zone_device *tz, bool temp_valid, int trip_temp) { struct thermal_zone_device *zone; struct __thermal_zone *data = tz->devdata; Loading @@ -594,8 +590,37 @@ void of_thermal_handle_trip(struct thermal_zone_device *tz) zone = data->tzd; if (data->mode == THERMAL_DEVICE_DISABLED) continue; thermal_zone_device_update(zone, THERMAL_EVENT_UNSPECIFIED); if (!temp_valid) { thermal_zone_device_update(zone, THERMAL_EVENT_UNSPECIFIED); } else { thermal_zone_device_update_temp(zone, THERMAL_EVENT_UNSPECIFIED, trip_temp); } } } /* * of_thermal_handle_trip_temp - Handle thermal trip from sensors * * @tz: pointer to the primary thermal zone. * @trip_temp: The temperature */ void of_thermal_handle_trip_temp(struct thermal_zone_device *tz, int trip_temp) { return handle_thermal_trip(tz, true, trip_temp); } EXPORT_SYMBOL(of_thermal_handle_trip_temp); /* * of_thermal_handle_trip - Handle thermal trip from sensors * * @tz: pointer to the primary thermal zone. */ void of_thermal_handle_trip(struct thermal_zone_device *tz) { return handle_thermal_trip(tz, false, 0); } EXPORT_SYMBOL(of_thermal_handle_trip); Loading
drivers/thermal/thermal_core.c +37 −13 Original line number Diff line number Diff line Loading @@ -458,7 +458,7 @@ static void handle_critical_trips(struct thermal_zone_device *tz, } } void handle_thermal_trip(struct thermal_zone_device *tz, int trip) static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) { enum thermal_trip_type type; Loading Loading @@ -576,19 +576,8 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz) } EXPORT_SYMBOL_GPL(thermal_zone_set_trips); static void update_temperature(struct thermal_zone_device *tz) static void store_temperature(struct thermal_zone_device *tz, int temp) { int temp, ret; ret = thermal_zone_get_temp(tz, &temp); if (ret) { if (ret != -EAGAIN) dev_warn(&tz->device, "failed to read out thermal zone (%d)\n", ret); return; } mutex_lock(&tz->lock); tz->last_temperature = tz->temperature; tz->temperature = temp; Loading @@ -604,6 +593,21 @@ static void update_temperature(struct thermal_zone_device *tz) tz->last_temperature, tz->temperature); } static void update_temperature(struct thermal_zone_device *tz) { int temp, ret; ret = thermal_zone_get_temp(tz, &temp); if (ret) { if (ret != -EAGAIN) dev_warn(&tz->device, "failed to read out thermal zone (%d)\n", ret); return; } store_temperature(tz, temp); } static void thermal_zone_device_reset(struct thermal_zone_device *tz) { struct thermal_instance *pos; Loading @@ -614,6 +618,26 @@ static void thermal_zone_device_reset(struct thermal_zone_device *tz) pos->initialized = false; } void thermal_zone_device_update_temp(struct thermal_zone_device *tz, enum thermal_notify_event event, int temp) { int count; if (atomic_read(&in_suspend)) return; trace_thermal_device_update(tz, event); store_temperature(tz, temp); thermal_zone_set_trips(tz); tz->notify_event = event; for (count = 0; count < tz->trips; count++) handle_thermal_trip(tz, count); } EXPORT_SYMBOL(thermal_zone_device_update_temp); void thermal_zone_device_update(struct thermal_zone_device *tz, enum thermal_notify_event event) { Loading
drivers/thermal/thermal_core.h +6 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ struct thermal_instance { int thermal_register_governor(struct thermal_governor *); void thermal_unregister_governor(struct thermal_governor *); void handle_thermal_trip(struct thermal_zone_device *tz, int trip); #ifdef CONFIG_THERMAL_GOV_STEP_WISE int thermal_gov_step_wise_register(void); Loading Loading @@ -122,6 +121,8 @@ int of_thermal_aggregate_trip(struct thermal_zone_device *tz, enum thermal_trip_type type, int *low, int *high); void of_thermal_handle_trip(struct thermal_zone_device *tz); void of_thermal_handle_trip_temp(struct thermal_zone_device *tz, int trip_temp); #else static inline int of_parse_thermal_zones(void) { return 0; } static inline void of_thermal_destroy_zones(void) { } Loading @@ -148,6 +149,10 @@ static inline int of_thermal_aggregate_trip(struct thermal_zone_device *tz, static inline void of_thermal_handle_trip(struct thermal_zone_device *tz) { } static inline void of_thermal_handle_trip_temp(struct thermal_zone_device *tz, int trip_temp) { } #endif #endif /* __THERMAL_CORE_H__ */
include/linux/thermal.h +6 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,8 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, struct thermal_cooling_device *); void thermal_zone_device_update(struct thermal_zone_device *, enum thermal_notify_event); void thermal_zone_device_update_temp(struct thermal_zone_device *tz, enum thermal_notify_event event, int temp); void thermal_zone_set_trips(struct thermal_zone_device *); struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, Loading Loading @@ -584,6 +586,10 @@ static inline int thermal_zone_unbind_cooling_device( static inline void thermal_zone_device_update(struct thermal_zone_device *tz, enum thermal_notify_event event) { } static inline void thermal_zone_device_update_temp( struct thermal_zone_device *tz, enum thermal_notify_event event, int temp) { } static inline void thermal_zone_set_trips(struct thermal_zone_device *tz) { } static inline struct thermal_cooling_device * Loading