Files
zephyr/soc/arm/ti_k3/pinctrl_soc.h
Yong Cong Sin 3300b31de8 boards: ti_k3: prevent header dependencies
These headers are using things like `uint32_t` & devicetree
macros, so they should include the `devicetree.h` & `types.h`.

Otherwise they depend on the parent file to have those headers
included before they are included.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-09-26 12:03:54 +02:00

41 lines
859 B
C

/*
* Copyright (c) 2023 Texas Instruments Incorporated
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SOC_ARM_TI_K3_PINCTRL_SOC_H_
#define ZEPHYR_SOC_ARM_TI_K3_PINCTRL_SOC_H_
#include <zephyr/devicetree.h>
#include <zephyr/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct pinctrl_soc_pin {
uint32_t offset;
uint32_t value;
};
typedef struct pinctrl_soc_pin pinctrl_soc_pin_t;
#define TI_K3_DT_PIN(node_id) \
{ \
.offset = DT_PROP_BY_IDX(node_id, pinmux, 0), \
.value = DT_PROP_BY_IDX(node_id, pinmux, 1) \
},
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
TI_K3_DT_PIN(DT_PROP_BY_IDX(node_id, prop, idx))
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
{ DT_FOREACH_PROP_ELEM(node_id, prop, Z_PINCTRL_STATE_PIN_INIT) }
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_SOC_ARM_TI_K3_PINCTRL_SOC_H_ */