summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-05-09 17:48:38 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-12 20:02:38 +0000
commit18dcf0989e6e6f7dfa10bb50d055fdb9b5101f4e (patch)
treedc9c74078d28ff049b99bdfebbc67055a876b58a
parent3f94eba930ceea47b845acf632660140fa8948d9 (diff)
downloadchrome-ec-18dcf0989e6e6f7dfa10bb50d055fdb9b5101f4e.tar.gz
Samus: Punt on BQ_IBAT measurements for now
Nothing looks at this except for an EC console command, so leave it at unity gain until we've confirmed that it's working correctly. BUG=chrome-os-partner:28721 BRANCH=ToT TEST=make buildall Change-Id: I81085743535f4664ac8bf1d016bb7562046ab49b Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199243 Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--board/samus/board.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/board/samus/board.c b/board/samus/board.c
index 607db79044..bd5c52617b 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -182,19 +182,23 @@ BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
/* ADC channels. Must be in the exactly same order as in enum adc_channel. */
const struct adc_t adc_channels[] = {
- /* EC internal temperature is calculated by
+ /*
+ * EC internal temperature is calculated by
* 273 + (295 - 450 * ADC_VALUE / ADC_READ_MAX) / 2
* = -225 * ADC_VALUE / ADC_READ_MAX + 420.5
*/
{"ECTemp", LM4_ADC_SEQ0, -225, ADC_READ_MAX, 420,
LM4_AIN_NONE, 0x0e /* TS0 | IE0 | END0 */, 0, 0},
- /* We're measuring the adapter input current through a 0.01-ohm
- * resistor (ACP/ACN). IOUT is 40X the differential voltage, so
- * 1000mA => 400mV. ADC returns 0x000-0xFFF over 0.0-3.3V.
- * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3.3(V) * 100(R) / 40(gain)
+ /*
+ * The charger current is measured with a 0.005-ohm
+ * resistor. IBAT is 20X the voltage across that resistor when
+ * charging, and either 8X or 16X (default) when discharging, if it's
+ * even enabled (default is not). Nothing looks at this except the
+ * console command, so let's just leave it at unity gain. The ADC
+ * returns 0x000-0xFFF for 0.0-3.3V. You do the math.
*/
- {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 4, 0,
+ {"ChargerCurrent", LM4_ADC_SEQ1, 1, 1, 0,
LM4_AIN(11), 0x06 /* IE0 | END0 */, LM4_GPIO_B, (1<<5)},
/*