Skip to content

Commit 7f15ee9

Browse files
committed
[nrf fromlist] dts: bindings: comparator: nordic: Change inputs type to int
Unify external analog inputs type to be consistent in COMP, LPCOMP and SAADC nordic drivers. Upstream PR #: 95106 Signed-off-by: Jakub Zymelka <[email protected]>
1 parent 318b871 commit 7f15ee9

File tree

3 files changed

+31
-42
lines changed

3 files changed

+31
-42
lines changed

dts/bindings/comparator/nordic,nrf-comp.yaml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ description: |
2525
&comp {
2626
status = "okay";
2727
main-mode = "SE";
28-
psel = "AIN0";
28+
psel = <NRF_COMP_AIN0>;
2929
refsel = "INT_1V2";
3030
sp-mode = "NORMAL";
3131
th-up = <36>;
@@ -39,7 +39,7 @@ description: |
3939
&comp {
4040
...
4141
refsel = "AREF";
42-
extrefsel = "AIN1";
42+
extrefsel = <NRF_COMP_AIN1>;
4343
...
4444
};
4545
@@ -49,8 +49,8 @@ description: |
4949
&comp {
5050
status = "okay";
5151
main-mode = "DIFF";
52-
psel = "AIN0";
53-
extrefsel = "AIN1";
52+
psel = <NRF_COMP_AIN0>;
53+
extrefsel = <NRF_COMP_AIN1>;
5454
sp-mode = "NORMAL";
5555
enable-hyst;
5656
isource = "DISABLED";
@@ -68,30 +68,10 @@ properties:
6868
- "DIFF"
6969

7070
psel:
71-
type: string
72-
enum:
73-
- "AIN0"
74-
- "AIN1"
75-
- "AIN2"
76-
- "AIN3"
77-
- "AIN4"
78-
- "AIN5"
79-
- "AIN6"
80-
- "AIN7"
81-
- "VDD_DIV2"
82-
- "VDDH_DIV5"
71+
type: int
8372

8473
extrefsel:
85-
type: string
86-
enum:
87-
- "AIN0"
88-
- "AIN1"
89-
- "AIN2"
90-
- "AIN3"
91-
- "AIN4"
92-
- "AIN5"
93-
- "AIN6"
94-
- "AIN7"
74+
type: int
9575

9676
refsel:
9777
type: string

dts/bindings/comparator/nordic,nrf-lpcomp.yaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ description: |
2121
2222
&comp {
2323
status = "okay";
24-
psel = "AIN0";
24+
psel = <NRF_COMP_AIN0>;
2525
refsel = "VDD_4_8";
2626
enable-hyst;
2727
};
@@ -32,7 +32,7 @@ description: |
3232
&comp {
3333
...
3434
refsel = "AREF";
35-
extrefsel = "AIN1";
35+
extrefsel = <NRF_COMP_AIN1>;
3636
...
3737
};
3838
@@ -42,22 +42,10 @@ include: base.yaml
4242

4343
properties:
4444
psel:
45-
type: string
46-
enum:
47-
- "AIN0"
48-
- "AIN1"
49-
- "AIN2"
50-
- "AIN3"
51-
- "AIN4"
52-
- "AIN5"
53-
- "AIN6"
54-
- "AIN7"
45+
type: int
5546

5647
extrefsel:
57-
type: string
58-
enum:
59-
- "AIN0"
60-
- "AIN1"
48+
type: int
6149

6250
refsel:
6351
type: string
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Nordic Semiconductor ASA
5+
*/
6+
7+
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_
8+
#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_
9+
10+
#define NRF_COMP_AIN0 0 /** AIN0 external input */
11+
#define NRF_COMP_AIN1 1 /** AIN1 external input */
12+
#define NRF_COMP_AIN2 2 /** AIN2 external input */
13+
#define NRF_COMP_AIN3 3 /** AIN3 external input */
14+
#define NRF_COMP_AIN4 4 /** AIN4 external input */
15+
#define NRF_COMP_AIN5 5 /** AIN5 external input */
16+
#define NRF_COMP_AIN6 6 /** AIN6 external input */
17+
#define NRF_COMP_AIN7 7 /** AIN7 external input */
18+
#define NRF_COMP_AIN_VDD_DIV2 8 /** VDD / 2 */
19+
#define NRF_COMP_AIN_VDDH_DIV5 9 /** VDDH / 5 */
20+
21+
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ */

0 commit comments

Comments
 (0)