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
67 * TODO: There is no PRCMU interface to get temperature data currently, in db8500_thermal_get_temp()
69 * and this will be fixed when the PRCMU interface is available. in db8500_thermal_get_temp()
71 *temp = th->interpolated_temp; in db8500_thermal_get_temp()
87 th->cur_index = idx; in db8500_thermal_update_config()
88 th->interpolated_temp = (next_low + next_high)/2; in db8500_thermal_update_config()
91 * The PRCMU accept absolute temperatures in celsius so divide in db8500_thermal_update_config()
101 unsigned int idx = th->cur_index; in prcmu_low_irq_handler()
112 next_high = db8500_thermal_points[idx - 1]; in prcmu_low_irq_handler()
113 next_low = db8500_thermal_points[idx - 2]; in prcmu_low_irq_handler()
115 idx -= 1; in prcmu_low_irq_handler()
118 dev_dbg(th->dev, in prcmu_low_irq_handler()
119 "PRCMU set max %ld, min %ld\n", next_high, next_low); in prcmu_low_irq_handler()
121 thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED); in prcmu_low_irq_handler()
129 unsigned int idx = th->cur_index; in prcmu_high_irq_handler()
133 if (idx < num_points - 1) { in prcmu_high_irq_handler()
140 dev_dbg(th->dev, in prcmu_high_irq_handler()
141 "PRCMU set max %ld, min %ld\n", next_high, next_low); in prcmu_high_irq_handler()
142 } else if (idx == num_points - 1) in prcmu_high_irq_handler()
144 th->interpolated_temp = db8500_thermal_points[idx] + 1; in prcmu_high_irq_handler()
146 thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED); in prcmu_high_irq_handler()
154 struct device *dev = &pdev->dev; in db8500_thermal_probe()
159 return -ENOMEM; in db8500_thermal_probe()
161 th->dev = dev; in db8500_thermal_probe()
188 th->tz = devm_thermal_of_zone_register(dev, 0, th, &thdev_ops); in db8500_thermal_probe()
189 if (IS_ERR(th->tz)) { in db8500_thermal_probe()
191 return PTR_ERR(th->tz); in db8500_thermal_probe()
224 { .compatible = "stericsson,db8500-thermal" },
231 .name = "db8500-thermal",
242 MODULE_DESCRIPTION("DB8500 thermal driver");