Add test APIs for clock switching NDP120 PDM <-> I2S BCLK #6426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Draft PR adds test code to allow switching between internally and externally generated PDM clock.
This test code in
configure_audio()
called during init sets up for internal clock and then adds intermediate test apis for dynamic use to either:or
The assumption in this code is that at NDP initialization time, the buffer on i2s bclk is set to disabled (OE=0) so NDP can take control of the PDM clock.
To switch the clock in the two different cases:
Switching from internal -> external
I) Switch NDP to external using
ndp120_test_internal_external_switch(dev, 0)
API, this will stop the PDM clock from NDP without a hard reconfig of the rest of the PDM interface.II) Set buffer OE=1 to allow i2s clk to DMIC
Switching from external -> internal
I) Set buffer to OE=0, to enable the tri-state of i2s clk to DMIC
II) Switch NDP to internal using
ndp120_test_internal_external_switch(dev, 1)
API, this will start the PDM clock from NDP-Switching from internal -> external: Call
ndp120_test_internal_passthrough_switch(dev, 0)
API-Switching from external -> internal: Call
ndp120_test_internal_passthrough_switch(dev, 1)
API