summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2021-08-23 18:33:49 -0700
committerCommit Bot <commit-bot@chromium.org>2021-08-27 01:27:45 +0000
commit1943b1cb01ac1ee67cd8cfead61a2f1acdcdff08 (patch)
tree42d659c13d912a3d3e766d5c527e9aca41d25900 /include
parent61eb74b2ebe6c246d0d16caac9472ad880bf71fe (diff)
downloadchrome-ec-1943b1cb01ac1ee67cd8cfead61a2f1acdcdff08.tar.gz
adc: Allow runtime config of adc_channels
This adds the CONFIG_ADC_CHANNELS_RUNTIME_CONFIG config option to allow the adc_channels array to be tweaked at runtime. BRANCH=none BUG=b:183452273,b:181271666 TEST=buildall passes Change-Id: I1241012b6e36c19baa7fe80853a6c6de4affeefa Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116990 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/adc.h4
-rw-r--r--include/config.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/include/adc.h b/include/adc.h
index b52798419a..8342bc1fb6 100644
--- a/include/adc.h
+++ b/include/adc.h
@@ -21,7 +21,11 @@
* Boards must provide this list of ADC channel definitions. This must match
* the enum adc_channel list provided by the board.
*/
+#ifndef CONFIG_ADC_CHANNELS_RUNTIME_CONFIG
extern const struct adc_t adc_channels[];
+#else
+extern struct adc_t adc_channels[];
+#endif
/*
* Boards which use the ADC interface must provide enum adc_channel in the
diff --git a/include/config.h b/include/config.h
index 057ae9b8b7..807fd52f17 100644
--- a/include/config.h
+++ b/include/config.h
@@ -299,6 +299,11 @@
#undef CONFIG_ADC
/*
+ * Allow runtime configuration of the adc_channels[] array
+ */
+#undef CONFIG_ADC_CHANNELS_RUNTIME_CONFIG
+
+/*
* ADC sample time selection. The value is chip-dependent.
* TODO: Replace this with CONFIG_ADC_PROFILE entries.
*/