diff options
author | Pavel Machek <pavel@ucw.cz> | 2015-03-24 23:20:21 +0100 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2015-05-04 21:27:54 -0700 |
commit | 95d079ef6710e0f60dd87d887a3cfee5bf25af5f (patch) | |
tree | 40302ee95a3a6123f23fd39f58f8f69814ed0bb0 /drivers/thermal | |
parent | a4296d19b5e19a5c9a3979e9595fa26c40af67b5 (diff) |
ti-soc-thermal: request temperature periodically if hw can't do that itself
When periodic mode is not enabled, it is neccessary to force reads.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/ti-soc-thermal/ti-bandgap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index 12f3ee5337bb..63e2f5ce7e94 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c @@ -43,6 +43,8 @@ #include "ti-bandgap.h" +static int ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id); + /*** Helper functions to access registers and their bitfields ***/ /** @@ -829,6 +831,12 @@ int ti_bandgap_read_temperature(struct ti_bandgap *bgp, int id, if (ret) return ret; + if (!TI_BANDGAP_HAS(bgp, MODE_CONFIG)) { + ret = ti_bandgap_force_single_read(bgp, id); + if (ret) + return ret; + } + spin_lock(&bgp->lock); temp = ti_bandgap_read_temp(bgp, id); spin_unlock(&bgp->lock); |