Skip to content

Commit

Permalink
[nrf fromlist] dts: nordic: refactor bindings helper symbols for SAADC
Browse files Browse the repository at this point in the history
Split header files containing symbols denoting SAADC inputs
so that only supported inputs can be used for given device.

Upstream PR: zephyrproject-rtos/zephyr#79330

Signed-off-by: Nikodem Kastelik <[email protected]>
(cherry picked from commit acb096b44eeddf353a54395f51600118f97cea57)
  • Loading branch information
nika-nordic committed Oct 14, 2024
1 parent 45262a0 commit 09b9e02
Show file tree
Hide file tree
Showing 21 changed files with 77 additions and 13 deletions.
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf51822.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <arm/armv6-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-adc.h>

/ {
chosen {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf52805.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <arm/armv7-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/ {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf52810.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <arm/armv7-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/ {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf52811.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <arm/armv7-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/ {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf52832.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <arm/armv7-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/ {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf52833.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <arm/armv7-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v3.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/ {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf52840.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <arm/armv7-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v3.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/ {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf5340_cpuapp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <arm/armv8-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v3.h>

/ {
cpus {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf5340_cpuappns.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <arm/armv8-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v3.h>

/ {
cpus {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf91.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <arm/armv8-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>

/ {
cpus {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf91ns.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <arm/armv8-m.dtsi>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>

/ {
cpus {
Expand Down
1 change: 1 addition & 0 deletions dts/common/nordic/nrf54h20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <mem.h>
#include <nordic/nrf_common.dtsi>

#include <zephyr/dt-bindings/adc/nrf-saadc.h>
#include <zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf54h20.h>
#include <zephyr/dt-bindings/misc/nordic-domain-id-nrf54h20.h>
#include <zephyr/dt-bindings/misc/nordic-owner-id-nrf54h20.h>
Expand Down
1 change: 1 addition & 0 deletions dts/common/nordic/nrf54l15.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <mem.h>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/delete-node/ &sw_pwm;
Expand Down
1 change: 1 addition & 0 deletions dts/common/nordic/nrf54l20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <mem.h>
#include <nordic/nrf_common.dtsi>
#include <zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h>
#include <zephyr/dt-bindings/regulator/nrf5x.h>

/delete-node/ &sw_pwm;
Expand Down
2 changes: 1 addition & 1 deletion dts/common/nordic/nrf9280.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <mem.h>
#include <nordic/nrf_common.dtsi>

#include <zephyr/dt-bindings/adc/nrf-saadc.h>
#include <zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf9230-engb.h>
#include <zephyr/dt-bindings/misc/nordic-domain-id-nrf9230.h>
#include <zephyr/dt-bindings/misc/nordic-owner-id-nrf9230.h>
Expand Down
1 change: 0 additions & 1 deletion dts/common/nordic/nrf_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include <zephyr/dt-bindings/adc/adc.h>
#include <zephyr/dt-bindings/adc/nrf-adc.h>
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/i2c/i2c.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
Expand Down
11 changes: 0 additions & 11 deletions include/zephyr/dt-bindings/adc/nrf-adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,4 @@
#define NRF_ADC_AIN6 BIT(6)
#define NRF_ADC_AIN7 BIT(7)

#define NRF_SAADC_AIN0 1
#define NRF_SAADC_AIN1 2
#define NRF_SAADC_AIN2 3
#define NRF_SAADC_AIN3 4
#define NRF_SAADC_AIN4 5
#define NRF_SAADC_AIN5 6
#define NRF_SAADC_AIN6 7
#define NRF_SAADC_AIN7 8
#define NRF_SAADC_VDD 9
#define NRF_SAADC_VDDHDIV5 13

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_ADC_H_ */
15 changes: 15 additions & 0 deletions include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2024 Nordic Semiconductor ASA
*/

#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_

#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>

#define NRF_SAADC_AVDD 10
#define NRF_SAADC_DVDD 11

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_ */
14 changes: 14 additions & 0 deletions include/zephyr/dt-bindings/adc/nrf-saadc-v2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2024 Nordic Semiconductor ASA
*/

#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_

#include <zephyr/dt-bindings/adc/nrf-saadc.h>

#define NRF_SAADC_VDD 9

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_ */
14 changes: 14 additions & 0 deletions include/zephyr/dt-bindings/adc/nrf-saadc-v3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2024 Nordic Semiconductor ASA
*/

#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_

#include <zephyr/dt-bindings/adc/nrf-saadc-v2.h>

#define NRF_SAADC_VDDHDIV5 13

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_ */
19 changes: 19 additions & 0 deletions include/zephyr/dt-bindings/adc/nrf-saadc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2024 Nordic Semiconductor ASA
*/

#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_

#define NRF_SAADC_AIN0 1
#define NRF_SAADC_AIN1 2
#define NRF_SAADC_AIN2 3
#define NRF_SAADC_AIN3 4
#define NRF_SAADC_AIN4 5
#define NRF_SAADC_AIN5 6
#define NRF_SAADC_AIN6 7
#define NRF_SAADC_AIN7 8

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ */

0 comments on commit 09b9e02

Please sign in to comment.