Lines Matching refs:tze

559 	struct tz_episode *tze;  in thermal_debugfs_tz_event_alloc()  local
562 tze = kzalloc(struct_size(tze, trip_stats, tz->num_trips), GFP_KERNEL); in thermal_debugfs_tz_event_alloc()
563 if (!tze) in thermal_debugfs_tz_event_alloc()
566 INIT_LIST_HEAD(&tze->node); in thermal_debugfs_tz_event_alloc()
567 tze->timestamp = now; in thermal_debugfs_tz_event_alloc()
568 tze->duration = KTIME_MIN; in thermal_debugfs_tz_event_alloc()
569 tze->max_temp = INT_MIN; in thermal_debugfs_tz_event_alloc()
572 tze->trip_stats[i].trip_temp = THERMAL_TEMP_INVALID; in thermal_debugfs_tz_event_alloc()
573 tze->trip_stats[i].min = INT_MAX; in thermal_debugfs_tz_event_alloc()
576 return tze; in thermal_debugfs_tz_event_alloc()
587 struct tz_episode *tze; in thermal_debug_tz_trip_up() local
630 tze = thermal_debugfs_tz_event_alloc(tz, now); in thermal_debug_tz_trip_up()
631 if (!tze) in thermal_debug_tz_trip_up()
634 list_add(&tze->node, &tz_dbg->tz_episodes); in thermal_debug_tz_trip_up()
652 tze = list_first_entry(&tz_dbg->tz_episodes, struct tz_episode, node); in thermal_debug_tz_trip_up()
653 trip_stats = &tze->trip_stats[trip_id]; in thermal_debug_tz_trip_up()
662 static void tz_episode_close_trip(struct tz_episode *tze, int trip_id, ktime_t now) in tz_episode_close_trip() argument
664 struct trip_stats *trip_stats = &tze->trip_stats[trip_id]; in tz_episode_close_trip()
678 struct tz_episode *tze; in thermal_debug_tz_trip_down() local
712 tze = list_first_entry(&tz_dbg->tz_episodes, struct tz_episode, node); in thermal_debug_tz_trip_down()
714 tz_episode_close_trip(tze, trip_id, now); in thermal_debug_tz_trip_down()
721 tze->duration = ktime_sub(now, tze->timestamp); in thermal_debug_tz_trip_down()
731 struct tz_episode *tze; in thermal_debug_update_trip_stats() local
744 tze = list_first_entry(&tz_dbg->tz_episodes, struct tz_episode, node); in thermal_debug_update_trip_stats()
746 if (tz->temperature > tze->max_temp) in thermal_debug_update_trip_stats()
747 tze->max_temp = tz->temperature; in thermal_debug_update_trip_stats()
751 struct trip_stats *trip_stats = &tze->trip_stats[trip_id]; in thermal_debug_update_trip_stats()
791 struct tz_episode *tze; in tze_seq_show() local
796 tze = list_entry((struct list_head *)v, struct tz_episode, node); in tze_seq_show()
798 if (tze->duration == KTIME_MIN) { in tze_seq_show()
800 duration_ms = ktime_to_ms(ktime_sub(ktime_get(), tze->timestamp)); in tze_seq_show()
803 duration_ms = ktime_to_ms(tze->duration); in tze_seq_show()
808 ktime_to_ms(tze->timestamp), c, duration_ms, tze->max_temp); in tze_seq_show()
825 trip_stats = &tze->trip_stats[trip_id]; in tze_seq_show()
864 DEFINE_SEQ_ATTRIBUTE(tze);
909 struct tz_episode *tze, *tmp; in thermal_debug_tz_remove() local
923 list_for_each_entry_safe(tze, tmp, &tz_dbg->tz_episodes, node) { in thermal_debug_tz_remove()
924 list_del(&tze->node); in thermal_debug_tz_remove()
925 kfree(tze); in thermal_debug_tz_remove()
939 struct tz_episode *tze; in thermal_debug_tz_resume() local
957 tze = list_first_entry(&tz_dbg->tz_episodes, struct tz_episode, node); in thermal_debug_tz_resume()
960 tz_episode_close_trip(tze, tz_dbg->trips_crossed[i], now); in thermal_debug_tz_resume()
962 tze->duration = ktime_sub(now, tze->timestamp); in thermal_debug_tz_resume()