diff options
author | Vic Yang <victoryang@chromium.org> | 2013-04-30 20:02:58 +0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-30 10:38:43 -0700 |
commit | c08e0ade765bf69fb9ab3f62305a84a4d3d34c1d (patch) | |
tree | 7392ff1c7148233efc85dd86dc90092d7d53f72f /test/stress.c | |
parent | 115ab924fc16e8d8403433b243b1fabb53e42dac (diff) | |
download | chrome-ec-c08e0ade765bf69fb9ab3f62305a84a4d3d34c1d.tar.gz |
Fix ADC test for LM4
LM4 doesn't have implementation of adc_read_all_channels(). Let's use
adc_read_channel() in this case.
BUG=chrome-os-partner:18598
TEST=Build stress test for link. See no error about
adc_read_all_channels() undefined.
BRANCH=None
Change-Id: I5b13384468667cbd17b83faab9f9d3fdc48de91d
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49589
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'test/stress.c')
-rw-r--r-- | test/stress.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/stress.c b/test/stress.c index ecd975f712..8a69d84b19 100644 --- a/test/stress.c +++ b/test/stress.c @@ -126,6 +126,20 @@ static int test_i2c(void) #endif #ifdef CONFIG_ADC +__attribute__((weak)) int adc_read_all_channels(int *data) +{ + int i; + int rv = EC_SUCCESS; + + for (i = 0 ; i < ADC_CH_COUNT; ++i) { + data[i] = adc_read_channel(i); + if (data[i] == ADC_READ_ERROR) + rv = EC_ERROR_UNKNOWN; + } + + return rv; +} + static int test_adc(void) { int data[ADC_CH_COUNT]; |