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>
This commit is contained in:
parent
a4296d19b5
commit
95d079ef67
1 changed files with 8 additions and 0 deletions
|
@ -43,6 +43,8 @@
|
||||||
|
|
||||||
#include "ti-bandgap.h"
|
#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 ***/
|
/*** 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)
|
if (ret)
|
||||||
return 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);
|
spin_lock(&bgp->lock);
|
||||||
temp = ti_bandgap_read_temp(bgp, id);
|
temp = ti_bandgap_read_temp(bgp, id);
|
||||||
spin_unlock(&bgp->lock);
|
spin_unlock(&bgp->lock);
|
||||||
|
|
Loading…
Add table
Reference in a new issue