drivers: pinctrl: nrf: add flag to signal the FAST_ACTIVE1 peripherals
This patch introduces a new flag to indicate if a peripheral belongs to FAST_ACTIVE1 domain. This way, pinctrl knows when to request the SLOW_ACTIVE domain (where CTRLSEL multiplexer resides). Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
87a42a89cb
commit
9925ec99fd
3 changed files with 62 additions and 4 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <zephyr/devicetree.h>
|
||||
#include <zephyr/dt-bindings/pinctrl/nrf-pinctrl.h>
|
||||
#include <zephyr/dt-bindings/power/nordic-nrf-gpd.h>
|
||||
#include <zephyr/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -55,6 +56,16 @@ typedef uint32_t pinctrl_soc_pin_t;
|
|||
(), NRF_GET_FUN(DT_PROP_BY_IDX(node_id, prop, idx))) \
|
||||
0)), (0))
|
||||
|
||||
/**
|
||||
* @brief Utility macro to get the GPD_FAST_ACTIVE1 flag
|
||||
*
|
||||
* @param p_node_id Parent node identifier.
|
||||
*/
|
||||
#define Z_GET_GPD_FAST_ACTIVE1(p_node_id) \
|
||||
COND_CODE_1(DT_NODE_HAS_PROP(p_node_id, power_domains), \
|
||||
((DT_PHA(p_node_id, power_domains, id) == \
|
||||
NRF_GPD_FAST_ACTIVE1) << NRF_GPD_FAST_ACTIVE1_POS), (0))
|
||||
|
||||
/**
|
||||
* @brief Utility macro to initialize each pin.
|
||||
*
|
||||
|
@ -70,7 +81,8 @@ typedef uint32_t pinctrl_soc_pin_t;
|
|||
(DT_PROP(node_id, nordic_drive_mode) << NRF_DRIVE_POS) | \
|
||||
((NRF_LP_ENABLE * DT_PROP(node_id, low_power_enable)) << NRF_LP_POS) |\
|
||||
(DT_PROP(node_id, nordic_invert) << NRF_INVERT_POS) | \
|
||||
Z_GET_CLOCKPIN_ENABLE(node_id, prop, idx, p_node_id) \
|
||||
Z_GET_CLOCKPIN_ENABLE(node_id, prop, idx, p_node_id) | \
|
||||
Z_GET_GPD_FAST_ACTIVE1(p_node_id) \
|
||||
),
|
||||
|
||||
/**
|
||||
|
@ -99,6 +111,14 @@ typedef uint32_t pinctrl_soc_pin_t;
|
|||
#define NRF_GET_CLOCKPIN_ENABLE(pincfg) \
|
||||
(((pincfg) >> NRF_CLOCKPIN_ENABLE_POS) & NRF_CLOCKPIN_ENABLE_MSK)
|
||||
|
||||
/**
|
||||
* @brief Utility macro to obtain GPD_FAST_ACTIVE1 flag
|
||||
*
|
||||
* @param pincfg Pin configuration bit field.
|
||||
*/
|
||||
#define NRF_GET_GPD_FAST_ACTIVE1(pincfg) \
|
||||
(((pincfg) >> NRF_GPD_FAST_ACTIVE1_POS) & NRF_GPD_FAST_ACTIVE1_MSK)
|
||||
|
||||
/**
|
||||
* @brief Utility macro to obtain pin inversion flag.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue