From 478822f74ced77e65e3116addf0dc739b6819b60 Mon Sep 17 00:00:00 2001 From: Mahesh Mahadevan Date: Wed, 14 Apr 2021 13:46:03 -0500 Subject: [PATCH] drivers: i2s: Do not support 8-bit word size in LPC I2S driver The memory block passed by the user to the i2s_write function is tightly packed next to each other. However for 8-bit word_size the I2S hardware expects the data to be in 2bytes which does not match what is passed by the user. This will be addressed in a separate PR once the zephyr API committee finalizes on an I2S API for the user to probe hardware variations. Signed-off-by: Mahesh Mahadevan --- drivers/i2s/i2s_mcux_flexcomm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/i2s/i2s_mcux_flexcomm.c b/drivers/i2s/i2s_mcux_flexcomm.c index adc2fa8142c..4c2c8764dde 100644 --- a/drivers/i2s/i2s_mcux_flexcomm.c +++ b/drivers/i2s/i2s_mcux_flexcomm.c @@ -201,6 +201,18 @@ static int i2s_mcux_configure(const struct device *dev, enum i2s_dir dir, return 0; } + /* + * The memory block passed by the user to the i2s_write function is + * tightly packed next to each other. + * However for 8-bit word_size the I2S hardware expects the data + * to be in 2bytes which does not match what is passed by the user. + * This will be addressed in a separate PR once the zephyr API committee + * finalizes on an I2S API for the user to probe hardware variations. + */ + if (i2s_cfg->word_size <= 8) { + return -ENOTSUP; + } + /* Figure out function base clock */ if (clock_control_get_rate(cfg->clock_dev, cfg->clock_subsys, &base_frequency)) {