Lines Matching refs:data

52 	struct ti_thermal_data *data = container_of(work,  in ti_thermal_work()  local
55 thermal_zone_device_update(data->ti_thermal); in ti_thermal_work()
57 dev_dbg(&data->ti_thermal->device, "updated thermal zone %s\n", in ti_thermal_work()
58 data->ti_thermal->type); in ti_thermal_work()
82 struct ti_thermal_data *data = devdata; in __ti_thermal_get_temp() local
88 if (!data) in __ti_thermal_get_temp()
91 bgp = data->bgp; in __ti_thermal_get_temp()
92 s = &bgp->conf->sensors[data->sensor_id]; in __ti_thermal_get_temp()
94 ret = ti_bandgap_read_temperature(bgp, data->sensor_id, &tmp); in __ti_thermal_get_temp()
102 pcb_tz = data->pcb_tz; in __ti_thermal_get_temp()
124 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_get_temp() local
126 return __ti_thermal_get_temp(data, temp); in ti_thermal_get_temp()
133 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_bind() local
136 if (!data || IS_ERR(data)) in ti_thermal_bind()
140 if (data->cool_dev != cdev) in ti_thermal_bind()
143 id = data->sensor_id; in ti_thermal_bind()
156 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_unbind() local
158 if (!data || IS_ERR(data)) in ti_thermal_unbind()
162 if (data->cool_dev != cdev) in ti_thermal_unbind()
173 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_get_mode() local
175 if (data) in ti_thermal_get_mode()
176 *mode = data->mode; in ti_thermal_get_mode()
185 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_set_mode() local
188 bgp = data->bgp; in ti_thermal_set_mode()
190 if (!data->ti_thermal) { in ti_thermal_set_mode()
195 mutex_lock(&data->ti_thermal->lock); in ti_thermal_set_mode()
198 data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE; in ti_thermal_set_mode()
200 data->ti_thermal->polling_delay = 0; in ti_thermal_set_mode()
202 mutex_unlock(&data->ti_thermal->lock); in ti_thermal_set_mode()
204 data->mode = mode; in ti_thermal_set_mode()
205 ti_bandgap_write_update_interval(bgp, data->sensor_id, in ti_thermal_set_mode()
206 data->ti_thermal->polling_delay); in ti_thermal_set_mode()
207 thermal_zone_device_update(data->ti_thermal); in ti_thermal_set_mode()
209 data->ti_thermal->polling_delay); in ti_thermal_set_mode()
243 struct ti_thermal_data *data = p; in __ti_thermal_get_trend() local
247 bgp = data->bgp; in __ti_thermal_get_trend()
248 id = data->sensor_id; in __ti_thermal_get_trend()
308 struct ti_thermal_data *data; in ti_thermal_build_data() local
310 data = devm_kzalloc(bgp->dev, sizeof(*data), GFP_KERNEL); in ti_thermal_build_data()
311 if (!data) { in ti_thermal_build_data()
315 data->sensor_id = id; in ti_thermal_build_data()
316 data->bgp = bgp; in ti_thermal_build_data()
317 data->mode = THERMAL_DEVICE_ENABLED; in ti_thermal_build_data()
319 data->pcb_tz = thermal_zone_get_zone_by_name("pcb"); in ti_thermal_build_data()
320 INIT_WORK(&data->thermal_wq, ti_thermal_work); in ti_thermal_build_data()
322 return data; in ti_thermal_build_data()
328 struct ti_thermal_data *data; in ti_thermal_expose_sensor() local
330 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_expose_sensor()
332 if (!data || IS_ERR(data)) in ti_thermal_expose_sensor()
333 data = ti_thermal_build_data(bgp, id); in ti_thermal_expose_sensor()
335 if (!data) in ti_thermal_expose_sensor()
339 data->ti_thermal = thermal_zone_of_sensor_register(bgp->dev, id, in ti_thermal_expose_sensor()
340 data, &ti_of_thermal_ops); in ti_thermal_expose_sensor()
341 if (IS_ERR(data->ti_thermal)) { in ti_thermal_expose_sensor()
343 data->ti_thermal = thermal_zone_device_register(domain, in ti_thermal_expose_sensor()
344 OMAP_TRIP_NUMBER, 0, data, &ti_thermal_ops, in ti_thermal_expose_sensor()
347 if (IS_ERR(data->ti_thermal)) { in ti_thermal_expose_sensor()
349 return PTR_ERR(data->ti_thermal); in ti_thermal_expose_sensor()
351 data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE; in ti_thermal_expose_sensor()
352 data->our_zone = true; in ti_thermal_expose_sensor()
354 ti_bandgap_set_sensor_data(bgp, id, data); in ti_thermal_expose_sensor()
355 ti_bandgap_write_update_interval(bgp, data->sensor_id, in ti_thermal_expose_sensor()
356 data->ti_thermal->polling_delay); in ti_thermal_expose_sensor()
363 struct ti_thermal_data *data; in ti_thermal_remove_sensor() local
365 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_remove_sensor()
367 if (data && data->ti_thermal) { in ti_thermal_remove_sensor()
368 if (data->our_zone) in ti_thermal_remove_sensor()
369 thermal_zone_device_unregister(data->ti_thermal); in ti_thermal_remove_sensor()
372 data->ti_thermal); in ti_thermal_remove_sensor()
380 struct ti_thermal_data *data; in ti_thermal_report_sensor_temperature() local
382 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_report_sensor_temperature()
384 schedule_work(&data->thermal_wq); in ti_thermal_report_sensor_temperature()
391 struct ti_thermal_data *data; in ti_thermal_register_cpu_cooling() local
402 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_register_cpu_cooling()
403 if (!data || IS_ERR(data)) in ti_thermal_register_cpu_cooling()
404 data = ti_thermal_build_data(bgp, id); in ti_thermal_register_cpu_cooling()
406 if (!data) in ti_thermal_register_cpu_cooling()
410 data->cool_dev = cpufreq_cooling_register(cpu_present_mask); in ti_thermal_register_cpu_cooling()
411 if (IS_ERR(data->cool_dev)) { in ti_thermal_register_cpu_cooling()
412 int ret = PTR_ERR(data->cool_dev); in ti_thermal_register_cpu_cooling()
421 ti_bandgap_set_sensor_data(bgp, id, data); in ti_thermal_register_cpu_cooling()
428 struct ti_thermal_data *data; in ti_thermal_unregister_cpu_cooling() local
430 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_unregister_cpu_cooling()
432 if (data) in ti_thermal_unregister_cpu_cooling()
433 cpufreq_cooling_unregister(data->cool_dev); in ti_thermal_unregister_cpu_cooling()