From 73c7f55a45e76b95f15c16151d93495bace7b03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Thu, 12 Aug 2021 07:08:28 -0700 Subject: [PATCH] soc: cypress: use new DT pinctrl accessors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update to use the new APIs. Signed-off-by: Martí Bolívar --- soc/arm/cypress/common/cypress_psoc6_dt.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/soc/arm/cypress/common/cypress_psoc6_dt.h b/soc/arm/cypress/common/cypress_psoc6_dt.h index 9f20a5f2209..a8bbe53aad5 100644 --- a/soc/arm/cypress/common/cypress_psoc6_dt.h +++ b/soc/arm/cypress/common/cypress_psoc6_dt.h @@ -106,25 +106,21 @@ * 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' */ #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' */ #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' */ #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 */ #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 */ #define CY_PSOC6_PIN_FLAGS(inst, i) \ @@ -151,7 +147,7 @@ } /* 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 */ #define CY_PSOC6_PIN_ELEM(idx, inst) CY_PSOC6_DT_INST_PIN(inst, idx),