From 1cdd0d9b31958f00f573e30b7144cde2fa7d59e4 Mon Sep 17 00:00:00 2001 From: ChromeOS Developer Date: Tue, 18 Feb 2014 16:00:39 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/187018 Reviewed-by: Randall Spangler Reviewed-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/187887 --- board/rambi/board.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'board/rambi/board.c') 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); -- cgit v1.2.1