mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 01:50:53 +00:00
Some boards didn't define the CONFIG_TEMP_SENSOR_POWER_GPIO (such as: Oak),
Due to the hardware design, the power of temp sensor is always on.
But, we can enable/disable the temperature measurement circuitry of tmp432 by
setup the shutdown (SD) bit. Add a new API: tmp432_set_power() to let upper
layer to control the power of tmp432 by SW approach for power saving.
BRANCH=none
BUG=chrome-os-partner:44170
TEST=manual
1. make BOARD=oak -j
2. Turn off the TMP432:
> tmp432 power off
3. check whether tmp432 is shutdown:
> tmp432
ERROR: Temp sensor not powered.
Not Powered
4. Turn on the TMP432:
> tmp432 power on
5. check whether tmp432 is running:
> tmp432
Local:
Temp 29C
Therm Trip 85C
High Alarm 85C
Low Alarm 0C
Remote1:
Temp 27C
Therm Trip 85C
High Alarm 85C
Low Alarm 0C
Remote2:
Temp 27C
Therm Trip 85C
High Alarm 85C
Low Alarm 0C
STATUS: 10000000
CONFIG1: 00000000
CONFIG2: 00111100
Change-Id: Iab95c4c0b0130baf3bce380a8132e08ded8d159e
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/295058
Reviewed-by: Rong Chang <rongchang@chromium.org>