Skip to content
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

Add test APIs for clock switching NDP120 PDM <-> I2S BCLK #6426

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cvejlbo
Copy link
Contributor

@cvejlbo cvejlbo commented Oct 4, 2024

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:

  1. switch to external clock (or back again) - for use when buffer is in use
    or
  2. switch to using PCLK1 input as passthrough (or back again) - for the case where I2S BCLK is connected to PCLK1 input

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:

  1. with "buffer approach": Generally, this needs to be done in "break before make" fashion
  • 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

  1. with "PDM passthrough" approach: (assumes buffer OE=0)
    -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

@Taejun-Kwon
Copy link
Contributor

Seems that work fine (pclk). we will test it more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants