@@ -102,8 +102,8 @@ struct i2s_mcux_config {
102
102
const struct device * ccm_dev ;
103
103
const struct pinctrl_dev_config * pinctrl ;
104
104
void (* irq_connect )(const struct device * dev );
105
- bool rx_sync_mode ;
106
- bool tx_sync_mode ;
105
+ sai_sync_mode_t rx_sync_mode ;
106
+ sai_sync_mode_t tx_sync_mode ;
107
107
};
108
108
109
109
/* Device run time data */
@@ -562,19 +562,9 @@ static int i2s_mcux_config(const struct device *dev, enum i2s_dir dir,
562
562
563
563
/* sync mode configurations */
564
564
if (dir == I2S_DIR_TX ) {
565
- /* TX */
566
- if (dev_cfg -> tx_sync_mode ) {
567
- config .syncMode = kSAI_ModeSync ;
568
- } else {
569
- config .syncMode = kSAI_ModeAsync ;
570
- }
571
- } else {
572
- /* RX */
573
- if (dev_cfg -> rx_sync_mode ) {
574
- config .syncMode = kSAI_ModeSync ;
575
- } else {
576
- config .syncMode = kSAI_ModeAsync ;
577
- }
565
+ config .syncMode = dev_cfg -> tx_sync_mode ;
566
+ } else if (dir == I2S_DIR_RX ) {
567
+ config .syncMode = dev_cfg -> rx_sync_mode ;
578
568
}
579
569
580
570
if (i2s_cfg -> options & I2S_OPT_FRAME_CLK_SLAVE ) {
@@ -1191,8 +1181,10 @@ static DEVICE_API(i2s, i2s_mcux_driver_api) = {
1191
1181
.ccm_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(i2s_id)), \
1192
1182
.irq_connect = i2s_irq_connect_##i2s_id, \
1193
1183
.pinctrl = PINCTRL_DT_INST_DEV_CONFIG_GET(i2s_id), \
1194
- .tx_sync_mode = DT_INST_PROP(i2s_id, nxp_tx_sync_mode), \
1195
- .rx_sync_mode = DT_INST_PROP(i2s_id, nxp_rx_sync_mode), \
1184
+ .tx_sync_mode = \
1185
+ DT_INST_PROP(i2s_id, nxp_tx_sync_mode) ? kSAI_ModeSync : kSAI_ModeAsync, \
1186
+ .rx_sync_mode = \
1187
+ DT_INST_PROP(i2s_id, nxp_rx_sync_mode) ? kSAI_ModeSync : kSAI_ModeAsync, \
1196
1188
.tx_channel = DT_INST_PROP(i2s_id, nxp_tx_channel), \
1197
1189
}; \
1198
1190
\
0 commit comments