From 6e3c061c4baae0e3169ee5371462615f5153fbed Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Thu, 14 Nov 2019 15:36:28 +1100 Subject: puff: Add config for power sensors. Add config for INA3221 power monitor sensors. BRANCH=none BUG=b:144127082 TEST=EC buildall Change-Id: I87b3da86403b0ec7314b4084bc710c59f019930d Signed-off-by: Andrew McRae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1915481 Tested-by: Andrew McRae Reviewed-by: Peter Marheine Commit-Queue: Andrew McRae --- board/puff/board.c | 9 +++++++++ board/puff/board.h | 1 + 2 files changed, 10 insertions(+) diff --git a/board/puff/board.c b/board/puff/board.c index 02ade160fd..77d632b9a3 100644 --- a/board/puff/board.c +++ b/board/puff/board.c @@ -10,6 +10,7 @@ #include "button.h" #include "common.h" #include "cros_board_info.h" +#include "driver/ina3221.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx7447.h" #include "driver/tcpm/ps8xxx.h" @@ -210,6 +211,14 @@ struct ec_thermal_config thermal_params[] = { }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); +/* Power sensors */ +const struct ina3221_t ina3221[] = { + { I2C_PORT_INA, 0x40, { "PP3300_G", "PP5000_A", "PP3300_WLAN" } }, + { I2C_PORT_INA, 0x42, { "PP3300_A", "PP3300_SSD", "PP3300_LAN" } }, + { I2C_PORT_INA, 0x43, { NULL, "PP1200_U", "PP2500_DRAM" } } +}; +const unsigned int ina3221_count = ARRAY_SIZE(ina3221); + static void board_init(void) { } diff --git a/board/puff/board.h b/board/puff/board.h index f038650dfb..374ed9aebe 100644 --- a/board/puff/board.h +++ b/board/puff/board.h @@ -96,6 +96,7 @@ #define CONFIG_POWER_S0IX #define CONFIG_POWER_S0IX_FAILURE_DETECTION #define CONFIG_POWER_TRACK_HOST_SLEEP_STATE +#define CONFIG_INA3221 /* TODO: (b/143501304) Use correct PD delay values */ #define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */ -- cgit v1.2.1