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>
This commit is contained in:
David Hendricks
2016-07-06 14:02:55 -07:00
committed by chrome-bot
parent affc41cec2
commit 5fb5ccc390

View File

@@ -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);