ASoC: WCD9310: Fix issues with headset detection
After inserting and removing a headset many times during
a recording or playback, sometimes the last headset removal
event is not detected by the MBHC driver. This is because
turning on the microphone bias used for MBHC can cause the
hardware to go into an unknown state. Restarting the
hardware state machine after enabling the microphone bias
allows the state machine to recover.
Sometimes, the button release handler is triggered even
though there is no headset inserted. This happens because
the button release interrupt is not masked when the
headset is removed. By only unmasking the button release
interrupt when a headset is inserted, the button release
handler is only triggered when a button is actually
released. The button release interrupt cannot be unmasked
in the button press interrupt handler, because it is
likely that the release event could be missed due to its
interrupt being masked when the button was actually
released. This problem causes kernel warnings due to
unbalanced enabling of interrupts.
Signed-off-by: Brad Rubin <brubin@codeaurora.org>
1 file changed