ASoC: wcd-mbhc: Improve detection speed and accuracy
This is a squash of the following commits originally for msm8996:
commit 10f18edf71664ff96130b4a1e22fd9ab6a1ba652
Author: Sultanxda <sultanxda@gmail.com>
Date: Mon Sep 5 12:34:50 2016 -0700
ASoC: wcd-mbhc: Clean up plug correction
*No need to disable mic bias
*Remove unnecessary changes
*Add back quick detection before entering the plug-correction loop
Signed-off-by:
Sultanxda <sultanxda@gmail.com>
commit 2babe1396a37c688f5fdbc6c7488661bea7fb90a
Author: Sultanxda <sultanxda@gmail.com>
Date: Fri Dec 29 12:18:10 2017 -0800
ASoC: wcd-mbhc: Fix headphone detection
Currently, headphones are detected as a headset, which causes a problem
when the user wants to use a microphone. In this situation, the on-board
microphone is erroneously disabled and the system attempts to enable the
microphone on the attached peripheral, even though there isn't any
microphone on a regular pair of headphones, causing no microphone to be
available for input.
Clean up the button-interrupt disable logic to prevent interference with
plug correction, and fix the plug correction logic so that headphones are
detected properly.
Signed-off-by:
Sultanxda <sultanxda@gmail.com>
commit 3b616f741b794440ef3d1bd4683bd445b9c4be4f
Author: Sultanxda <sultanxda@gmail.com>
Date: Sat Aug 13 16:15:30 2016 -0700
ASoC: wcd-mbhc: Ignore button interrupts until detection is complete
When a plug is inserted into the jack quickly, spurious button
interrupts are generated and interfere with UX for a short amount of
time after plug detection is complete. To reproduce: play music out of
speaker, plug in jack during music playback, and the music playback will
pause after being routed to the peripheral inserted into the jack (due
to a spurious button press).
To fix this, ignore all button interrupts during plug detection, as well
as for 750 ms after plug detection is completed.
Signed-off-by:
Sultanxda <sultanxda@gmail.com>
commit 9085ba67246ffcd3600b47dc5cc31d3269e3d32a
Author: Sultanxda <sultanxda@gmail.com>
Date: Sat Aug 13 16:04:55 2016 -0700
ASoC: wcd-mbhc: Fix incorrect detection during slow plug insertion
When any plug is inserted into our jack very slowly, it can be detected as
a plug with the ground and mic pins swapped, causing MBHC to give up early
and skew the plug detection. Instead of giving up when this happens, keep
iterating to make sure the plug is properly detected.
Signed-off-by:
Sultanxda <sultanxda@gmail.com>
commit c2aff3bfec79d8ab05e4f7f43d634d3d9faf6198
Author: Sultanxda <sultanxda@gmail.com>
Date: Sat Aug 13 16:01:51 2016 -0700
ASoC: wcd-mbhc: Speed up headphone and headset detection
Instead of wasting time iterating for the full 3-second loop duration,
exit early if the detected plug type has been determined to be a headset
or headphones 3 times. Also speed up headset detection by treating
high-impedance headphones as a headset, as our hardware does not properly
detect high-impedance headphones (it usually mistakes a headset for
high-impedance headphones and significantly slows down detection times).
Signed-off-by:
Sultanxda <sultanxda@gmail.com>
commit 742cfb13b79ad64f884147ae3340870e9a9bdc21
Author: Sultanxda <sultanxda@gmail.com>
Date: Sat Aug 13 15:58:06 2016 -0700
ASoC: wcd-mbhc: Reduce latency during plug correction
Sleeping for a very long time in here leads to slow detections and poor UX.
Instead of sleeping for the same amount of time on each iteration, use a
dynamic delay so that the delay is extended when the number of iterations
goes up. Also don't double check if a stop request has been issued (waste
of time).
Signed-off-by:
Sultanxda <sultanxda@gmail.com>
Change-Id: I803e18810028f2666341f609a0de7c0f7cb59ab2
Signed-off-by:
Sultanxda <sultanxda@gmail.com>
Signed-off-by:
Nathan Chancellor <natechancellor@gmail.com>
Loading
Please register or sign in to comment