From 699fc6dbe8c02b5758a3875aadf3a7e9029dc850 Mon Sep 17 00:00:00 2001 From: Tomas Barak Date: Mon, 12 May 2025 15:18:40 +0200 Subject: [PATCH] drivers: i2s: mcux_sai: add MCLK direction control in the initialization Add support for configuring the master clock (MCLK) direction in the I2S MCUX SAI driver. This allows controlling whether the MCLK pin acts as an input or output based on device tree configuration, improving flexibility when interfacing with external audio codecs. The change leverages the mclk_output property from device tree to properly set the direction of the MCLK pin during initialization. Signed-off-by: Tomas Barak --- drivers/i2s/i2s_mcux_sai.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2s/i2s_mcux_sai.c b/drivers/i2s/i2s_mcux_sai.c index 2cfd9da8fbb..4449897b533 100644 --- a/drivers/i2s/i2s_mcux_sai.c +++ b/drivers/i2s/i2s_mcux_sai.c @@ -1124,6 +1124,8 @@ static int i2s_mcux_initialize(const struct device *dev) /*clock configuration*/ audio_clock_settings(dev); + enable_mclk_direction(dev, dev_cfg->mclk_output); + SAI_Init(base); dev_data->tx.state = I2S_STATE_NOT_READY;