Lines Matching defs:data
25 /* common data structures */
40 struct ti_thermal_data *data = container_of(work,
43 thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED);
45 dev_dbg(&data->ti_thermal->device, "updated thermal zone %s\n",
46 data->ti_thermal->type);
70 struct ti_thermal_data *data = devdata;
76 if (!data)
79 bgp = data->bgp;
80 s = &bgp->conf->sensors[data->sensor_id];
82 ret = ti_bandgap_read_temperature(bgp, data->sensor_id, &tmp);
87 slope = thermal_zone_get_slope(data->ti_thermal);
88 constant = thermal_zone_get_offset(data->ti_thermal);
90 pcb_tz = data->pcb_tz;
112 struct ti_thermal_data *data = thermal->devdata;
114 return __ti_thermal_get_temp(data, temp);
119 struct ti_thermal_data *data = p;
123 bgp = data->bgp;
124 id = data->sensor_id;
148 struct ti_thermal_data *data;
150 data = devm_kzalloc(bgp->dev, sizeof(*data), GFP_KERNEL);
151 if (!data) {
155 data->sensor_id = id;
156 data->bgp = bgp;
157 data->mode = THERMAL_DEVICE_ENABLED;
159 data->pcb_tz = thermal_zone_get_zone_by_name("pcb");
160 INIT_WORK(&data->thermal_wq, ti_thermal_work);
162 return data;
168 struct ti_thermal_data *data;
170 data = ti_bandgap_get_sensor_data(bgp, id);
172 if (IS_ERR_OR_NULL(data))
173 data = ti_thermal_build_data(bgp, id);
175 if (!data)
179 data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
180 data, &ti_of_thermal_ops);
181 if (IS_ERR(data->ti_thermal)) {
183 return PTR_ERR(data->ti_thermal);
186 ti_bandgap_set_sensor_data(bgp, id, data);
187 ti_bandgap_write_update_interval(bgp, data->sensor_id,
188 data->ti_thermal->polling_delay);
195 struct ti_thermal_data *data;
197 data = ti_bandgap_get_sensor_data(bgp, id);
199 if (!IS_ERR_OR_NULL(data) && data->ti_thermal) {
200 if (data->our_zone)
201 thermal_zone_device_unregister(data->ti_thermal);
209 struct ti_thermal_data *data;
211 data = ti_bandgap_get_sensor_data(bgp, id);
213 schedule_work(&data->thermal_wq);
220 struct ti_thermal_data *data;
231 data = ti_bandgap_get_sensor_data(bgp, id);
232 if (!data || IS_ERR(data))
233 data = ti_thermal_build_data(bgp, id);
235 if (!data)
238 data->policy = cpufreq_cpu_get(0);
239 if (!data->policy) {
245 data->cool_dev = cpufreq_cooling_register(data->policy);
246 if (IS_ERR(data->cool_dev)) {
247 int ret = PTR_ERR(data->cool_dev);
250 cpufreq_cpu_put(data->policy);
254 ti_bandgap_set_sensor_data(bgp, id, data);
261 struct ti_thermal_data *data;
263 data = ti_bandgap_get_sensor_data(bgp, id);
265 if (!IS_ERR_OR_NULL(data)) {
266 cpufreq_cooling_unregister(data->cool_dev);
267 if (data->policy)
268 cpufreq_cpu_put(data->policy);