Skip to content

Commit b226d08

Browse files
decsnygmarull
authored andcommitted
[nrf fromtree] drivers: kinetis-pinctrl: Account for SCG K4
Add support for SCG K4 clock control in kinetis pinctrl. Signed-off-by: Declan Snyder <[email protected]> (cherry picked from commit 2db9ea9)
1 parent 540b834 commit b226d08

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/pinctrl/pinctrl_kinetis.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,13 @@ static int pinctrl_mcux_init(const struct device *dev)
7676
}
7777

7878
#if DT_NODE_HAS_STATUS(DT_INST(0, nxp_kinetis_sim), okay)
79-
#define PINCTRL_MCUX_DT_INST_CLOCK_SUBSYS(n) \
80-
CLK_GATE_DEFINE(DT_INST_CLOCKS_CELL(n, offset), \
81-
DT_INST_CLOCKS_CELL(n, bits))
79+
#define PINCTRL_MCUX_DT_INST_CLOCK_SUBSYS(n) \
80+
CLK_GATE_DEFINE(DT_INST_CLOCKS_CELL(n, offset), DT_INST_CLOCKS_CELL(n, bits))
81+
#elif DT_HAS_COMPAT_STATUS_OKAY(nxp_scg_k4)
82+
#define PINCTRL_MCUX_DT_INST_CLOCK_SUBSYS(n) \
83+
(DT_INST_CLOCKS_CELL(n, mrcc_offset) == 0 \
84+
? 0 \
85+
: MAKE_MRCC_REGADDR(MRCC_BASE, DT_INST_CLOCKS_CELL(n, mrcc_offset)))
8286
#else
8387
#define PINCTRL_MCUX_DT_INST_CLOCK_SUBSYS(n) \
8488
DT_INST_CLOCKS_CELL(n, name)

0 commit comments

Comments
 (0)