Skip to content

Commit 6693323

Browse files
Revert "[nrf fromtree] doc: update devicetree/adc.h"
This reverts commit 95c372b. Signed-off-by: Martí Bolívar <[email protected]>
1 parent f44b59c commit 6693323

File tree

1 file changed

+58
-117
lines changed

1 file changed

+58
-117
lines changed

include/devicetree/adc.h

Lines changed: 58 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ extern "C" {
2323
*/
2424

2525
/**
26-
* @brief Get a label property from the node referenced by an
27-
* io-channels property at an index
26+
* @brief Get IO channels controller "name" (label property) at an index
2827
*
29-
* It's an error if the node referenced by the phandle in node_id's
30-
* io-channels property at index "idx" has no label property.
28+
* It's an error if the IO channels controller referenced by the phandle
29+
* in property "io_channels" at index "idx" has no label property.
3130
*
3231
* Example devicetree fragment:
3332
*
@@ -47,20 +46,19 @@ extern "C" {
4746
*
4847
* DT_IO_CHANNELS_LABEL_BY_IDX(DT_NODELABEL(n), 1) // "ADC_2"
4948
*
50-
* @param node_id node identifier for a node with an io-channels property
51-
* @param idx logical index into io-channels property
52-
* @return the label property of the node referenced at index "idx"
53-
* @see DT_PROP_BY_PHANDLE_IDX()
49+
* @param node_id node identifier
50+
* @param idx logical index into the property
51+
* @return the label property for the referenced node at index idx
52+
* @see DT_PHANDLE_BY_IDX()
5453
*/
5554
#define DT_IO_CHANNELS_LABEL_BY_IDX(node_id, idx) \
5655
DT_PROP_BY_PHANDLE_IDX(node_id, io_channels, idx, label)
5756

5857
/**
59-
* @brief Get a label property from an io-channels property by name
58+
* @brief Get IO channels controller "name" (label property) by name
6059
*
61-
* It's an error if the node referenced by the phandle in node_id's
62-
* io-channels property at the element named "name" has no label
63-
* property.
60+
* It's an error if the IO channels controller referenced by the phandle
61+
* in property "io_channels" at index "idx" has no label property.
6462
*
6563
* Example devicetree fragment:
6664
*
@@ -81,169 +79,111 @@ extern "C" {
8179
*
8280
* DT_IO_CHANNELS_LABEL_BY_NAME(DT_NODELABEL(n), bandgap) // "ADC_2"
8381
*
84-
* @param node_id node identifier for a node with an io-channels property
85-
* @param name lowercase-and-underscores name of an io-channels element
86-
* as defined by the node's io-channel-names property
87-
* @return the label property of the node referenced at the named element
82+
* @param node_id node identifier
83+
* @param name lowercase-and-underscores "io_channel" name
84+
* @return the label property for the referenced node by name
8885
* @see DT_PHANDLE_BY_NAME()
8986
*/
9087
#define DT_IO_CHANNELS_LABEL_BY_NAME(node_id, name) \
9188
DT_PROP(DT_PHANDLE_BY_NAME(node_id, io_channels, name), label)
9289

9390
/**
9491
* @brief Equivalent to DT_IO_CHANNELS_LABEL_BY_IDX(node_id, 0)
95-
* @param node_id node identifier for a node with an io-channels property
96-
* @return the label property of the node referenced at index 0
92+
* @param node_id node identifier
93+
* @return the label property for the named specifier at index 0
9794
* @see DT_IO_CHANNELS_LABEL_BY_IDX()
9895
*/
9996
#define DT_IO_CHANNELS_LABEL(node_id) DT_IO_CHANNELS_LABEL_BY_IDX(node_id, 0)
10097

10198
/**
102-
* @brief Get a label property from a DT_DRV_COMPAT instance's io-channels
103-
* property at an index
104-
* @param inst DT_DRV_COMPAT instance number
105-
* @param idx logical index into io-channels property
106-
* @return the label property of the node referenced at index "idx"
107-
* @see DT_IO_CHANNELS_LABEL_BY_IDX()
99+
* @brief Get IO channel's controller "name" at an index
100+
* (see @ref DT_IO_CHANNELS_LABEL_BY_IDX)
101+
* @param inst instance number
102+
* @param idx logical index into the property
103+
* @return the label property for the named specifier at index idx
108104
*/
109105
#define DT_INST_IO_CHANNELS_LABEL_BY_IDX(inst, idx) \
110106
DT_IO_CHANNELS_LABEL_BY_IDX(DT_DRV_INST(inst), idx)
111107

112108
/**
113-
* @brief Get a label property from a DT_DRV_COMPAT instance's io-channels
114-
* property by name
115-
* @param inst DT_DRV_COMPAT instance number
116-
* @param name lowercase-and-underscores name of an io-channels element
117-
* as defined by the instance's io-channel-names property
118-
* @return the label property of the node referenced at the named element
119-
* @see DT_IO_CHANNELS_LABEL_BY_NAME()
109+
* @brief Get IO channel's controller "name" by name
110+
* (see @ref DT_IO_CHANNELS_LABEL_BY_NAME)
111+
* @param inst instance number
112+
* @param name lowercase-and-underscores "io_channel" name
113+
* @return the label property for the named specifier by name
120114
*/
121115
#define DT_INST_IO_CHANNELS_LABEL_BY_NAME(inst, name) \
122116
DT_IO_CHANNELS_LABEL_BY_NAME(DT_DRV_INST(inst), name)
123117

124118
/**
125119
* @brief Equivalent to DT_INST_IO_CHANNELS_LABEL_BY_IDX(inst, 0)
126-
* @param inst DT_DRV_COMPAT instance number
127-
* @return the label property of the node referenced at index 0
120+
* @param inst instance number
121+
* @return the label property for the named specifier at index 0
128122
*/
129123
#define DT_INST_IO_CHANNELS_LABEL(inst) DT_INST_IO_CHANNELS_LABEL_BY_IDX(inst, 0)
130124

131125
/**
132-
* @brief Get an io-channels specifier input cell at an index
133-
*
134-
* This macro only works for io-channels specifiers with cells named
135-
* "input". Refer to the node's binding to check if necessary.
136-
*
137-
* Example devicetree fragment:
138-
*
139-
* adc1: adc@... {
140-
* compatible = "vnd,adc";
141-
* #io-channel-cells = <1>;
142-
* };
126+
* @brief Get IO channels controller 'input' at an index
143127
*
144-
* adc2: adc@... {
145-
* compatible = "vnd,adc";
146-
* #io-channel-cells = <1>;
147-
* };
128+
* This macro only works for IO channels controllers that specify a 'input'
129+
* field in the phandle-array specifier. Refer to the specific IO channels
130+
* controller binding if needed.
148131
*
149-
* n: node {
150-
* io-channels = <&adc1 10>, <&adc2 20>;
151-
* };
152-
*
153-
* Bindings fragment for the vnd,adc compatible:
154-
*
155-
* io-channel-cells:
156-
* - input
157-
*
158-
* Example usage:
159-
*
160-
* DT_IO_CHANNELS_INPUT_BY_IDX(DT_NODELABEL(n), 0) // 10
161-
* DT_IO_CHANNELS_INPUT_BY_IDX(DT_NODELABEL(n), 1) // 20
162-
*
163-
* @param node_id node identifier for a node with an io-channels property
164-
* @param idx logical index into io-channels property
165-
* @return the input cell in the specifier at index "idx"
132+
* @param node_id node identifier
133+
* @param idx logical index into the property
134+
* @return the input value for the named specifier at index idx
166135
* @see DT_PHA_BY_IDX()
136+
* @see DT_PHA()
167137
*/
168138
#define DT_IO_CHANNELS_INPUT_BY_IDX(node_id, idx) \
169139
DT_PHA_BY_IDX(node_id, io_channels, idx, input)
170140

171141
/**
172-
* @brief Get an io-channels specifier input cell by name
173-
*
174-
* This macro only works for io-channels specifiers with cells named
175-
* "input". Refer to the node's binding to check if necessary.
142+
* @brief Get IO channels controller 'input' by name
176143
*
177-
* Example devicetree fragment:
178-
*
179-
* adc1: adc@... {
180-
* compatible = "vnd,adc";
181-
* #io-channel-cells = <1>;
182-
* };
183-
*
184-
* adc2: adc@... {
185-
* compatible = "vnd,adc";
186-
* #io-channel-cells = <1>;
187-
* };
144+
* This macro only works for IO channels controllers that specify a 'input'
145+
* field in the phandle-array specifier. Refer to the specific IO channels
146+
* controller binding if needed.
188147
*
189-
* n: node {
190-
* io-channels = <&adc1 10>, <&adc2 20>;
191-
* io-channel-names = "SENSOR", "BANDGAP";
192-
* };
193-
*
194-
* Bindings fragment for the vnd,adc compatible:
195-
*
196-
* io-channel-cells:
197-
* - input
198-
*
199-
* Example usage:
200-
*
201-
* DT_IO_CHANNELS_INPUT_BY_NAME(DT_NODELABEL(n), sensor) // 10
202-
* DT_IO_CHANNELS_INPUT_BY_NAME(DT_NODELABEL(n), bandgap) // 20
203-
*
204-
* @param node_id node identifier for a node with an io-channels property
205-
* @param name lowercase-and-underscores name of an io-channels element
206-
* as defined by the node's io-channel-names property
207-
* @return the input cell in the specifier at the named element
148+
* @param node_id node identifier
149+
* @param name lowercase-and-underscores "io_channel" name
150+
* @return the input value for the named specifier by name
208151
* @see DT_PHA_BY_NAME()
209152
*/
210153
#define DT_IO_CHANNELS_INPUT_BY_NAME(node_id, name) \
211154
DT_PHA_BY_NAME(node_id, io_channels, name, input)
212155
/**
213156
* @brief Equivalent to DT_IO_CHANNELS_INPUT_BY_IDX(node_id, 0)
214-
* @param node_id node identifier for a node with an io-channels property
215-
* @return the input cell in the specifier at index 0
157+
* @param node_id node identifier
158+
* @return the label property for the named specifier at index 0
216159
* @see DT_IO_CHANNELS_INPUT_BY_IDX()
217160
*/
218161
#define DT_IO_CHANNELS_INPUT(node_id) DT_IO_CHANNELS_INPUT_BY_IDX(node_id, 0)
219162

220163
/**
221-
* @brief Get an input cell from the "DT_DRV_INST(inst)" io-channels
222-
* property at an index
223-
* @param inst DT_DRV_COMPAT instance number
224-
* @param idx logical index into io-channels property
225-
* @return the input cell in the specifier at index "idx"
226-
* @see DT_IO_CHANNELS_INPUT_BY_IDX()
164+
* @brief Get IO channel's controller "input" at an index
165+
* (see @ref DT_IO_CHANNELS_INPUT_BY_IDX)
166+
* @param inst instance number
167+
* @param idx logical index into the property
168+
* @return the input value for the named specifier at index idx
227169
*/
228170
#define DT_INST_IO_CHANNELS_INPUT_BY_IDX(inst, idx) \
229171
DT_IO_CHANNELS_INPUT_BY_IDX(DT_DRV_INST(inst), idx)
230172

231173
/**
232-
* @brief Get an input cell from the "DT_DRV_INST(inst)" io-channels
233-
* property by name
234-
* @param inst DT_DRV_COMPAT instance number
235-
* @param name lowercase-and-underscores name of an io-channels element
236-
* as defined by the instance's io-channel-names property
237-
* @return the input cell in the specifier at the named element
238-
* @see DT_IO_CHANNELS_INPUT_BY_NAME()
174+
* @brief Get IO channel's controller "input" by name
175+
* (see @ref DT_IO_CHANNELS_INPUT_BY_NAME)
176+
* @param inst instance number
177+
* @param name lowercase-and-underscores "io_channel" name
178+
* @return the input value for the named specifier at index idx
239179
*/
240180
#define DT_INST_IO_CHANNELS_INPUT_BY_NAME(inst, name) \
241181
DT_IO_CHANNELS_INPUT_BY_NAME(DT_DRV_INST(inst), name)
242182

243183
/**
244-
* @brief Equivalent to DT_INST_IO_CHANNELS_INPUT_BY_IDX(inst, 0)
245-
* @param inst DT_DRV_COMPAT instance number
246-
* @return the input cell in the specifier at index 0
184+
* @brief Equivalent to DT_INST_IO_CHANNELS_INPUT(inst, 0)
185+
* @param inst instance number
186+
* @return the input property for the named specifier at index 0
247187
*/
248188
#define DT_INST_IO_CHANNELS_INPUT(inst) DT_INST_IO_CHANNELS_INPUT_BY_IDX(inst, 0)
249189

@@ -255,4 +195,5 @@ extern "C" {
255195
}
256196
#endif
257197

198+
258199
#endif /* ZEPHYR_INCLUDE_DEVICETREE_ADC_H_ */

0 commit comments

Comments
 (0)