summaryrefslogtreecommitdiff
path: root/zephyr/shim/include/adc_chip.h
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-02-04 13:29:43 +0100
committerCommit Bot <commit-bot@chromium.org>2021-02-09 12:32:11 +0000
commitd68de6a2502dec94eeb3947f0eefc7fd0ab79d63 (patch)
tree52878e7d8c1c44e872761d6e1202b3a989765371 /zephyr/shim/include/adc_chip.h
parent9ca182373f591c5d595f039d58078317c1e3b975 (diff)
downloadchrome-ec-d68de6a2502dec94eeb3947f0eefc7fd0ab79d63.tar.gz
zephyr: add shim ADC
Add ADC shim to connect the platform/ec ADC API to the Zephyr ADC API. Generate needed global variables/types: enum adc_channel and adc_channels from dts. Once ADC_CMD config is enabled, it replaces the "adc" Zephyr console function. The shim assues only ADC_0 module. More specific channel options can be added to named-adc.yaml e.g. shift or gain. BUG=b:175881324 BRANCH=none TEST=build Zephyr TEST=Run "adc" command, it should return current levels in mv of configured channels Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic9c03223e611f916bebc1296cbee614401098994 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673418 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/shim/include/adc_chip.h')
-rw-r--r--zephyr/shim/include/adc_chip.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/zephyr/shim/include/adc_chip.h b/zephyr/shim/include/adc_chip.h
new file mode 100644
index 0000000000..c51cdfbb30
--- /dev/null
+++ b/zephyr/shim/include/adc_chip.h
@@ -0,0 +1,16 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/*
+ * This file is left intentionally blank. It is required since the
+ * platform/ec/common/adc.c file includes it. Normally, this file
+ * would define chip specific ADC configs and would reside under
+ * platform/ec/chip/...
+ */
+
+#ifndef __CROS_EC_ADC_CHIP_H
+#define __CROS_EC_ADC_CHIP_H
+
+#endif /* __CROS_EC_ADC_CHIP_H */