|
121 | 121 | inst) \ |
122 | 122 | } |
123 | 123 |
|
124 | | -/** |
125 | | - * @brief Get phandle from 'pinctrl-0' prop which type is 'phandles' at index |
126 | | - * 'i' |
127 | | - * |
128 | | - * @param inst instance number for compatible defined in DT_DRV_COMPAT. |
129 | | - * @param i index of 'pinctrl-0' prop which type is 'phandles' |
130 | | - * @return phandle from 'pinctrl-0' prop at index 'i' |
131 | | - */ |
132 | | -#define NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i) \ |
133 | | - DT_INST_PHANDLE_BY_IDX(inst, pinctrl_0, i) |
134 | | - |
135 | 124 | /** |
136 | 125 | * @brief Construct a npcx_alt structure from 'pinctrl-0' property at index 'i' |
137 | 126 | * |
138 | 127 | * @param inst instance number for compatible defined in DT_DRV_COMPAT. |
139 | 128 | * @param i index of 'pinctrl-0' prop which type is 'phandles' |
140 | 129 | * @return npcx_alt item from 'pinctrl-0' property at index 'i' |
141 | 130 | */ |
142 | | -#define NPCX_DT_ALT_ITEM_BY_IDX(inst, i) \ |
143 | | - { \ |
144 | | - .group = DT_PHA(NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i), alts, group), \ |
145 | | - .bit = DT_PHA(NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i), alts, bit), \ |
146 | | - .inverted = DT_PHA(NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i), alts, inv),\ |
| 131 | +#define NPCX_DT_ALT_ITEM_BY_IDX(inst, i) \ |
| 132 | + { \ |
| 133 | + .group = DT_PHA(DT_INST_PINCTRL_0(inst, i), alts, group), \ |
| 134 | + .bit = DT_PHA(DT_INST_PINCTRL_0(inst, i), alts, bit), \ |
| 135 | + .inverted = DT_PHA(DT_INST_PINCTRL_0(inst, i), alts, inv), \ |
147 | 136 | }, |
148 | 137 |
|
149 | | -/** |
150 | | - * @brief Length of npcx_alt structures in 'pinctrl-0' property |
151 | | - * |
152 | | - * @param inst instance number for compatible defined in DT_DRV_COMPAT. |
153 | | - * @return length of 'pinctrl-0' property which type is 'phandles' |
154 | | - */ |
155 | | -#define NPCX_DT_ALT_ITEMS_LEN(inst) DT_INST_PROP_LEN(inst, pinctrl_0) |
156 | | - |
157 | 138 | /** |
158 | 139 | * @brief Macro function to construct npcx_alt item in UTIL_LISTIFY extension. |
159 | 140 | * |
|
181 | 162 | * @param inst instance number for compatible defined in DT_DRV_COMPAT. |
182 | 163 | * @return an array of npcx_alt items. |
183 | 164 | */ |
184 | | -#define NPCX_DT_ALT_ITEMS_LIST(inst) { \ |
185 | | - UTIL_LISTIFY(NPCX_DT_ALT_ITEMS_LEN(inst), \ |
186 | | - NPCX_DT_ALT_ITEMS_FUNC, \ |
187 | | - inst) \ |
| 165 | +#define NPCX_DT_ALT_ITEMS_LIST(inst) { \ |
| 166 | + UTIL_LISTIFY(DT_INST_NUM_PINCTRLS_BY_IDX(inst, 0), \ |
| 167 | + NPCX_DT_ALT_ITEMS_FUNC, \ |
| 168 | + inst) \ |
188 | 169 | } |
189 | 170 |
|
190 | 171 | /** |
|
221 | 202 | * @return phandle from 'pinctrl-0' prop at index 'i' |
222 | 203 | */ |
223 | 204 | #define NPCX_DT_IO_PHANDLE_FROM_PINCTRL(io_comp, inst, i) \ |
224 | | - NPCX_DT_COMP_INST_PHANDLE_BY_IDX(io_comp, inst, pinctrl_0, i) |
| 205 | + DT_PINCTRL_BY_IDX(NPCX_DT_COMP_INST(io_comp, inst), 0, i) |
225 | 206 |
|
226 | 207 | /** |
227 | 208 | * @brief Construct a npcx_alt structure from 'pinctrl-0' property at index 'i' |
228 | 209 | * from io-pads device with specific compatible. |
229 | 210 | * |
230 | 211 | * @param io_comp compatible string in devicetree file for io-pads device |
231 | 212 | * @param inst instance number for compatible defined in io_comp. |
232 | | - * @param i index of 'pinctrl_0' prop which type is 'phandles' |
| 213 | + * @param i index of 'pinctrl-0' prop which type is 'phandles' |
233 | 214 | * @return npcx_alt item from 'pinctrl-0' property at index 'i' |
234 | 215 | */ |
235 | 216 | #define NPCX_DT_IO_ALT_ITEM_BY_IDX(io_comp, inst, i) \ |
|
251 | 232 | * @return length of 'pinctrl-0' property which type is 'phandles' |
252 | 233 | */ |
253 | 234 | #define NPCX_DT_IO_ALT_ITEMS_LEN(io_comp, inst) \ |
254 | | - DT_PROP_LEN(NPCX_DT_COMP_INST(io_comp, inst), pinctrl_0) |
| 235 | + DT_NUM_PINCTRLS_BY_IDX(NPCX_DT_COMP_INST(io_comp, inst), 0) |
255 | 236 |
|
256 | 237 | /** |
257 | 238 | * @brief Macro function to construct npcx_alt item with specific compatible |
|
607 | 588 | * @return phandle from 'pinctrl-0' prop at index 'i' |
608 | 589 | */ |
609 | 590 | #define NPCX_DT_PHANDLE_FROM_PSL_PINMUX_NODE(i) \ |
610 | | - DT_PHANDLE(NPCX_DT_PHANDLE_FROM_PSL_IN_NODE(i), pinctrl_0) |
| 591 | + DT_PINCTRL_0(NPCX_DT_PHANDLE_FROM_PSL_IN_NODE(i), 0) |
611 | 592 |
|
612 | 593 | /** |
613 | 594 | * @brief Get phandle from 'polarity-0' prop which type is 'phandles' at index |
|
0 commit comments