diff options
author | Diana Z <dzigterman@chromium.org> | 2021-06-04 15:03:11 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-07 23:41:31 +0000 |
commit | eb26a5557b189dc45c38fd04b580a016bcd5880d (patch) | |
tree | 2979a06c06975df7d2011a1f5ca6e669d23cf50b | |
parent | f36c5bd34a2399e1c73411162b46fe993af4d02b (diff) | |
download | chrome-ec-eb26a5557b189dc45c38fd04b580a016bcd5880d.tar.gz |
TMP112: Make init externally available
Since not all boards will power the TMP112 in all power states, allow
boards to trigger init themselves when they power up the chip.
BRANCH=None
BUG=b:188539950
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Id24f559d745e86cdcf2f39a10111decc0797bf28
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940574
Reviewed-by: Rob Barnes <robbarnes@google.com>
-rw-r--r-- | driver/temp_sensor/tmp112.c | 2 | ||||
-rw-r--r-- | driver/temp_sensor/tmp112.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/driver/temp_sensor/tmp112.c b/driver/temp_sensor/tmp112.c index 3eed42469b..064bc70301 100644 --- a/driver/temp_sensor/tmp112.c +++ b/driver/temp_sensor/tmp112.c @@ -91,7 +91,7 @@ static void tmp112_poll(void) } DECLARE_HOOK(HOOK_SECOND, tmp112_poll, HOOK_PRIO_TEMP_SENSOR); -static void tmp112_init(void) +void tmp112_init(void) { int tmp, s, rv; int set_mask, clr_mask; diff --git a/driver/temp_sensor/tmp112.h b/driver/temp_sensor/tmp112.h index af9506ec5b..fce7edc15b 100644 --- a/driver/temp_sensor/tmp112.h +++ b/driver/temp_sensor/tmp112.h @@ -44,4 +44,11 @@ extern const struct tmp112_sensor_t tmp112_sensors[]; */ int tmp112_get_val(int idx, int *temp_ptr); +/** + * Init the sensors. Note, this will run automatically on HOOK_INIT, but is + * made available for boards which may not always power the sensor in all + * states. + */ +void tmp112_init(void); + #endif /* __CROS_EC_TMP112_H */ |