[PATCH v2 15/17] thermal: uniphier: enable+check sensor after its setup is finished

From: Bartlomiej Zolnierkiewicz
Date: Wed Oct 17 2018 - 11:54:53 EST


Enable sensor after checking trip points (unipher_tm_enable_sensor()
enables IRQ so we need to toggle sensor before calling it) and check
sensor after doing chipset specific enable sensor operation.

Cc: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@xxxxxxxxxxx>
---
drivers/thermal/uniphier_thermal.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/uniphier_thermal.c b/drivers/thermal/uniphier_thermal.c
index ed3a920..9ccc1fc 100644
--- a/drivers/thermal/uniphier_thermal.c
+++ b/drivers/thermal/uniphier_thermal.c
@@ -307,9 +307,6 @@ static int uniphier_tm_probe(struct platform_device *pdev)
return PTR_ERR(tdev->tz_dev);
}

- thermal_zone_set_mode(tdev->tz_dev, THERMAL_DEVICE_ENABLED);
- thermal_zone_device_check(tdev->tz_dev);
-
/* get trip points */
trips = of_thermal_get_trip_points(tdev->tz_dev);
ntrips = of_thermal_get_ntrips(tdev->tz_dev);
@@ -332,8 +329,12 @@ static int uniphier_tm_probe(struct platform_device *pdev)
return -EINVAL;
}

+ thermal_zone_set_mode(tdev->tz_dev, THERMAL_DEVICE_ENABLED);
+
uniphier_tm_enable_sensor(tdev);

+ thermal_zone_device_check(tdev->tz_dev);
+
return 0;
}

--
1.9.1