thermal: ti-soc-thermal: Simplify polling with iopoll
authorTony Lindgren <tony@atomide.com>
Fri, 5 Feb 2021 13:45:33 +0000 (15:45 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 15 Feb 2021 20:19:23 +0000 (21:19 +0100)
commit514cbabb01422d501d533a6495b924e4c22d4822
treee180bd6705ee6f295a526badf138c2b7efaf8744
parent735c35352aa615026b3544a92ad203da2e551590
thermal: ti-soc-thermal: Simplify polling with iopoll

We can use iopoll for checking the EOCZ (end of conversion) bit. And with
this we now also want to handle the timeout errors properly.

For omap3, we need about 1.2ms for the single mode sampling to wait for
EOCZ down, so let's use 1.5ms timeout there. Waiting for sampling to start
is faster and we can use 1ms timeout.

Cc: Adam Ford <aford173@gmail.com>
Cc: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-by: Adam Ford <aford173@gmail.com> #logicpd-torpedo-37xx-devkit
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210205134534.49200-4-tony@atomide.com
drivers/thermal/ti-soc-thermal/ti-bandgap.c