Skip to content

Commit 02b45f5

Browse files
mbolivar-nordicnashif
authored andcommitted
soc: riscv-ite: use new DT pinctrl accessors
Update to use the new APIs. Signed-off-by: Martí Bolívar <[email protected]>
1 parent d40037c commit 02b45f5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

soc/riscv/riscv-ite/common/soc_dt.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
#ifndef _ITE_IT8XXX2_SOC_DT_H_
88
#define _ITE_IT8XXX2_SOC_DT_H_
99

10-
#define IT8XXX2_DEV_PINMUX(idx, inst) DEVICE_DT_GET(DT_PHANDLE(DT_PHANDLE_BY_IDX \
11-
(DT_DRV_INST(inst), pinctrl_0, idx), pinctrls))
12-
#define IT8XXX2_DEV_PIN(idx, inst) DT_PHA(DT_PHANDLE_BY_IDX \
13-
(DT_DRV_INST(inst), pinctrl_0, idx), pinctrls, pin)
14-
#define IT8XXX2_DEV_ALT_FUNC(idx, inst) DT_PHA(DT_PHANDLE_BY_IDX \
15-
(DT_DRV_INST(inst), pinctrl_0, idx), pinctrls, alt_func)
10+
#define IT8XXX2_DEV_PINMUX(idx, inst) DEVICE_DT_GET(DT_PHANDLE( \
11+
DT_INST_PINCTRL_0(inst, idx), pinctrls))
12+
#define IT8XXX2_DEV_PIN(idx, inst) DT_PHA( \
13+
DT_INST_PINCTRL_0(inst, idx), pinctrls, pin)
14+
#define IT8XXX2_DEV_ALT_FUNC(idx, inst) DT_PHA( \
15+
DT_INST_PINCTRL_0(inst, idx), pinctrls, alt_func)
1616

1717
/**
1818
* @brief Macro function to construct it8xxx2 alt item in UTIL_LISTIFY extension.
@@ -35,10 +35,10 @@
3535
* @param inst instance number for compatible defined in DT_DRV_COMPAT.
3636
* @return an array of it8xxx2 alt items.
3737
*/
38-
#define IT8XXX2_DT_ALT_ITEMS_LIST(inst) { \
39-
UTIL_LISTIFY(DT_INST_PROP_LEN(inst, pinctrl_0), \
40-
IT8XXX2_DT_ALT_ITEMS_FUNC, \
41-
inst) \
38+
#define IT8XXX2_DT_ALT_ITEMS_LIST(inst) { \
39+
UTIL_LISTIFY(DT_INST_NUM_PINCTRLS_BY_IDX(inst, 0), \
40+
IT8XXX2_DT_ALT_ITEMS_FUNC, \
41+
inst) \
4242
}
4343

4444
#endif /* _ITE_IT8XXX2_SOC_DT_H_ */

0 commit comments

Comments
 (0)