• Home
  • Raw
  • Download

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()
81 *trend = th->trend; in db8500_thermal_get_trend()
99 th->cur_index = idx; in db8500_thermal_update_config()
100 th->interpolated_temp = (next_low + next_high)/2; in db8500_thermal_update_config()
101 th->trend = trend; in db8500_thermal_update_config()
104 * The PRCMU accept absolute temperatures in celsius so divide in db8500_thermal_update_config()
114 unsigned int idx = th->cur_index; in prcmu_low_irq_handler()
125 next_high = db8500_thermal_points[idx - 1]; in prcmu_low_irq_handler()
126 next_low = db8500_thermal_points[idx - 2]; in prcmu_low_irq_handler()
128 idx -= 1; in prcmu_low_irq_handler()
132 dev_dbg(&th->tz->device, in prcmu_low_irq_handler()
133 "PRCMU set max %ld, min %ld\n", next_high, next_low); in prcmu_low_irq_handler()
135 thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED); in prcmu_low_irq_handler()
143 unsigned int idx = th->cur_index; in prcmu_high_irq_handler()
147 if (idx < num_points - 1) { in prcmu_high_irq_handler()
155 dev_dbg(&th->tz->device, in prcmu_high_irq_handler()
156 "PRCMU set max %ld, min %ld\n", next_high, next_low); in prcmu_high_irq_handler()
157 } else if (idx == num_points - 1) in prcmu_high_irq_handler()
159 th->interpolated_temp = db8500_thermal_points[idx] + 1; in prcmu_high_irq_handler()
161 thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED); in prcmu_high_irq_handler()
169 struct device *dev = &pdev->dev; in db8500_thermal_probe()
174 return -ENOMEM; in db8500_thermal_probe()
205 th->tz = devm_thermal_zone_of_sensor_register(dev, 0, th, &thdev_ops); in db8500_thermal_probe()
206 if (IS_ERR(th->tz)) { in db8500_thermal_probe()
208 return PTR_ERR(th->tz); in db8500_thermal_probe()
243 { .compatible = "stericsson,db8500-thermal" },
250 .name = "db8500-thermal",
261 MODULE_DESCRIPTION("DB8500 thermal driver");