When current source mode is enabled, comparator auto
zeroing should be turned ON by HW. As rouleur codec HW
doesn't do this automatically, add this support
in SW to set the auto zero enable before FSM enable
and reset to auto once FSM is enabled.
Disable surge protection before ADC measurements
and change HPHL and HPHR thresholds while
identifying cross connection for proper
accessory identification.
Change-Id: Ib775de0f0bdb6c655a3c0eb4775276acfbca1e84
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Current source mode in rouleur does not work
properly leading to issues in button interrupts
and fake electrical removal interrupts.
Enable pull up mode instead of current source
mode to fix these issues. Modify the headset
max vref voltage to 1.7 volts and micbias
calculation logic.
Change-Id: If3e4a2fdcf080b07fe3c363b6eb6115f101b91f4
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Playback pauses during aux cable insertion as removal of
cable is reported followed by insertion. Report removal
of current cable only when headset connected to other end
of extension cable and not lineout.
Change-Id: I08933f4a88493136a518ee72646aa10b1f06eb70
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Add CONFIG_AUDIO_QGKI check for variables and functions
in audio drivers, so they are used only during a QGKI build.
Change-Id: Ia04232566367f196f298a49cf3962bb7927bec6a
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Audio is distorted during first 3 secs on headset record
while doing device switch from dmic to headset mic.
Disable BCS before slow insertion detection and enable it
afterwards to resolve the issue.
Change-Id: Ie5bc4b5292e5f69066760cab44d78989a74f13f4
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
In wcd_mbhc_adc_hs_rem_irq when hph_on bit is set
both left and right channel should get enabled. But we
enable left channel first, disable left ch and enable right channel.
Fix this to enable both left and right channel.
Change-Id: Ia50c55a0ed68e01359ef0a9c76eba6901a04e17c
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
When detecting special headset, vref for special headset is
set based on headset threshold reference 1800mv or based on
regular micbias settings from device tree. Scale threshold
reference as per the special headset micbias voltage.
Change-Id: Ic4cc24e18efeb420b53a2154707c9399eb886181
Signed-off-by: Meng Wang <mwang@codeaurora.org>
Mono headsets have only one channel connected. Hence make cross
connection decision based on the voltage result of alteast one
channel showing cross connection.
Change-Id: I22a4ea7e25d09e785e7141f4a74c2830fdff555e
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Some alsa API are removed in kernel-4.19 which would cause
codec driver compile failure. Update codec driver to fix it.
Change-Id: Ie358ec1863082166958059c179300b453d2a03ad
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Switch audio drivers to SPDX identifier on msm-4.19.
Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Check for in2p clamp state in insertion irq
and ignore the interrupt if the clamp is already
set, which means the mechanical removal is about
to happen next.
Change-Id: I55691d427cf07d5b61862b6dbd39f3ec34d873e5
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Comparison of headset threshold during special headset detection is
not proper. This results in to improper detection of special headset
and recording usecase failure on special headset. Fix the special
headset detection issue by adding proper check condition while selection
of headset threshold from device tree.
Change-Id: I4c338ded1bcb9fa643e1584eb23c6260fe52acee
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
After headset removal disable button current source
to not have any voltages output in micbias after
headset removal from extension cable.
Change-Id: I2a751c16c704176381bb26f375aebf351686e911
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
To reduce time of usb-c analog headset detection, reduce
gnd mic swap threshold if usb-c is enabled. Use
existing threshold value otherwise.
CRs-Fixed: 2137077
Change-Id: Ic1d1f3a00c9034caaac45f2c80f018546a69ce59
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
when moisture is in jack, removing of the plug result in
electrical removal interrupt. So, update electrical interrupt
handler to handle mechanical removal based on moisture status.
CRs-Fixed: 2058106
Change-Id: I9cfbfbaf04783f0edcadb14d7828759020745289
Signed-off-by: Meng Wang <mwang@codeaurora.org>
To config different headset detection parameters for different hardware, add
two new headset detection parameters in device tree and read it in mbhc driver.
Change-Id: I10457b7d5eae54eba8a4cd273885a63ebad3ccb3
Signed-off-by: Meng Wang <mwang@codeaurora.org>