|
106 | 106 | * Devicetree related macros to construct pin control config data |
107 | 107 | */ |
108 | 108 |
|
109 | | -/* Get a node id from a pinctrl-0 prop at index 'i' */ |
110 | | -#define NODE_ID_FROM_PINCTRL_0(inst, i) \ |
111 | | - DT_INST_PHANDLE_BY_IDX(inst, pinctrl_0, i) |
112 | | - |
113 | 109 | /* Get GPIO register address associated with pinctrl-0 pin at index 'i' */ |
114 | 110 | #define CY_PSOC6_PIN_TO_GPIO_REG_ADDR(inst, i) \ |
115 | | - DT_REG_ADDR(DT_PHANDLE(NODE_ID_FROM_PINCTRL_0(inst, i), cypress_pins)) |
| 111 | + DT_REG_ADDR(DT_PHANDLE(DT_INST_PINCTRL_0(inst, i), cypress_pins)) |
116 | 112 |
|
117 | 113 | /* Get PIN associated with pinctrl-0 pin at index 'i' */ |
118 | 114 | #define CY_PSOC6_PIN(inst, i) \ |
119 | | - DT_PHA(NODE_ID_FROM_PINCTRL_0(inst, i), cypress_pins, pin) |
| 115 | + DT_PHA(DT_INST_PINCTRL_0(inst, i), cypress_pins, pin) |
120 | 116 |
|
121 | 117 | /* Get HSIOM value associated with pinctrl-0 pin at index 'i' */ |
122 | 118 | #define CY_PSOC6_PIN_HSIOM(inst, i) \ |
123 | | - DT_PHA(NODE_ID_FROM_PINCTRL_0(inst, i), cypress_pins, hsiom) |
| 119 | + DT_PHA(DT_INST_PINCTRL_0(inst, i), cypress_pins, hsiom) |
124 | 120 |
|
125 | 121 | /* Helper function for CY_PSOC6_PIN_FLAGS */ |
126 | 122 | #define CY_PSOC6_PIN_FLAG(inst, i, flag) \ |
127 | | - DT_PROP(NODE_ID_FROM_PINCTRL_0(inst, i), flag) |
| 123 | + DT_PROP(DT_INST_PINCTRL_0(inst, i), flag) |
128 | 124 |
|
129 | 125 | /* Convert DT flags to SoC flags */ |
130 | 126 | #define CY_PSOC6_PIN_FLAGS(inst, i) \ |
|
151 | 147 | } |
152 | 148 |
|
153 | 149 | /* Get the number of pins for pinctrl-0 */ |
154 | | -#define CY_PSOC6_DT_INST_NUM_PINS(inst) DT_INST_PROP_LEN(inst, pinctrl_0) |
| 150 | +#define CY_PSOC6_DT_INST_NUM_PINS(inst) DT_INST_NUM_PINCTRLS_BY_IDX(inst, 0) |
155 | 151 |
|
156 | 152 | /* internal macro to structure things for use with UTIL_LISTIFY */ |
157 | 153 | #define CY_PSOC6_PIN_ELEM(idx, inst) CY_PSOC6_DT_INST_PIN(inst, idx), |
|
0 commit comments