Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions drivers/audio/dmic_mcux.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,11 @@ static uint8_t dmic_mcux_hw_chan(struct mcux_dmic_drv_data *drv_data,
enum pdm_lr lr;
uint8_t hw_chan;

/* This function assigns hardware channel "n" to the left channel,
* and hardware channel "n+1" to the right channel. This choice is
* arbitrary, but must be followed throughout the driver.
*/
dmic_parse_channel_map(drv_data->chan_map_lo,
drv_data->chan_map_hi,
log_chan, &hw_chan, &lr);
if (lr == PDM_CHAN_LEFT) {
return hw_chan * 2;
} else {
return (hw_chan * 2) + 1;
}

return hw_chan;
}

static void dmic_mcux_activate_channels(struct mcux_dmic_drv_data *drv_data,
Expand Down Expand Up @@ -495,9 +488,9 @@ static int dmic_mcux_configure(const struct device *dev,
dmic_parse_channel_map(channel->req_chan_map_lo,
channel->req_chan_map_hi,
chan + 1, &hw_chan_1, &lr_1);
/* Verify that paired channels use same hardware index */
/* Verify that paired channels use consecutive hardware index */
if ((lr_0 == lr_1) ||
(hw_chan_0 != hw_chan_1)) {
(hw_chan_1 != (hw_chan_0 + 1))) {
return -EINVAL;
}
}
Expand Down