Lines Matching +full:db8500 +full:- +full:prcmu
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * db8500_thermal.c - DB8500 Thermal Management Implementation
5 * Copyright (C) 2012 ST-Ericsson
6 * Copyright (C) 2012-2019 Linaro Ltd.
13 #include <linux/mfd/dbx500-prcmu.h>
24 * db8500_thermal_points - the interpolation points that trigger
63 struct db8500_thermal_zone *th = tz->devdata; in db8500_thermal_get_temp()
66 * TODO: There is no PRCMU interface to get temperature data currently, in db8500_thermal_get_temp()
68 * and this will be fixed when the PRCMU interface is available. in db8500_thermal_get_temp()
70 *temp = th->interpolated_temp; in db8500_thermal_get_temp()
86 th->cur_index = idx; in db8500_thermal_update_config()
87 th->interpolated_temp = (next_low + next_high)/2; in db8500_thermal_update_config()
90 * The PRCMU accept absolute temperatures in celsius so divide in db8500_thermal_update_config()
100 unsigned int idx = th->cur_index; in prcmu_low_irq_handler()
111 next_high = db8500_thermal_points[idx - 1]; in prcmu_low_irq_handler()
112 next_low = db8500_thermal_points[idx - 2]; in prcmu_low_irq_handler()
114 idx -= 1; in prcmu_low_irq_handler()
117 dev_dbg(&th->tz->device, in prcmu_low_irq_handler()
118 "PRCMU set max %ld, min %ld\n", next_high, next_low); in prcmu_low_irq_handler()
120 thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED); in prcmu_low_irq_handler()
128 unsigned int idx = th->cur_index; in prcmu_high_irq_handler()
132 if (idx < num_points - 1) { in prcmu_high_irq_handler()
139 dev_dbg(&th->tz->device, in prcmu_high_irq_handler()
140 "PRCMU set max %ld, min %ld\n", next_high, next_low); in prcmu_high_irq_handler()
141 } else if (idx == num_points - 1) in prcmu_high_irq_handler()
143 th->interpolated_temp = db8500_thermal_points[idx] + 1; in prcmu_high_irq_handler()
145 thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED); in prcmu_high_irq_handler()
153 struct device *dev = &pdev->dev; in db8500_thermal_probe()
158 return -ENOMEM; in db8500_thermal_probe()
185 th->tz = devm_thermal_of_zone_register(dev, 0, th, &thdev_ops); in db8500_thermal_probe()
186 if (IS_ERR(th->tz)) { in db8500_thermal_probe()
188 return PTR_ERR(th->tz); in db8500_thermal_probe()
221 { .compatible = "stericsson,db8500-thermal" },
228 .name = "db8500-thermal",
239 MODULE_DESCRIPTION("DB8500 thermal driver");