diff options
author | Wealian Liao <whliao@nuvoton.corp-partner.google.com> | 2021-07-06 10:31:01 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-30 16:38:17 +0000 |
commit | 70fa081aad48db8319a3b7a3a793ee351fd1f763 (patch) | |
tree | 5a87adfc1fdddc47927ff22301bb12544c28e68c /zephyr/boards | |
parent | 8f29da5d1273e32cd23ce7e3bfb3718ecdae4ad0 (diff) | |
download | chrome-ec-70fa081aad48db8319a3b7a3a793ee351fd1f763.tar.gz |
zephyr: npcx_evb: Enable ADC
This CL enables 5 ADC channels for npcx7/9_evb.
BUG=none
BRANCH=none
TEST='adc' console command
```
uart:~$ adc
ADC0 = 2813 mV
ADC1 = 2813 mV
ADC2 = 2813 mV
ADC3 = 2813 mV
ADC4 = 2813 mV
```
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: I08d60dc732f7388642a54eec090ef7bf15760a2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3063103
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/boards')
-rw-r--r-- | zephyr/boards/arm/npcx_evb/npcx7_evb_defconfig | 4 | ||||
-rw-r--r-- | zephyr/boards/arm/npcx_evb/npcx9_evb_defconfig | 4 | ||||
-rw-r--r-- | zephyr/boards/arm/npcx_evb/npcx_evb.dtsi | 34 |
3 files changed, 42 insertions, 0 deletions
diff --git a/zephyr/boards/arm/npcx_evb/npcx7_evb_defconfig b/zephyr/boards/arm/npcx_evb/npcx7_evb_defconfig index cacc3fe709..e9d9fc3bac 100644 --- a/zephyr/boards/arm/npcx_evb/npcx7_evb_defconfig +++ b/zephyr/boards/arm/npcx_evb/npcx7_evb_defconfig @@ -35,3 +35,7 @@ CONFIG_WATCHDOG=y # I2C CONFIG_I2C=y + +# ADC +CONFIG_ADC=y +CONFIG_ADC_SHELL=n diff --git a/zephyr/boards/arm/npcx_evb/npcx9_evb_defconfig b/zephyr/boards/arm/npcx_evb/npcx9_evb_defconfig index 3dc981e555..d812f7d690 100644 --- a/zephyr/boards/arm/npcx_evb/npcx9_evb_defconfig +++ b/zephyr/boards/arm/npcx_evb/npcx9_evb_defconfig @@ -34,3 +34,7 @@ CONFIG_WATCHDOG=y # I2C CONFIG_I2C=y + +# ADC +CONFIG_ADC=y +CONFIG_ADC_SHELL=n diff --git a/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi b/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi index 3c1bb67f94..ae0d36bf51 100644 --- a/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi +++ b/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi @@ -44,6 +44,36 @@ label = "I2C7_0"; }; }; + + named-adc-channels { + compatible = "named-adc-channels"; + + adc_ch_0 { + label = "ADC0"; + enum-name = "ADC_EVB_CH_0"; + channel = <0>; + }; + adc_ch_1 { + label = "ADC1"; + enum-name = "ADC_EVB_CH_1"; + channel = <1>; + }; + adc_ch_2 { + label = "ADC2"; + enum-name = "ADC_EVB_CH_2"; + channel = <2>; + }; + adc_ch_3 { + label = "ADC3"; + enum-name = "ADC_EVB_CH_3"; + channel = <3>; + }; + adc_ch_4 { + label = "ADC4"; + enum-name = "ADC_EVB_CH_4"; + channel = <4>; + }; + }; }; &i2c0_0 { @@ -70,3 +100,7 @@ status = "okay"; clock-frequency = <I2C_BITRATE_STANDARD>; }; + +&adc0 { + status = "okay"; +}; |