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()
157 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_unbind() local
159 if (!data || IS_ERR(data)) in ti_thermal_unbind()
163 if (data->cool_dev != cdev) in ti_thermal_unbind()
174 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_get_mode() local
176 if (data) in ti_thermal_get_mode()
177 *mode = data->mode; in ti_thermal_get_mode()
186 struct ti_thermal_data *data = thermal->devdata; in ti_thermal_set_mode() local
189 bgp = data->bgp; in ti_thermal_set_mode()
191 if (!data->ti_thermal) { in ti_thermal_set_mode()
196 mutex_lock(&data->ti_thermal->lock); in ti_thermal_set_mode()
199 data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE; in ti_thermal_set_mode()
201 data->ti_thermal->polling_delay = 0; in ti_thermal_set_mode()
203 mutex_unlock(&data->ti_thermal->lock); in ti_thermal_set_mode()
205 data->mode = mode; in ti_thermal_set_mode()
206 ti_bandgap_write_update_interval(bgp, data->sensor_id, in ti_thermal_set_mode()
207 data->ti_thermal->polling_delay); in ti_thermal_set_mode()
208 thermal_zone_device_update(data->ti_thermal); in ti_thermal_set_mode()
210 data->ti_thermal->polling_delay); in ti_thermal_set_mode()
244 struct ti_thermal_data *data = p; in __ti_thermal_get_trend() local
248 bgp = data->bgp; in __ti_thermal_get_trend()
249 id = data->sensor_id; in __ti_thermal_get_trend()
309 struct ti_thermal_data *data; in ti_thermal_build_data() local
311 data = devm_kzalloc(bgp->dev, sizeof(*data), GFP_KERNEL); in ti_thermal_build_data()
312 if (!data) { in ti_thermal_build_data()
316 data->sensor_id = id; in ti_thermal_build_data()
317 data->bgp = bgp; in ti_thermal_build_data()
318 data->mode = THERMAL_DEVICE_ENABLED; in ti_thermal_build_data()
320 data->pcb_tz = thermal_zone_get_zone_by_name("pcb"); in ti_thermal_build_data()
321 INIT_WORK(&data->thermal_wq, ti_thermal_work); in ti_thermal_build_data()
323 return data; in ti_thermal_build_data()
329 struct ti_thermal_data *data; in ti_thermal_expose_sensor() local
331 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_expose_sensor()
333 if (!data || IS_ERR(data)) in ti_thermal_expose_sensor()
334 data = ti_thermal_build_data(bgp, id); in ti_thermal_expose_sensor()
336 if (!data) in ti_thermal_expose_sensor()
340 data->ti_thermal = thermal_zone_of_sensor_register(bgp->dev, id, in ti_thermal_expose_sensor()
341 data, &ti_of_thermal_ops); in ti_thermal_expose_sensor()
342 if (IS_ERR(data->ti_thermal)) { in ti_thermal_expose_sensor()
344 data->ti_thermal = thermal_zone_device_register(domain, in ti_thermal_expose_sensor()
345 OMAP_TRIP_NUMBER, 0, data, &ti_thermal_ops, in ti_thermal_expose_sensor()
348 if (IS_ERR(data->ti_thermal)) { in ti_thermal_expose_sensor()
350 return PTR_ERR(data->ti_thermal); in ti_thermal_expose_sensor()
352 data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE; in ti_thermal_expose_sensor()
353 data->our_zone = true; in ti_thermal_expose_sensor()
355 ti_bandgap_set_sensor_data(bgp, id, data); in ti_thermal_expose_sensor()
356 ti_bandgap_write_update_interval(bgp, data->sensor_id, in ti_thermal_expose_sensor()
357 data->ti_thermal->polling_delay); in ti_thermal_expose_sensor()
364 struct ti_thermal_data *data; in ti_thermal_remove_sensor() local
366 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_remove_sensor()
368 if (data && data->ti_thermal) { in ti_thermal_remove_sensor()
369 if (data->our_zone) in ti_thermal_remove_sensor()
370 thermal_zone_device_unregister(data->ti_thermal); in ti_thermal_remove_sensor()
373 data->ti_thermal); in ti_thermal_remove_sensor()
381 struct ti_thermal_data *data; in ti_thermal_report_sensor_temperature() local
383 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_report_sensor_temperature()
385 schedule_work(&data->thermal_wq); in ti_thermal_report_sensor_temperature()
392 struct ti_thermal_data *data; in ti_thermal_register_cpu_cooling() local
403 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_register_cpu_cooling()
404 if (!data || IS_ERR(data)) in ti_thermal_register_cpu_cooling()
405 data = ti_thermal_build_data(bgp, id); in ti_thermal_register_cpu_cooling()
407 if (!data) in ti_thermal_register_cpu_cooling()
411 data->cool_dev = cpufreq_cooling_register(cpu_present_mask); in ti_thermal_register_cpu_cooling()
412 if (IS_ERR(data->cool_dev)) { in ti_thermal_register_cpu_cooling()
413 int ret = PTR_ERR(data->cool_dev); in ti_thermal_register_cpu_cooling()
422 ti_bandgap_set_sensor_data(bgp, id, data); in ti_thermal_register_cpu_cooling()
429 struct ti_thermal_data *data; in ti_thermal_unregister_cpu_cooling() local
431 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_unregister_cpu_cooling()
433 if (data) in ti_thermal_unregister_cpu_cooling()
434 cpufreq_cooling_unregister(data->cool_dev); in ti_thermal_unregister_cpu_cooling()