1 /* 2 * Copyright (c) 2023 Synopsys 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_SOC_ARC_SNPS_EMSDP_PINCTRL_H_ 8 #define ZEPHYR_SOC_ARC_SNPS_EMSDP_PINCTRL_H_ 9 10 #include <zephyr/devicetree.h> 11 #include <zephyr/types.h> 12 13 typedef struct pinctrl_soc_pin_t { 14 uint8_t pin; 15 uint8_t type; 16 } pinctrl_soc_pin_t; 17 18 #define EMSDP_DT_PIN(node_id) \ 19 { \ 20 .pin = DT_PROP_BY_IDX(node_id, pinmux, 0), \ 21 .type = DT_PROP_BY_IDX(node_id, pinmux, 1) \ 22 }, 23 24 #define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \ 25 EMSDP_DT_PIN(DT_PROP_BY_IDX(node_id, prop, idx)) 26 27 #define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \ 28 { DT_FOREACH_PROP_ELEM(node_id, prop, Z_PINCTRL_STATE_PIN_INIT) } 29 30 #endif /* ZEPHYR_SOC_ARC_SNPS_EMSDP_PINCTRL_H_ */ 31