Lines Matching +full:pinctrl +full:- +full:0
3 * SPDX-License-Identifier: Apache-2.0
15 * @defgroup devicetree-pinctrl Pin control
21 * @brief Get a node identifier for a phandle in a pinctrl property by index
26 * pinctrl-0 = <&foo &bar>;
27 * pinctrl-1 = <&baz &blub>;
32 * DT_PINCTRL_BY_IDX(DT_NODELABEL(n), 0, 1) // DT_NODELABEL(bar)
33 * DT_PINCTRL_BY_IDX(DT_NODELABEL(n), 1, 0) // DT_NODELABEL(baz)
35 * @param node_id node with a pinctrl-'pc_idx' property
36 * @param pc_idx index of the pinctrl property itself
37 * @param idx index into the value of the pinctrl property
38 * @return node identifier for the phandle at index 'idx' in 'pinctrl-'pc_idx''
44 * @brief Get a node identifier from a pinctrl-0 property
48 * DT_PINCTRL_BY_IDX(node_id, 0, idx)
50 * It is provided for convenience since pinctrl-0 is commonly used.
52 * @param node_id node with a pinctrl-0 property
53 * @param idx index into the pinctrl-0 property
54 * @return node identifier for the phandle at index idx in the pinctrl-0
57 #define DT_PINCTRL_0(node_id, idx) DT_PINCTRL_BY_IDX(node_id, 0, idx)
60 * @brief Get a node identifier for a phandle inside a pinctrl node by name
65 * pinctrl-0 = <&foo &bar>;
66 * pinctrl-1 = <&baz &blub>;
67 * pinctrl-names = "default", "sleep";
73 * DT_PINCTRL_BY_NAME(DT_NODELABEL(n), sleep, 0) // DT_NODELABEL(baz)
75 * @param node_id node with a named pinctrl property
76 * @param name lowercase-and-underscores pinctrl property name
77 * @param idx index into the value of the named pinctrl property
78 * @return node identifier for the phandle at that index in the pinctrl
85 * @brief Convert a pinctrl name to its corresponding index
90 * pinctrl-0 = <&foo &bar>;
91 * pinctrl-1 = <&baz &blub>;
92 * pinctrl-names = "default", "sleep";
97 * DT_PINCTRL_NAME_TO_IDX(DT_NODELABEL(n), default) // 0
100 * @param node_id node identifier with a named pinctrl property
101 * @param name lowercase-and-underscores name name of the pinctrl whose index to get
102 * @return integer literal for the index of the pinctrl property with that name
108 * @brief Convert a pinctrl property index to its name as a token
110 * This allows you to get a pinctrl property's name, and "remove the
114 * pinctrl-'pc_idx' property and a pinctrl-names property element for
120 * pinctrl-0 = <...>;
121 * pinctrl-1 = <...>;
122 * pinctrl-names = "default", "f.o.o2";
127 * DT_PINCTRL_IDX_TO_NAME_TOKEN(DT_NODELABEL(n), 0) // default
134 * @param pc_idx index of a pinctrl property in that node
135 * @return name of the pinctrl property, as a token, without any quotes
136 * and with non-alphanumeric characters converted to underscores
151 * pinctrl-0 = <...>;
152 * pinctrl-1 = <...>;
153 * pinctrl-names = "default", "f.o.o2";
158 * DT_PINCTRL_IDX_TO_NAME_TOKEN(DT_NODELABEL(n), 0) // DEFAULT
168 * @brief Get the number of phandles in a pinctrl property
172 * n1: node-1 {
173 * pinctrl-0 = <&foo &bar>;
176 * n2: node-2 {
177 * pinctrl-0 = <&baz>;
182 * DT_NUM_PINCTRLS_BY_IDX(DT_NODELABEL(n1), 0) // 2
183 * DT_NUM_PINCTRLS_BY_IDX(DT_NODELABEL(n2), 0) // 1
185 * @param node_id node identifier with a pinctrl property
186 * @param pc_idx index of the pinctrl property itself
198 * pinctrl-0 = <&foo &bar>;
199 * pinctrl-1 = <&baz>
200 * pinctrl-names = "default", "sleep";
208 * @param node_id node identifier with a pinctrl property
209 * @param name lowercase-and-underscores name name of the pinctrl property
216 * @brief Get the number of pinctrl properties in a node
218 * This expands to 0 if there are no pinctrl-i properties.
223 * n1: node-1 {
224 * pinctrl-0 = <...>;
225 * pinctrl-1 = <...>;
228 * n2: node-2 {
234 * DT_NUM_PINCTRL_STATES(DT_NODELABEL(n2)) // 0
236 * @param node_id node identifier; may or may not have any pinctrl properties
237 * @return number of pinctrl properties in the node
242 * @brief Test if a node has a pinctrl property with an index
244 * This expands to 1 if the pinctrl-'idx' property exists.
245 * Otherwise, it expands to 0.
249 * n1: node-1 {
250 * pinctrl-0 = <...>;
251 * pinctrl-1 = <...>;
254 * n2: node-2 {
259 * DT_PINCTRL_HAS_IDX(DT_NODELABEL(n1), 0) // 1
261 * DT_PINCTRL_HAS_IDX(DT_NODELABEL(n1), 2) // 0
262 * DT_PINCTRL_HAS_IDX(DT_NODELABEL(n2), 0) // 0
264 * @param node_id node identifier; may or may not have any pinctrl properties
265 * @param pc_idx index of a pinctrl property whose existence to check
266 * @return 1 if the property exists, 0 otherwise
272 * @brief Test if a node has a pinctrl property with a name
274 * This expands to 1 if the named pinctrl property exists.
275 * Otherwise, it expands to 0.
279 * n1: node-1 {
280 * pinctrl-0 = <...>;
281 * pinctrl-names = "default";
284 * n2: node-2 {
290 * DT_PINCTRL_HAS_NAME(DT_NODELABEL(n1), sleep) // 0
291 * DT_PINCTRL_HAS_NAME(DT_NODELABEL(n2), default) // 0
293 * @param node_id node identifier; may or may not have any pinctrl properties
294 * @param name lowercase-and-underscores pinctrl property name to check
295 * @return 1 if the property exists, 0 otherwise
301 * @brief Get a node identifier for a phandle in a pinctrl property by index
307 * @param pc_idx index of the pinctrl property itself
308 * @param idx index into the value of the pinctrl property
309 * @return node identifier for the phandle at index 'idx' in 'pinctrl-'pc_idx''
315 * @brief Get a node identifier from a pinctrl-0 property for a
320 * DT_PINCTRL_BY_IDX(DT_DRV_INST(inst), 0, idx)
322 * It is provided for convenience since pinctrl-0 is commonly used.
325 * @param idx index into the pinctrl-0 property
326 * @return node identifier for the phandle at index idx in the pinctrl-0
330 DT_PINCTRL_BY_IDX(DT_DRV_INST(inst), 0, idx)
333 * @brief Get a node identifier for a phandle inside a pinctrl node
339 * @param name lowercase-and-underscores pinctrl property name
340 * @param idx index into the value of the named pinctrl property
341 * @return node identifier for the phandle at that index in the pinctrl
348 * @brief Convert a pinctrl name to its corresponding index
355 * @param name lowercase-and-underscores name of the pinctrl whose index to get
356 * @return integer literal for the index of the pinctrl property with that name
362 * @brief Convert a pinctrl index to its name as an uppercased token
368 * @param pc_idx index of the pinctrl property itself
375 * @brief Convert a pinctrl index to its name as an uppercased token
381 * @param pc_idx index of the pinctrl property itself
388 * @brief Get the number of phandles in a pinctrl property
395 * @param pc_idx index of the pinctrl property itself
408 * @param name lowercase-and-underscores name of the pinctrl property
415 * @brief Get the number of pinctrl properties in a DT_DRV_COMPAT instance
420 * @return number of pinctrl properties in the instance
426 * @brief Test if a DT_DRV_COMPAT instance has a pinctrl property
432 * @param pc_idx index of a pinctrl property whose existence to check
433 * @return 1 if the property exists, 0 otherwise
439 * @brief Test if a DT_DRV_COMPAT instance has a pinctrl property with a name
444 * @param name lowercase-and-underscores pinctrl property name to check
445 * @return 1 if the property exists, 0 otherwise