Lines Matching defs:th
9 int for_each_thermal_threshold(struct thermal_threshold *th, cb_th_t cb, void *arg)
13 if (!th)
16 for (i = 0; th[i].temperature != INT_MAX; i++)
17 ret |= cb(&th[i], arg);
92 static int __thermal_zone_discover(struct thermal_zone *tz, void *th)
94 if (thermal_cmd_get_trip(th, tz) < 0)
97 if (thermal_cmd_threshold_get(th, tz))
100 if (thermal_cmd_get_governor(th, tz))
106 struct thermal_zone *thermal_zone_discover(struct thermal_handler *th)
110 if (thermal_cmd_get_tz(th, &tz) < 0)
113 if (for_each_thermal_zone(tz, __thermal_zone_discover, th))
119 void thermal_exit(struct thermal_handler *th)
121 thermal_cmd_exit(th);
122 thermal_events_exit(th);
123 thermal_sampling_exit(th);
125 free(th);
130 struct thermal_handler *th;
132 th = malloc(sizeof(*th));
133 if (!th)
135 th->ops = ops;
137 if (thermal_events_init(th))
140 if (thermal_sampling_init(th))
143 if (thermal_cmd_init(th))
146 return th;
149 free(th);