feat: implement polling-based headphone detection with software debounce #538
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.
Summary
Replaces hardware auto-detect with direct MFP3 pin reading and time-based software debouncing for headphone jack detection. This provides better control over detection behavior and centralizes policy logic in the AudioOutput HAL layer.
Driver Layer Changes (Aic3204)
update_headphone_detection()method that embedded policy logic in the driver_headphone_inserted_statemember variableHAL Layer Changes (AudioOutput)
get_absolute_time(),absolute_time_diff_us())headphones_inserted()- Returns cached debounced stateset_headphone_listener()- Register callback for state changesclear_headphone_listener()- Clear callbackenable_auto_speaker_mute()- Toggle automatic amp control policyArchitecture Benefits
Test Plan