Skip to content
Closed
1 change: 1 addition & 0 deletions drivers/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ zephyr_library_sources_ifdef(CONFIG_AUDIO_CODEC_PCM1681 pcm1681.c)
zephyr_library_sources_ifdef(CONFIG_AUDIO_CODEC_MAX98091 max98091.c)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link to the reference manual so reviewers can analyze the hardware IP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add it when i back to the office, but i'd like to know where the link should be added? I noticed that you made a comment in the CMakeLists file, so do I need to put link in the CMakeLists file? This seems rather strange.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link should be added in the commit message.

Also, this PR is a mix of everything adding a codec, adding a dmic driver, enhancements to samples, whitespace fixes to DMIC.

This is a nightmare to review. Let's pause a bit and organize everything in a more logical way so that we can have good code quality and have meaningful reviews.

Let's split this into multiple PRs like this:

PR1: Add support for Dialog7212 codec driver

This will include following patches:

ffa63a5 samples: i2s_codec: enable i2s_codec samples for frdm_mcxn236
6f15a7f boards: frdm_mcxn236: Enable da7212 on frdm_mcxn236
3432318 drivers: audio: Add dialog7212 driver
611f84a dts: bindings: add dialog vendor prefix

PR2: Small enhancements to audio
d7fc5b1 samples: i2s_codec: Refine sample for samll RAM platforms
af1fa22 audio: dmic: Format dmic.h

PR3: Add NXP DMIC MICFIL support
1449a5ed4 samples: i2s_codec: Enable nxp micfil test
d5e9f21 board: frdm_mcxn236: Enable MICFIL on frdm_mcxn236
a2a730b drivers: mcux_syscon: enable MICFIL clock control
e1b8489 drivers: audio: Add NXP MICFIL driver

This 3 PRs cand be sent separately are independent and can be reviewed in parallel. We go merge PR2 very fast.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to be careful of is the "refine sample for small RAM platforms".

It is unclear to me which set of enablement needed this fix. If it was needed for the da7212 enablement then put it before that set of commits. If needed for the MICFIL support then it is in the right place based on the recommendation.

The high-level guidance here is that each commit needs to stand on its own and be bisectable. There should be a logical grouping of commits. And don't overload a PR with a bunch of significant enablement because of the challenge it puts on the reviewers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"refine sample for small RAM platforms" should placed before i2s_codec example enablement for DA7212 and MICFIL, that is before ffa63a5 and 2c1449a.

From a technical/logical perspective, the commit sequence in this PR is well-structured and bisectable:

  1. Enable DA7212 driver
  2. Refine i2s_codec example for DA7212 and MICFIL test
  3. Enable DA7212 test
  4. Format dmic.h
  5. Enable MICFIL driver base DMIC device driver model
  6. Enable MICFIL test

However, I recognize my oversight regarding reviewer burden. I will split this PR, please move your comments to new PRs

zephyr_library_sources_ifdef(CONFIG_AUDIO_DMIC_AMBIQ_PDM dmic_ambiq_pdm.c)
zephyr_library_sources_ifdef(CONFIG_AUDIO_CODEC_DA7212 da7212.c)
zephyr_library_sources_ifdef(CONFIG_AUDIO_DMIC_NXP_MICFIL dmic_nxp_micfil.c)
1 change: 1 addition & 0 deletions drivers/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ source "drivers/audio/Kconfig.mpxxdtyy"
source "drivers/audio/Kconfig.dmic_pdm_nrfx"
source "drivers/audio/Kconfig.dmic_mcux"
source "drivers/audio/Kconfig.dmic_ambiq_pdm"
source "drivers/audio/Kconfig.dmic_nxp_micfil"

endif # AUDIO_DMIC

Expand Down
22 changes: 22 additions & 0 deletions drivers/audio/Kconfig.dmic_nxp_micfil
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 NXP
#
# SPDX-License-Identifier: Apache-2.0

config AUDIO_DMIC_NXP_MICFIL
bool "NXP MICFIL driver"
default y
depends on DT_HAS_NXP_MICFIL_ENABLED
select HAS_MCUX
select CLOCK_CONTROL
help
Enable NXP MICFIL driver.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer everywhere as DMIC PDM to avoid confusion with MICFIL PDM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed the driver to micfil, please review

if AUDIO_DMIC_NXP_MICFIL

config DMIC_NXP_MICFIL_QUEUE_SIZE
int "Message queue depth"
default 4
help
Depth of the message queue used to pass filled buffers to the app.

endif # AUDIO_DMIC_NXP_MICFIL
Loading