forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Give users a chance to plug their headsets in #328
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
please just increase the ring/tip sense debounce time in
cs42l84_setup_plug_detect
instead. cs42l84 seems to use the same 3 bit linear scale from 0 to 1500ms. cl42l43 uses 500ms for ring sense debounce as well.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 tried that. The issue is the timing after the interrupt is triggered and we try to detect what type of device is plugged in. You can still reliably reproduce the failure mode even with the long debounce because the issue is the time between detection starting and the plug being fully seated.
What we could do is shorten this delay and max out the debounce, but this delay is important to eliminate (or at least, materially reduce) the chance of misdetecting headsets as headphones
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 think there is something fundamentally wrong witht the jack detection. Aftyer actually trying this I can reproduce it but the increased delay only pampers over the the issue. The issue is that the detection routine is run when the plug is not fully seated. That detect headsets as
Detected bare headphone (no mic)
. I would expect that there is a second irq once the jack is fully inserted.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.
yes, we only get interrupts on ring sense plug and unplug. I suppose tip sense plug and ing sense unplug would be more appropriate.
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.
If we are only getting the interrupt on ring sense, then how is the plug detection even running? We set
current_plug_status
based on the tip sense register only, and the detection logic only runs if tip sense says we're plugged in...If tip sense isn't hit, then we would just clear the interrupt without doing anything right?
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.
never mind, that was the interrupt mask.
Looking at the not fully seated plug it's possible that the tip already makes contact. So maybe we would need to re-run hs_detect on ring sense irqs. I don't think any of the other cirrus jack codecs do that.