summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2016-07-06 14:02:55 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-07 14:38:05 -0700
commit5fb5ccc390546ea8370dd7ed63594ddcfc43d7f3 (patch)
treeceeb6044c3cd23a36d097195ddc7457a782b2271 /board
parentaffc41cec2c4c34e84ab0443b27fc652ae798faa (diff)
downloadchrome-ec-5fb5ccc390546ea8370dd7ed63594ddcfc43d7f3.tar.gz
reef: Fix board ID ADC scaling factors
The ADC multiplier and divider factors were lazily set to 1 when the board support was first added, so the value was not scaled properly. The conversion formula is: Vi = CHNnDAT * (Vfs / 1024) where Vfs = Vref = 2.816V for Reef. BUG=none BRANCH=none TEST=added debug print and reading now approximately matches what the voltmeter reads. Change-Id: Ic60a8bc1d84c4f9a7b5664e9daddfa331b6a890c Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/358613 Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com>
Diffstat (limited to 'board')
-rw-r--r--board/reef/board.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/board/reef/board.c b/board/reef/board.c
index 329870d674..06a76317e6 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -98,7 +98,9 @@ BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
/* ADC channels */
const struct adc_t adc_channels[] = {
- [ADC_BOARD_ID] = {"BOARD_ID", NPCX_ADC_CH2, 1, 1, 0},
+ /* Vfs = Vref = 2.816V, 10-bit unsigned reading */
+ [ADC_BOARD_ID] = {"BRD_ID", NPCX_ADC_CH2,
+ ADC_MAX_VOLT, ADC_READ_MAX + 1, 0},
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);