Lines Matching refs:pzone
65 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_cdev_bind() local
66 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in db8500_cdev_bind()
92 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_cdev_unbind() local
93 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in db8500_cdev_unbind()
112 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_sys_get_temp() local
119 *temp = pzone->cur_temp_pseudo; in db8500_sys_get_temp()
128 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_sys_get_trend() local
130 *trend = pzone->trend; in db8500_sys_get_trend()
139 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_sys_get_mode() local
141 mutex_lock(&pzone->th_lock); in db8500_sys_get_mode()
142 *mode = pzone->mode; in db8500_sys_get_mode()
143 mutex_unlock(&pzone->th_lock); in db8500_sys_get_mode()
152 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_sys_set_mode() local
154 mutex_lock(&pzone->th_lock); in db8500_sys_set_mode()
156 pzone->mode = mode; in db8500_sys_set_mode()
158 schedule_work(&pzone->therm_work); in db8500_sys_set_mode()
160 mutex_unlock(&pzone->th_lock); in db8500_sys_set_mode()
169 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_sys_get_trip_type() local
170 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in db8500_sys_get_trip_type()
184 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_sys_get_trip_temp() local
185 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in db8500_sys_get_trip_temp()
199 struct db8500_thermal_zone *pzone = thermal->devdata; in db8500_sys_get_crit_temp() local
200 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in db8500_sys_get_crit_temp()
225 static void db8500_thermal_update_config(struct db8500_thermal_zone *pzone, in db8500_thermal_update_config() argument
231 pzone->cur_index = idx; in db8500_thermal_update_config()
232 pzone->cur_temp_pseudo = (next_low + next_high)/2; in db8500_thermal_update_config()
233 pzone->trend = trend; in db8500_thermal_update_config()
241 struct db8500_thermal_zone *pzone = irq_data; in prcmu_low_irq_handler() local
242 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in prcmu_low_irq_handler()
243 unsigned int idx = pzone->cur_index; in prcmu_low_irq_handler()
259 db8500_thermal_update_config(pzone, idx, THERMAL_TREND_DROPPING, in prcmu_low_irq_handler()
262 dev_dbg(&pzone->therm_dev->device, in prcmu_low_irq_handler()
265 schedule_work(&pzone->therm_work); in prcmu_low_irq_handler()
272 struct db8500_thermal_zone *pzone = irq_data; in prcmu_high_irq_handler() local
273 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in prcmu_high_irq_handler()
274 unsigned int idx = pzone->cur_index; in prcmu_high_irq_handler()
282 db8500_thermal_update_config(pzone, idx, THERMAL_TREND_RAISING, in prcmu_high_irq_handler()
285 dev_dbg(&pzone->therm_dev->device, in prcmu_high_irq_handler()
288 pzone->cur_temp_pseudo = ptrips->trip_points[idx].temp + 1; in prcmu_high_irq_handler()
290 schedule_work(&pzone->therm_work); in prcmu_high_irq_handler()
298 struct db8500_thermal_zone *pzone; in db8500_thermal_work() local
300 pzone = container_of(work, struct db8500_thermal_zone, therm_work); in db8500_thermal_work()
302 mutex_lock(&pzone->th_lock); in db8500_thermal_work()
303 cur_mode = pzone->mode; in db8500_thermal_work()
304 mutex_unlock(&pzone->th_lock); in db8500_thermal_work()
309 thermal_zone_device_update(pzone->therm_dev); in db8500_thermal_work()
310 dev_dbg(&pzone->therm_dev->device, "thermal work finished.\n"); in db8500_thermal_work()
392 struct db8500_thermal_zone *pzone = NULL; in db8500_thermal_probe() local
406 pzone = devm_kzalloc(&pdev->dev, sizeof(*pzone), GFP_KERNEL); in db8500_thermal_probe()
407 if (!pzone) in db8500_thermal_probe()
410 mutex_init(&pzone->th_lock); in db8500_thermal_probe()
411 mutex_lock(&pzone->th_lock); in db8500_thermal_probe()
413 pzone->mode = THERMAL_DEVICE_DISABLED; in db8500_thermal_probe()
414 pzone->trip_tab = ptrips; in db8500_thermal_probe()
416 INIT_WORK(&pzone->therm_work, db8500_thermal_work); in db8500_thermal_probe()
427 "dbx500_temp_low", pzone); in db8500_thermal_probe()
442 "dbx500_temp_high", pzone); in db8500_thermal_probe()
448 pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone", in db8500_thermal_probe()
449 ptrips->num_trips, 0, pzone, &thdev_ops, NULL, 0, 0); in db8500_thermal_probe()
451 if (IS_ERR(pzone->therm_dev)) { in db8500_thermal_probe()
453 ret = PTR_ERR(pzone->therm_dev); in db8500_thermal_probe()
461 db8500_thermal_update_config(pzone, 0, THERMAL_TREND_STABLE, in db8500_thermal_probe()
464 platform_set_drvdata(pdev, pzone); in db8500_thermal_probe()
465 pzone->mode = THERMAL_DEVICE_ENABLED; in db8500_thermal_probe()
468 mutex_unlock(&pzone->th_lock); in db8500_thermal_probe()
475 struct db8500_thermal_zone *pzone = platform_get_drvdata(pdev); in db8500_thermal_remove() local
477 thermal_zone_device_unregister(pzone->therm_dev); in db8500_thermal_remove()
478 cancel_work_sync(&pzone->therm_work); in db8500_thermal_remove()
479 mutex_destroy(&pzone->th_lock); in db8500_thermal_remove()
487 struct db8500_thermal_zone *pzone = platform_get_drvdata(pdev); in db8500_thermal_suspend() local
489 flush_work(&pzone->therm_work); in db8500_thermal_suspend()
497 struct db8500_thermal_zone *pzone = platform_get_drvdata(pdev); in db8500_thermal_resume() local
498 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab; in db8500_thermal_resume()
504 db8500_thermal_update_config(pzone, 0, THERMAL_TREND_STABLE, in db8500_thermal_resume()