Skip to content

Commit 9079fa7

Browse files
committed
drivers: wm8962, wm8904: Fix clock config logic
Fix clock config logic of wm8962 and wm8904 drivers, so that both can be properly configured for master (generating BCK and WS) and slave (receiving those) operation. Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
1 parent b3ccee4 commit 9079fa7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/audio/wm8904.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ static int wm8904_configure(const struct device *dev, struct audio_codec_cfg *cf
504504

505505
wm8904_audio_fmt_config(dev, &cfg->dai_cfg, cfg->mclk_freq);
506506

507-
if ((cfg->dai_cfg.i2s.options & I2S_OPT_FRAME_CLK_MASTER) == I2S_OPT_FRAME_CLK_MASTER) {
507+
if ((cfg->dai_cfg.i2s.options & I2S_OPT_FRAME_CLK_SLAVE) == 0) {
508508
wm8904_set_master_clock(dev, &cfg->dai_cfg, cfg->mclk_freq);
509509
} else {
510510
/* BCLK/LRCLK default direction input */

drivers/audio/wm8962.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ static int wm8962_configure(const struct device *dev, struct audio_codec_cfg *cf
506506
wm8962_write_reg(dev, WM8962_REG_POWER1, 0x1FE);
507507
wm8962_write_reg(dev, WM8962_REG_POWER2, 0x1E0);
508508

509-
if ((cfg->dai_cfg.i2s.options & I2S_OPT_FRAME_CLK_SLAVE) == I2S_OPT_FRAME_CLK_SLAVE) {
509+
if ((cfg->dai_cfg.i2s.options & I2S_OPT_FRAME_CLK_SLAVE) == 0) {
510510
wm8962_set_master_clock(dev, &cfg->dai_cfg, cfg->mclk_freq);
511511
wm8962_update_reg(dev, WM8962_REG_IFACE0, 1U << 6U, 1U << 6U);
512512
}

0 commit comments

Comments
 (0)