thermal/drivers/rcar_gen3: Update temperature approximation calculation
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Wed, 27 Mar 2024 13:30:13 +0000 (14:30 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 23 Apr 2024 10:40:29 +0000 (12:40 +0200)
commit63d23fb78140a882e268201ff730453cd8b4f8e8
treeb0e87590d137c223df02c0dbcb7eb969ac00eb4a
parent566e0ea7d02ff596d7bcd81ca547e91b5074032f
thermal/drivers/rcar_gen3: Update temperature approximation calculation

The initial driver used a formula to approximate the temperature and
register values reversed engineered from an out-of-tree BSP driver. This
was needed as the datasheet at the time did not contain any information
on how to do this. Later Gen3 (Rev 2.30) and Gen4 (all) now contains
this information.

Update the approximation formula to use the datasheet's information
instead of the reversed-engineered one.

On an idle M3-N without fused calibration values for PTAT and THCODE the
old formula reports,

    zone0: 52000
    zone1: 53000
    zone2: 52500

While the new formula under the same circumstances reports,

    zone0: 52500
    zone1: 54000
    zone2: 54000

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20240327133013.3982199-3-niklas.soderlund+renesas@ragnatech.se
drivers/thermal/rcar_gen3_thermal.c