Skip to content

Commit 78aefd2

Browse files
Niklas SöderlundEduardo Valentin
authored andcommitted
thermal: rcar_gen3_thermal: add delay in .thermal_init on r8a7796
The .thermal_init needs to be delayed a short amount of time to allow for the TEMP register to contain something useful. If it's not delayed these warnings are common during boot: thermal thermal_zone0: failed to read out thermal zone (-5) thermal thermal_zone1: failed to read out thermal zone (-5) thermal thermal_zone2: failed to read out thermal zone (-5) The warnings are triggered by the first call to .get_temp() while the TEMP register contains 0 and rcar_gen3_thermal_get_temp() returns -EIO since a TEMP value of 0 will result in a temperature reading which is out of specifications. This should have been done in the initial commit which adds the driver as the same issue was found and corrected for r8a7795. Fixes: 564e73d ("thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver") Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
1 parent b263b47 commit 78aefd2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/thermal/rcar_gen3_thermal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ static void r8a7796_thermal_init(struct rcar_gen3_thermal_tsc *tsc)
222222
reg_val = rcar_gen3_thermal_read(tsc, REG_GEN3_THCTR);
223223
reg_val |= THCTR_THSST;
224224
rcar_gen3_thermal_write(tsc, REG_GEN3_THCTR, reg_val);
225+
226+
usleep_range(1000, 2000);
225227
}
226228

227229
static const struct rcar_gen3_thermal_data r8a7795_data = {

0 commit comments

Comments
 (0)