diff options
author | Rong Chang <rongchang@chromium.org> | 2015-07-07 16:33:26 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-25 13:11:19 +0000 |
commit | f3a5046ed7eac6081680b85fa45b7767c421bd19 (patch) | |
tree | 2455faa5093f1e571f5c2cf3d58c75f487a6644d /board/oak | |
parent | 1155520c8a07ef9f9f5066223cb4c0c34e2bf031 (diff) | |
download | chrome-ec-f3a5046ed7eac6081680b85fa45b7767c421bd19.tar.gz |
glados: oak: Add charger AMONBMON console command
AMONBMON is a charger feature to measure input current and battery output
current. ISL9237 output analog value of voltage diff across sense
resistor to EC's ADC channel. This change also reorders oak's ADC channel
to fix a reading bug.
BRANCH=none
BUG=chrome-os-partner:42270
TEST=manual
in EC serial console, type command 'adc' and check AMON_BMON value.
type command 'amonbmon' and check AC current and BAT current.
Change-Id: I9db0a72be7c9a428a16d1609eb8c461c6928e548
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/283665
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board/oak')
-rw-r--r-- | board/oak/board.c | 5 | ||||
-rw-r--r-- | board/oak/board.h | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/board/oak/board.c b/board/oak/board.c index dd4639a7fe..ffe5ddf049 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -5,6 +5,7 @@ /* Oak board configuration */ +#include "adc.h" #include "adc_chip.h" #include "battery.h" #include "charge_manager.h" @@ -67,8 +68,6 @@ BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); /* ADC channels */ const struct adc_t adc_channels[] = { - /* VDC_BOOSTIN_SENSE(PC1): ADC_IN11, output in mV */ - [ADC_VBUS] = {"VBUS", 33000, 4096, 0, STM32_AIN(11)}, /* * PSYS_MONITOR(PA2): ADC_IN2, 1.44 uA/W on 6.05k Ohm * output in mW @@ -76,6 +75,8 @@ const struct adc_t adc_channels[] = { [ADC_PSYS] = {"PSYS", 379415, 4096, 0, STM32_AIN(2)}, /* AMON_BMON(PC0): ADC_IN10, output in uV */ [ADC_AMON_BMON] = {"AMON_BMON", 183333, 4096, 0, STM32_AIN(10)}, + /* VDC_BOOSTIN_SENSE(PC1): ADC_IN11, output in mV */ + [ADC_VBUS] = {"VBUS", 33000, 4096, 0, STM32_AIN(11)}, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); diff --git a/board/oak/board.h b/board/oak/board.h index 7f10cf55f9..f2ef24500e 100644 --- a/board/oak/board.h +++ b/board/oak/board.h @@ -34,6 +34,7 @@ #define CONFIG_CHARGER_SENSE_RESISTOR_AC 20 #endif /* BOARD_REV */ +#define CONFIG_CHARGER_ADC_AMON_BMON #define CONFIG_CHARGER_DISCHARGE_ON_AC #define CONFIG_CHARGER_V2 #define CONFIG_CHIPSET_MEDIATEK @@ -142,9 +143,9 @@ enum pwm_channel { }; enum adc_channel { - ADC_VBUS = 0, - ADC_PSYS, - ADC_AMON_BMON, + ADC_PSYS = 0, /* PC1: STM32_AIN(2) */ + ADC_AMON_BMON, /* PC0: STM32_AIN(10) */ + ADC_VBUS, /* PA2: STM32_AIN(11) */ ADC_CH_COUNT }; |