Lines Matching refs:bgp

32 	struct ti_bandgap *bgp;  member
72 struct ti_bandgap *bgp; in __ti_thermal_get_temp() local
80 bgp = data->bgp; in __ti_thermal_get_temp()
81 s = &bgp->conf->sensors[data->sensor_id]; in __ti_thermal_get_temp()
83 ret = ti_bandgap_read_temperature(bgp, data->sensor_id, &tmp); in __ti_thermal_get_temp()
100 dev_err(bgp->dev, in __ti_thermal_get_temp()
113 struct ti_bandgap *bgp; in __ti_thermal_get_trend() local
116 bgp = data->bgp; in __ti_thermal_get_trend()
119 ret = ti_bandgap_get_trend(bgp, id, &tr); in __ti_thermal_get_trend()
139 *ti_thermal_build_data(struct ti_bandgap *bgp, int id) in ti_thermal_build_data() argument
143 data = devm_kzalloc(bgp->dev, sizeof(*data), GFP_KERNEL); in ti_thermal_build_data()
145 dev_err(bgp->dev, "kzalloc fail\n"); in ti_thermal_build_data()
149 data->bgp = bgp; in ti_thermal_build_data()
158 int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, in ti_thermal_expose_sensor() argument
164 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_expose_sensor()
167 data = ti_thermal_build_data(bgp, id); in ti_thermal_expose_sensor()
173 data->ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, in ti_thermal_expose_sensor()
176 dev_err(bgp->dev, "thermal zone device is NULL\n"); in ti_thermal_expose_sensor()
182 ti_bandgap_set_sensor_data(bgp, id, data); in ti_thermal_expose_sensor()
183 ti_bandgap_write_update_interval(bgp, data->sensor_id, interval); in ti_thermal_expose_sensor()
186 dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n"); in ti_thermal_expose_sensor()
191 int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id) in ti_thermal_remove_sensor() argument
195 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_remove_sensor()
205 int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id) in ti_thermal_report_sensor_temperature() argument
209 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_report_sensor_temperature()
216 int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id) in ti_thermal_register_cpu_cooling() argument
219 struct device_node *np = bgp->dev->of_node; in ti_thermal_register_cpu_cooling()
229 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_register_cpu_cooling()
231 data = ti_thermal_build_data(bgp, id); in ti_thermal_register_cpu_cooling()
246 dev_err(bgp->dev, "Failed to register cpu cooling device %d\n", in ti_thermal_register_cpu_cooling()
252 ti_bandgap_set_sensor_data(bgp, id, data); in ti_thermal_register_cpu_cooling()
257 int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id) in ti_thermal_unregister_cpu_cooling() argument
261 data = ti_bandgap_get_sensor_data(bgp, id); in ti_thermal_unregister_cpu_cooling()