drivers: WM89xx: fix a dts prop naming issue

1. the clock-source is wrongly typed as clk-source,
which happen to pass the build and function check.
2. and should use DT_INST_ENUM_IDX for index enumrate
as string.

Signed-off-by: Hake Huang <hake.huang@nxp.com>
This commit is contained in:
Hake Huang
2025-09-20 00:41:10 +08:00
committed by Fabio Baltieri
parent 136ad68ac3
commit 30e31fa0d0
2 changed files with 2 additions and 2 deletions

View File

@@ -671,7 +671,7 @@ static const struct audio_codec_api wm8904_driver_api = {
#define WM8904_INIT(n) \
static const struct wm8904_driver_config wm8904_device_config_##n = { \
.i2c = I2C_DT_SPEC_INST_GET(n), \
.clock_source = DT_INST_PROP_OR(n, clk_source, 0), \
.clock_source = DT_INST_ENUM_IDX(n, clock_source), \
.mclk_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_NAME(n, mclk)), \
.mclk_name = (clock_control_subsys_t)DT_INST_CLOCKS_CELL_BY_NAME(n, mclk, name)}; \
\

View File

@@ -718,7 +718,7 @@ static const struct audio_codec_api wm8962_driver_api = {.configure = wm8962_con
#define wm8962_INIT(n) \
static const struct wm8962_driver_config wm8962_device_config_##n = { \
.i2c = I2C_DT_SPEC_INST_GET(n), \
.clock_source = DT_INST_PROP_OR(n, clk_source, 0), \
.clock_source = DT_INST_ENUM_IDX(n, clock_source), \
.mclk_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_NAME(n, mclk)), \
.mclk_name = (clock_control_subsys_t)DT_INST_CLOCKS_CELL_BY_NAME(n, mclk, name)}; \
\