diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-07-29 17:53:59 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-08-02 13:32:09 +0200 |
commit | 5df9809c424fb889eb4ad44f856196d86aa389f7 (patch) | |
tree | ba888462a046457435e20c66af5dfae667f9b7f4 /drivers/thermal | |
parent | a09074228977c24c677c10282f506fa11f88eb93 (diff) | |
download | linux-5df9809c424fb889eb4ad44f856196d86aa389f7.tar.gz linux-5df9809c424fb889eb4ad44f856196d86aa389f7.tar.bz2 linux-5df9809c424fb889eb4ad44f856196d86aa389f7.zip |
thermal: broadcom: Use thermal_zone_get_crit_temp() in bcm2835_thermal_probe()
Modify the bcm2835 thermal driver to use thermal_zone_get_crit_temp() in
bcm2835_thermal_probe() instead of relying on the assumption that the
critical trip index will always be 0.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/3322893.aeNJFYEL58@rjwysocki.net
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/broadcom/bcm2835_thermal.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c index 5ad87eb3f578..7d61493082b5 100644 --- a/drivers/thermal/broadcom/bcm2835_thermal.c +++ b/drivers/thermal/broadcom/bcm2835_thermal.c @@ -208,8 +208,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) */ val = readl(data->regs + BCM2835_TS_TSENSCTL); if (!(val & BCM2835_TS_TSENSCTL_RSTB)) { - struct thermal_trip trip; - int offset, slope; + int offset, slope, crit_temp; slope = thermal_zone_get_slope(tz); offset = thermal_zone_get_offset(tz); @@ -217,7 +216,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) * For now we deal only with critical, otherwise * would need to iterate */ - err = thermal_zone_get_trip(tz, 0, &trip); + err = thermal_zone_get_crit_temp(tz, &crit_temp); if (err < 0) { dev_err(dev, "Not able to read trip_temp: %d\n", err); return err; @@ -232,7 +231,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) val |= (0xFE << BCM2835_TS_TSENSCTL_RSTDELAY_SHIFT); /* trip_adc value from info */ - val |= bcm2835_thermal_temp2adc(trip.temperature, + val |= bcm2835_thermal_temp2adc(crit_temp, offset, slope) << BCM2835_TS_TSENSCTL_THOLD_SHIFT; |