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.
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
Initial implementation of driver #9
Initial implementation of driver #9
Changes from 1 commit
5ae6d2e
11252cc
b4b496c
58fdc04
1dbaa56
25d1c62
9cf880b
0931a58
7db24a4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What is supporting evidence that unlock sequence needs to done only once?
I went through the datasheet and I see that there is no "aad lock" sequence being mentioned and it doesn't explicitly state that you should unlock it once, or every time you talk to the mic.
Can you check this with the microphone vendor?
It could be that is just safer to reset the mic everytime before user wants to configure it, it that case
aad_unlocked
would be redundant.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.
After powering microphone up, certain sequence needs to be written to enable use of AAD modes. This has to be done every time we want to use AAD after power cycling microphone.
see section "5.12. AAD ENABLE SEQUENCE" of microphone datasheet.
Naming it "unlocked" was done to prevent confusion with just enabling AAD mode.
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.
I missed out this section, so some of my previous comments can be dismissed (most notably my first question).
This comment is also wrong,
micen
is optional, so driver should not rely on it.Copied from the datasheet:
I suggest you to implement it like that, run the unlock sequence once in the init (if AAD is enabled) or in
t5838_reset
(if AAD is enabled).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.
The issue with running said sequence once during init is that PDM functionality doesn't call init function when zephyr boots like with most zephyr drivers.
API is made in the way that you configure PDM peripheral parameters and call
dmic_configure()
to apply configuration to PDM peripheral.However, I don't think it is good idea to depend on calling this function as initializer for AAD triggering functionality, since that prevents us from using AAD mode without having configured PDM peripheral. This limits potential use case where we can use AAD for triggering microphone levels but we don't need to actually sample PDM samples.
PDM configuration function is also not good place to do this, since changing PDM sampling rate during runtime does call configuration function multiple times to reapply new configuration. So we would need something to check if we already unlocked AAD modes anyway inside said function.
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.
To elaborate my previous statement: I meant
int t5838_pdm_nrfx_init##idx(const struct device *dev)
function, notdmic_configure
.