-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: audio: Add get_caps API to DMIC, I2S, and Codec subsystems #98500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add SCK and WS signals to a shared signal set between Flexcomm #1 and Flexcomm #3 for the mimxrt685_evk/mimxrt685s/cm33. This enables the board to both transmit and receive audio, as the BCK and WS signals produced by the WM8904 codec are only connected to the Flexcomm #1 peripheral. Signed-off-by: Vit Stanicek <[email protected]>
Map all pins of RT685's Flexcomm #1 peripheral. Needed for operation of Flexcomm #1 in I2S mode or Flexcomm #3 in I2S mode with shared signals. Signed-off-by: Vit Stanicek <[email protected]>
|
Hello @michal-chvatal, and thank you very much for your first pull request to the Zephyr project! |
9474e9d to
9bfeb2e
Compare
decsny
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add testing of this feature
| struct _dmic_ops *api = (struct _dmic_ops *)dev->api; | ||
|
|
||
| if (api->get_caps == NULL) { | ||
| return -ENOSYS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this particular error code should be documented what it means
| struct i2s_driver_api *api = (struct i2s_driver_api *)dev->api; | ||
|
|
||
| if (api->get_caps == NULL) { | ||
| return -ENOSYS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this particular error code should be documented what it means
|
I've created a pull request for the libMP-related changes only: #99087 .I'll also take the above comments into account in the next update. |
Introduce `get_caps()` API to DMIC, I2S, and Codec subsystems to expose driver-specific audio capabilities such as supported sample rates, bit widths, channel counts, buffer requirements, and frame timing. Introduce common audio definitions in `audio_caps.h` to unify capability flags across subsystems. Signed-off-by: Michal Chvatal <[email protected]>
Implement the `get_caps()` API for MCUX I2S Flexcomm, DMIC, and WM8904 audio drivers to expose driver-specific capabilities including supported sample rates, bit widths, channel counts, and buffer requirements. All drivers set temporary 10ms minimum frame interval as workaround for MediaPipe library compatibility. Signed-off-by: Michal Chvatal <[email protected]>
Changes affect: - drivers: i2s_mcux_flexcomm, dmic_mcux and wm8904 - audio subsystem headers: i2s.h, codec.h, dmic.h No functional changes, formatting improvements only. Signed-off-by: Michal Chvatal <[email protected]>
Add test for the `get_caps()` API in both I2S and DMIC driver test suites. Tests validate successful operation, capability value ranges, and error handling with NULL parameters. Tests handle drivers that don't implement get_caps by gracefully skipping when -ENOSYS is returned, ensuring compatibility across different driver implementations. Signed-off-by: Michal Chvatal <[email protected]>
9bfeb2e to
d3b76a0
Compare
|



This PR introduces
get_caps()API to DMIC, I2S, and Codec subsystems, enablingdrivers to report their audio capabilities such as supported sample rates, bit widths,
channel counts, buffer requirements, and frame timing.
It implements the API for MCUX I2S Flexcomm, DMIC, and WM8904 audio drivers.
It also introduces common audio definitions in
audio_caps.hto unify capabilityflags across subsystems.
Changes are related to new MediaPipe library.
Also fix pin mapping and Flexcomm signal sharing on the mimxrt685_evk/mimxrt685s/cm33 (included also in the #95164).