mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-13 03:15:06 +00:00
yorp: Add battery temperature sensor
BUG=b:79940719
BRANCH=None
TEST=On yorp: Test if ectool tempsinfo all lists
battery sensor.
Change-Id: Ib70872cc8f91d322120714a9147dbdd8e40432aa
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1060577
Commit-Ready: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
3c6894cacc
commit
f736ed2e60
@@ -169,8 +169,27 @@ int board_get_ambient_temp(int idx, int *temp_ptr)
|
||||
}
|
||||
|
||||
const struct temp_sensor_t temp_sensors[] = {
|
||||
{"Ambient", TEMP_SENSOR_TYPE_BOARD, board_get_ambient_temp, 0, 5},
|
||||
{"Charger", TEMP_SENSOR_TYPE_BOARD, board_get_charger_temp, 1, 1},
|
||||
{
|
||||
.name = "Battery",
|
||||
.type = TEMP_SENSOR_TYPE_BATTERY,
|
||||
.read = charge_get_battery_temp,
|
||||
.idx = 0,
|
||||
.action_delay_sec = 1
|
||||
},
|
||||
{
|
||||
.name = "Ambient",
|
||||
.type = TEMP_SENSOR_TYPE_BOARD,
|
||||
.read = board_get_ambient_temp,
|
||||
.idx = 0,
|
||||
.action_delay_sec = 5
|
||||
},
|
||||
{
|
||||
.name = "Charger",
|
||||
.type = TEMP_SENSOR_TYPE_BOARD,
|
||||
.read = board_get_charger_temp,
|
||||
.idx = 1,
|
||||
.action_delay_sec = 1
|
||||
},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ enum adc_channel {
|
||||
};
|
||||
|
||||
enum temp_sensor_id {
|
||||
TEMP_SENSOR_AMBIENT = 0,
|
||||
TEMP_SENSOR_BATTERY,
|
||||
TEMP_SENSOR_AMBIENT,
|
||||
TEMP_SENSOR_CHARGER,
|
||||
TEMP_SENSOR_COUNT
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user