Skip to content

Commit 73c7f55

Browse files
mbolivar-nordicnashif
authored andcommitted
soc: cypress: use new DT pinctrl accessors
Update to use the new APIs. Signed-off-by: Martí Bolívar <[email protected]>
1 parent 865ea9c commit 73c7f55

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

soc/arm/cypress/common/cypress_psoc6_dt.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,25 +106,21 @@
106106
* Devicetree related macros to construct pin control config data
107107
*/
108108

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-
113109
/* Get GPIO register address associated with pinctrl-0 pin at index 'i' */
114110
#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))
116112

117113
/* Get PIN associated with pinctrl-0 pin at index 'i' */
118114
#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)
120116

121117
/* Get HSIOM value associated with pinctrl-0 pin at index 'i' */
122118
#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)
124120

125121
/* Helper function for CY_PSOC6_PIN_FLAGS */
126122
#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)
128124

129125
/* Convert DT flags to SoC flags */
130126
#define CY_PSOC6_PIN_FLAGS(inst, i) \
@@ -151,7 +147,7 @@
151147
}
152148

153149
/* 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)
155151

156152
/* internal macro to structure things for use with UTIL_LISTIFY */
157153
#define CY_PSOC6_PIN_ELEM(idx, inst) CY_PSOC6_DT_INST_PIN(inst, idx),

0 commit comments

Comments
 (0)