diff options
author | ChromeOS Developer <dparker@chromium.org> | 2014-02-18 16:00:39 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-02-26 01:52:50 +0000 |
commit | 1cdd0d9b31958f00f573e30b7144cde2fa7d59e4 (patch) | |
tree | bdbff39ae7af7ca48bca88944c11b8cf6898687b | |
parent | 2ecefeb0eb250a0f40dfb02fd1aca8b21d7dd2d6 (diff) | |
download | chrome-ec-1cdd0d9b31958f00f573e30b7144cde2fa7d59e4.tar.gz |
BayTrail: Fix ADC adapter current calculation
BUG=chrome-os-partner:25977
BRANCH=None
TEST=Run 'adc' console command on a heavily loaded system while
charging the battery. The current reported should be around the
CONFIG_CHARGER_INPUT_CURRENT limit.
Change-Id: I1b4089d00182ce7d286b387361a63edade626f38
Original-Change-Id: I18e5bbb0a45312afbcb7d989517a86b97646c2da
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/187018
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/187887
-rw-r--r-- | board/rambi/board.c | 8 | ||||
-rw-r--r-- | board/squawks/board.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/board/rambi/board.c b/board/rambi/board.c index 75ad5fd4e0..03912f5e00 100644 --- a/board/rambi/board.c +++ b/board/rambi/board.c @@ -152,12 +152,12 @@ const struct adc_t adc_channels[] = { LM4_AIN_NONE, 0x0e /* TS0 | IE0 | END0 */, 0, 0}, /* IOUT == ICMNT is on PE3/AIN0 */ - /* We have 0.01-ohm resistors, and IOUT is 20X the differential - * voltage, so 1000mA ==> 200mV. + /* We have 0.01-ohm resistors, and IOUT is 40X the differential + * voltage, so 1000mA ==> 400mV. * ADC returns 0x000-0xFFF, which maps to 0.0-3.3V (as configured). - * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3300 / 200 + * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3300 / 400 */ - {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 2, 0, + {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 4, 0, LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)}, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); diff --git a/board/squawks/board.c b/board/squawks/board.c index fd22aecc78..150be8a911 100644 --- a/board/squawks/board.c +++ b/board/squawks/board.c @@ -152,12 +152,12 @@ const struct adc_t adc_channels[] = { LM4_AIN_NONE, 0x0e /* TS0 | IE0 | END0 */, 0, 0}, /* IOUT == ICMNT is on PE3/AIN0 */ - /* We have 0.01-ohm resistors, and IOUT is 20X the differential - * voltage, so 1000mA ==> 200mV. + /* We have 0.01-ohm resistors, and IOUT is 40X the differential + * voltage, so 1000mA ==> 400mV. * ADC returns 0x000-0xFFF, which maps to 0.0-3.3V (as configured). - * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3300 / 200 + * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3300 / 400 */ - {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 2, 0, + {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 4, 0, LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)}, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); |