Skip to content

Commit 953f35f

Browse files
ananglcfriedt
authored andcommitted
drivers: i2s_nrfx: Do not enforce two channels for I2S format
Remove unnecessary condition that effectively limits the usability of the I2S format to two channels mode only. Although the description of the `i2s_config` structure contains a remark that for the I2S format the specified number of channels is ignored and always two are used, in fact only one other in-tree driver (i2s_sam_ssc) applies such limitation. The nRF I2S hardware has no problem with handling the I2S format with audio data for only one channel, so there is no need for having this limitation in the driver, and without such mode of operation of the driver it is impossible to feed it with PCM data directly from the PDM peripheral working in one channel mode. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 7cc24c3 commit 953f35f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/i2s/i2s_nrfx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,7 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir,
465465
return -EINVAL;
466466
}
467467

468-
if (i2s_cfg->channels == 2 ||
469-
(i2s_cfg->format & I2S_FMT_DATA_FORMAT_MASK)
470-
== I2S_FMT_DATA_FORMAT_I2S) {
468+
if (i2s_cfg->channels == 2) {
471469
nrfx_cfg.channels = NRF_I2S_CHANNELS_STEREO;
472470
} else if (i2s_cfg->channels == 1) {
473471
nrfx_cfg.channels = NRF_I2S_CHANNELS_LEFT;

0 commit comments

Comments
 (0)