From 9ef1edbc3bc25988acf8d40c24002d961ccea86d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 21 Apr 2021 09:43:59 +1200 Subject: zephyr: adc: Add an empty enum when not ADC is present At present we get warnings when adc.h is included but there is no ADC available, such as with posix-ec. Correct this by adding an empty enum in this case. BUG=none BRANCH=none TEST=CQ Signed-off-by: Simon Glass Change-Id: I139c48d0de860657036d071e596dea426225b52d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842205 Reviewed-by: Denis Brockus Commit-Queue: Denis Brockus --- zephyr/shim/include/zephyr_adc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zephyr/shim/include/zephyr_adc.h b/zephyr/shim/include/zephyr_adc.h index 25ef530e17..fb63407c16 100644 --- a/zephyr/shim/include/zephyr_adc.h +++ b/zephyr/shim/include/zephyr_adc.h @@ -28,6 +28,11 @@ struct adc_t { }; extern const struct adc_t adc_channels[]; +#else +/* Empty declaration to avoid warnings if adc.h is included */ +enum adc_channel { + ADC_CH_COUNT +}; #endif /* CONFIG_PLATFORM_EC_ADC */ #endif /* __CROS_EC_ZEPHYR_ADC_H */ -- cgit v1.2.1