soc: cypress: use new DT pinctrl accessors

Update to use the new APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2021-08-12 07:08:28 -07:00 committed by Anas Nashif
commit 73c7f55a45

View file

@ -106,25 +106,21 @@
* Devicetree related macros to construct pin control config data * Devicetree related macros to construct pin control config data
*/ */
/* Get a node id from a pinctrl-0 prop at index 'i' */
#define NODE_ID_FROM_PINCTRL_0(inst, i) \
DT_INST_PHANDLE_BY_IDX(inst, pinctrl_0, i)
/* Get GPIO register address associated with pinctrl-0 pin at index 'i' */ /* Get GPIO register address associated with pinctrl-0 pin at index 'i' */
#define CY_PSOC6_PIN_TO_GPIO_REG_ADDR(inst, i) \ #define CY_PSOC6_PIN_TO_GPIO_REG_ADDR(inst, i) \
DT_REG_ADDR(DT_PHANDLE(NODE_ID_FROM_PINCTRL_0(inst, i), cypress_pins)) DT_REG_ADDR(DT_PHANDLE(DT_INST_PINCTRL_0(inst, i), cypress_pins))
/* Get PIN associated with pinctrl-0 pin at index 'i' */ /* Get PIN associated with pinctrl-0 pin at index 'i' */
#define CY_PSOC6_PIN(inst, i) \ #define CY_PSOC6_PIN(inst, i) \
DT_PHA(NODE_ID_FROM_PINCTRL_0(inst, i), cypress_pins, pin) DT_PHA(DT_INST_PINCTRL_0(inst, i), cypress_pins, pin)
/* Get HSIOM value associated with pinctrl-0 pin at index 'i' */ /* Get HSIOM value associated with pinctrl-0 pin at index 'i' */
#define CY_PSOC6_PIN_HSIOM(inst, i) \ #define CY_PSOC6_PIN_HSIOM(inst, i) \
DT_PHA(NODE_ID_FROM_PINCTRL_0(inst, i), cypress_pins, hsiom) DT_PHA(DT_INST_PINCTRL_0(inst, i), cypress_pins, hsiom)
/* Helper function for CY_PSOC6_PIN_FLAGS */ /* Helper function for CY_PSOC6_PIN_FLAGS */
#define CY_PSOC6_PIN_FLAG(inst, i, flag) \ #define CY_PSOC6_PIN_FLAG(inst, i, flag) \
DT_PROP(NODE_ID_FROM_PINCTRL_0(inst, i), flag) DT_PROP(DT_INST_PINCTRL_0(inst, i), flag)
/* Convert DT flags to SoC flags */ /* Convert DT flags to SoC flags */
#define CY_PSOC6_PIN_FLAGS(inst, i) \ #define CY_PSOC6_PIN_FLAGS(inst, i) \
@ -151,7 +147,7 @@
} }
/* Get the number of pins for pinctrl-0 */ /* Get the number of pins for pinctrl-0 */
#define CY_PSOC6_DT_INST_NUM_PINS(inst) DT_INST_PROP_LEN(inst, pinctrl_0) #define CY_PSOC6_DT_INST_NUM_PINS(inst) DT_INST_NUM_PINCTRLS_BY_IDX(inst, 0)
/* internal macro to structure things for use with UTIL_LISTIFY */ /* internal macro to structure things for use with UTIL_LISTIFY */
#define CY_PSOC6_PIN_ELEM(idx, inst) CY_PSOC6_DT_INST_PIN(inst, idx), #define CY_PSOC6_PIN_ELEM(idx, inst) CY_PSOC6_DT_INST_PIN(inst, idx),