Skip to content

Commit fa63671

Browse files
gmarullcarlescufi
authored andcommitted
drivers: i2s: mcux_sai: use instance based macros
Replace usages of DT_DRV_INST with instance based macros. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent b9d573f commit fa63671

File tree

1 file changed

+19
-30
lines changed

1 file changed

+19
-30
lines changed

drivers/i2s/i2s_mcux_sai.c

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,40 +1097,29 @@ static const struct i2s_driver_api i2s_mcux_driver_api = {
10971097
\
10981098
static const struct i2s_mcux_config i2s_##i2s_id##_config = { \
10991099
.base = (I2S_Type *)DT_INST_REG_ADDR(i2s_id), \
1100-
.clk_src = \
1101-
DT_CLOCKS_CELL_BY_IDX(DT_DRV_INST(i2s_id), \
1102-
0, bits), \
1100+
.clk_src = DT_INST_CLOCKS_CELL_BY_IDX(i2s_id, 0, bits), \
11031101
.clk_pre_div = DT_INST_PROP(i2s_id, pre_div); \
11041102
.clk_src_div = DT_INST_PROP(i2s_id, podf); \
1105-
.pll_src = \
1106-
DT_PHA_BY_NAME(DT_DRV_INST(i2s_id), \
1107-
pll_clocks, src, value), \
1108-
.pll_lp = \
1109-
DT_PHA_BY_NAME(DT_DRV_INST(i2s_id), \
1110-
pll_clocks, lp, value), \
1111-
.pll_pd = \
1112-
DT_PHA_BY_NAME(DT_DRV_INST(i2s_id), \
1113-
pll_clocks, pd, value), \
1114-
.pll_num = \
1115-
DT_PHA_BY_NAME(DT_DRV_INST(i2s_id), \
1116-
pll_clocks, num, value), \
1117-
.pll_den = \
1118-
DT_PHA_BY_NAME(DT_DRV_INST(i2s_id), \
1119-
pll_clocks, den, value), \
1120-
.mclk_pin_mask = \
1121-
DT_PHA_BY_IDX(DT_DRV_INST(i2s_id), \
1122-
pinmuxes, 0, function), \
1123-
.mclk_pin_offset = \
1124-
DT_PHA_BY_IDX(DT_DRV_INST(i2s_id), \
1125-
pinmuxs, 0, pin), \
1103+
.pll_src = DT_INST_PHA_BY_NAME(i2s_id, pll_clocks, src, \
1104+
value), \
1105+
.pll_lp = DT_INST_PHA_BY_NAME(i2s_id, pll_clocks, lp, \
1106+
value), \
1107+
.pll_pd = DT_INST_PHA_BY_NAME(i2s_id, pll_clocks, pd, \
1108+
value), \
1109+
.pll_num = DT_INST_PHA_BY_NAME(i2s_id, pll_clocks, num, \
1110+
value), \
1111+
.pll_den = DT_INST_PHA_BY_NAME(i2s_id, pll_clocks, den, \
1112+
value), \
1113+
.mclk_pin_mask = DT_INST_PHA_BY_IDX(i2s_id, pinmuxes, \
1114+
0, function), \
1115+
.mclk_pin_offset = DT_INST_PHA_BY_IDX(i2s_id, pinmuxs, \
1116+
0, pin), \
11261117
.clk_sub_sys = (clock_control_subsys_t) \
1127-
DT_CLOCKS_CELL_BY_IDX(DT_DRV_INST(i2s_id), \
1128-
0, name), \
1129-
.ccm_dev = DEVICE_DT_GET( \
1130-
DT_CLOCKS_CTLR(DT_DRV_INST(i2s_id))), \
1118+
DT_INST_CLOCKS_CELL_BY_IDX(i2s_id, 0, name), \
1119+
.ccm_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(i2s_id)), \
11311120
.pinmux_dev = DEVICE_DT_GET( \
1132-
DT_PHANDLE_BY_IDX(DT_DRV_INST(i2s_id), \
1133-
pinmuxes, 0)), \
1121+
DT_INST_PHANDLE_BY_IDX(i2s_id, pinmuxes,\
1122+
0)), \
11341123
.irq_connect = i2s_irq_connect_##i2s_id, \
11351124
.tx_sync_mode = \
11361125
DT_INST_PROP(i2s_id, nxp_tx_sync_mode), \

0 commit comments

Comments
 (0)