Skip to content

Commit

Permalink
ti-soc-thermal: request temperature periodically if hw can't do that …
Browse files Browse the repository at this point in the history
…itself

When periodic mode is not enabled, it is neccessary to force reads.

Signed-off-by: Pavel Machek <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
  • Loading branch information
pavelmachek authored and Eduardo Valentin committed May 5, 2015
1 parent a4296d1 commit 95d079e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/thermal/ti-soc-thermal/ti-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/

/**
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 95d079e

Please sign in to comment.