1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- From 4eead70db74922bc61e9d0b4591524369a335751 Mon Sep 17 00:00:00 2001
- From: Amjad Ouled-Ameur <[email protected]>
- Date: Fri, 27 Jan 2023 16:44:46 +0100
- Subject: [PATCH 13/42] thermal/drivers/mediatek: Add delay after thermal banks
- initialization
- Thermal sensor reads performed immediately after thermal bank
- initialization returns bogus values. This is currently tackled by returning
- 0 if the temperature is bogus (exceeding 200000).
- Instead, add a delay between the bank init and the thermal zone device
- register to properly fix this.
- Signed-off-by: Michael Kao <[email protected]>
- Signed-off-by: Hsin-Yi Wang <[email protected]>
- Signed-off-by: Amjad Ouled-Ameur <[email protected]>
- Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
- Link: https://lore.kernel.org/r/[email protected]
- Signed-off-by: Daniel Lezcano <[email protected]>
- ---
- drivers/thermal/mediatek/auxadc_thermal.c | 11 +++--------
- 1 file changed, 3 insertions(+), 8 deletions(-)
- --- a/drivers/thermal/mediatek/auxadc_thermal.c
- +++ b/drivers/thermal/mediatek/auxadc_thermal.c
- @@ -816,14 +816,6 @@ static int mtk_thermal_bank_temperature(
- mt, conf->bank_data[bank->id].sensors[i], raw);
-
-
- - /*
- - * The first read of a sensor often contains very high bogus
- - * temperature value. Filter these out so that the system does
- - * not immediately shut down.
- - */
- - if (temp > 200000)
- - temp = 0;
- -
- if (temp > max)
- max = temp;
- }
- @@ -1281,6 +1273,9 @@ static int mtk_thermal_probe(struct plat
-
- platform_set_drvdata(pdev, mt);
-
- + /* Delay for thermal banks to be ready */
- + msleep(30);
- +
- tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt,
- &mtk_thermal_ops);
- if (IS_ERR(tzdev)) {
|