24 #include <linux/device.h>
28 #include <linux/kernel.h>
64 static inline int omap_thermal_hotspot_temperature(
int t,
int s,
int c)
66 int delta = t * s / 1000 +
c;
105 *temp = omap_thermal_hotspot_temperature(tmp, slope, constant);
117 if (IS_ERR_OR_NULL(data))
125 max = data->
bg_ptr->conf->sensors[
id].cooling_data.freq_clip_count;
140 if (IS_ERR_OR_NULL(data))
170 dev_notice(&thermal->
device,
"thermal zone not registered\n");
185 dev_dbg(&thermal->
device,
"thermal polling set for duration=%d msec\n",
208 int trip,
unsigned long *temp)
227 .get_temp = omap_thermal_get_temp,
229 .bind = omap_thermal_bind,
230 .unbind = omap_thermal_unbind,
231 .get_mode = omap_thermal_get_mode,
232 .set_mode = omap_thermal_set_mode,
233 .get_trip_type = omap_thermal_get_trip_type,
234 .get_trip_temp = omap_thermal_get_trip_temp,
235 .get_crit_temp = omap_thermal_get_crit_temp,
239 *omap_thermal_build_data(
struct omap_bandgap *bg_ptr,
int id)
259 struct omap_thermal_pdata pdata;
264 data = omap_thermal_build_pdata(bg_ptr,
id);
275 if (IS_ERR_OR_NULL(data->omap_thermal)) {
276 dev_err(bg_ptr->
dev,
"thermal zone device is NULL\n");
277 return PTR_ERR(data->omap_thermal);
307 static int omap_thermal_build_cpufreq_clip(
struct omap_bandgap *bg_ptr,
316 if (IS_ERR_OR_NULL(freq_table)) {
318 "%s: failed to get cpufreq table (%p)\n",
319 __func__, freq_table);
333 "%s: no memory available\n", __func__);
362 data = omap_thermal_build_pdata(bg_ptr,
id);
367 ret = omap_thermal_build_cpufreq_clip(bg_ptr, &tab_ptr, &tab_size);
370 "%s: failed to build cpufreq clip table\n", __func__);
376 if (IS_ERR_OR_NULL(data->
cool_dev)) {
378 "Failed to register cpufreq cooling device\n");
381 bg_ptr->
conf->sensors[
id].cooling_data.freq_clip_count = tab_size;