soc: nuvoton_npcx: use new DT pinctrl accessors
Update to use the new APIs. Fix a typo while I'm here. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
73c7f55a45
commit
d40037c56e
1 changed files with 13 additions and 32 deletions
|
@ -121,17 +121,6 @@
|
||||||
inst) \
|
inst) \
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get phandle from 'pinctrl-0' prop which type is 'phandles' at index
|
|
||||||
* 'i'
|
|
||||||
*
|
|
||||||
* @param inst instance number for compatible defined in DT_DRV_COMPAT.
|
|
||||||
* @param i index of 'pinctrl-0' prop which type is 'phandles'
|
|
||||||
* @return phandle from 'pinctrl-0' prop at index 'i'
|
|
||||||
*/
|
|
||||||
#define NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i) \
|
|
||||||
DT_INST_PHANDLE_BY_IDX(inst, pinctrl_0, i)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Construct a npcx_alt structure from 'pinctrl-0' property at index 'i'
|
* @brief Construct a npcx_alt structure from 'pinctrl-0' property at index 'i'
|
||||||
*
|
*
|
||||||
|
@ -141,19 +130,11 @@
|
||||||
*/
|
*/
|
||||||
#define NPCX_DT_ALT_ITEM_BY_IDX(inst, i) \
|
#define NPCX_DT_ALT_ITEM_BY_IDX(inst, i) \
|
||||||
{ \
|
{ \
|
||||||
.group = DT_PHA(NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i), alts, group), \
|
.group = DT_PHA(DT_INST_PINCTRL_0(inst, i), alts, group), \
|
||||||
.bit = DT_PHA(NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i), alts, bit), \
|
.bit = DT_PHA(DT_INST_PINCTRL_0(inst, i), alts, bit), \
|
||||||
.inverted = DT_PHA(NPCX_DT_PHANDLE_FROM_PINCTRL(inst, i), alts, inv),\
|
.inverted = DT_PHA(DT_INST_PINCTRL_0(inst, i), alts, inv), \
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Length of npcx_alt structures in 'pinctrl-0' property
|
|
||||||
*
|
|
||||||
* @param inst instance number for compatible defined in DT_DRV_COMPAT.
|
|
||||||
* @return length of 'pinctrl-0' property which type is 'phandles'
|
|
||||||
*/
|
|
||||||
#define NPCX_DT_ALT_ITEMS_LEN(inst) DT_INST_PROP_LEN(inst, pinctrl_0)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Macro function to construct npcx_alt item in UTIL_LISTIFY extension.
|
* @brief Macro function to construct npcx_alt item in UTIL_LISTIFY extension.
|
||||||
*
|
*
|
||||||
|
@ -182,7 +163,7 @@
|
||||||
* @return an array of npcx_alt items.
|
* @return an array of npcx_alt items.
|
||||||
*/
|
*/
|
||||||
#define NPCX_DT_ALT_ITEMS_LIST(inst) { \
|
#define NPCX_DT_ALT_ITEMS_LIST(inst) { \
|
||||||
UTIL_LISTIFY(NPCX_DT_ALT_ITEMS_LEN(inst), \
|
UTIL_LISTIFY(DT_INST_NUM_PINCTRLS_BY_IDX(inst, 0), \
|
||||||
NPCX_DT_ALT_ITEMS_FUNC, \
|
NPCX_DT_ALT_ITEMS_FUNC, \
|
||||||
inst) \
|
inst) \
|
||||||
}
|
}
|
||||||
|
@ -221,7 +202,7 @@
|
||||||
* @return phandle from 'pinctrl-0' prop at index 'i'
|
* @return phandle from 'pinctrl-0' prop at index 'i'
|
||||||
*/
|
*/
|
||||||
#define NPCX_DT_IO_PHANDLE_FROM_PINCTRL(io_comp, inst, i) \
|
#define NPCX_DT_IO_PHANDLE_FROM_PINCTRL(io_comp, inst, i) \
|
||||||
NPCX_DT_COMP_INST_PHANDLE_BY_IDX(io_comp, inst, pinctrl_0, i)
|
DT_PINCTRL_BY_IDX(NPCX_DT_COMP_INST(io_comp, inst), 0, i)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Construct a npcx_alt structure from 'pinctrl-0' property at index 'i'
|
* @brief Construct a npcx_alt structure from 'pinctrl-0' property at index 'i'
|
||||||
|
@ -229,7 +210,7 @@
|
||||||
*
|
*
|
||||||
* @param io_comp compatible string in devicetree file for io-pads device
|
* @param io_comp compatible string in devicetree file for io-pads device
|
||||||
* @param inst instance number for compatible defined in io_comp.
|
* @param inst instance number for compatible defined in io_comp.
|
||||||
* @param i index of 'pinctrl_0' prop which type is 'phandles'
|
* @param i index of 'pinctrl-0' prop which type is 'phandles'
|
||||||
* @return npcx_alt item from 'pinctrl-0' property at index 'i'
|
* @return npcx_alt item from 'pinctrl-0' property at index 'i'
|
||||||
*/
|
*/
|
||||||
#define NPCX_DT_IO_ALT_ITEM_BY_IDX(io_comp, inst, i) \
|
#define NPCX_DT_IO_ALT_ITEM_BY_IDX(io_comp, inst, i) \
|
||||||
|
@ -251,7 +232,7 @@
|
||||||
* @return length of 'pinctrl-0' property which type is 'phandles'
|
* @return length of 'pinctrl-0' property which type is 'phandles'
|
||||||
*/
|
*/
|
||||||
#define NPCX_DT_IO_ALT_ITEMS_LEN(io_comp, inst) \
|
#define NPCX_DT_IO_ALT_ITEMS_LEN(io_comp, inst) \
|
||||||
DT_PROP_LEN(NPCX_DT_COMP_INST(io_comp, inst), pinctrl_0)
|
DT_NUM_PINCTRLS_BY_IDX(NPCX_DT_COMP_INST(io_comp, inst), 0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Macro function to construct npcx_alt item with specific compatible
|
* @brief Macro function to construct npcx_alt item with specific compatible
|
||||||
|
@ -607,7 +588,7 @@
|
||||||
* @return phandle from 'pinctrl-0' prop at index 'i'
|
* @return phandle from 'pinctrl-0' prop at index 'i'
|
||||||
*/
|
*/
|
||||||
#define NPCX_DT_PHANDLE_FROM_PSL_PINMUX_NODE(i) \
|
#define NPCX_DT_PHANDLE_FROM_PSL_PINMUX_NODE(i) \
|
||||||
DT_PHANDLE(NPCX_DT_PHANDLE_FROM_PSL_IN_NODE(i), pinctrl_0)
|
DT_PINCTRL_0(NPCX_DT_PHANDLE_FROM_PSL_IN_NODE(i), 0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get phandle from 'polarity-0' prop which type is 'phandles' at index
|
* @brief Get phandle from 'polarity-0' prop which type is 'phandles' at index
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue