Grafik Komit

36 Melakukan

Penulis SHA1 Pesan Tanggal
Ganapathiraju Sarath Varma
ffa772dcc9 asoc: cdc: mbhc: Return from hs_rem_irq, when hs is already removed
add check to return from the hs_rem_irq( ) if the headset
removal is already reported.

Change-Id: If9ffc1a471b80f8c9d01875b531748327032926a
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2023-08-04 01:06:09 +05:30
Prasad Kumpatla
312d94f693 asoc: mbhc: change special HS pr_debug
change the debug print from wcd_mbhc_adc_check_for_spl_headset
func to caller wcd_correct_swch_plug function.

Change-Id: Iabca7351a1abb1ad7b3de15812b4a6014a0463ad
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-04-18 22:28:29 -07:00
qctecmdr
02975b1480 Merge "asoc: mbhc: change the logic of cross_conn checking" 2023-03-29 05:37:18 -07:00
Yuhui Zhao
b9ca5f9eea asoc: mbhc: change the logic of cross_conn checking
Change the logic of cross_conn checking from or to and

Change-Id: Ic91ab177d6e6997dc0c5cb496c611a6cccd027e1
2023-03-28 17:55:50 +08:00
Prasad Kumpatla
c11ffbb93b asoc: adc: check the interrupt status bit for hs_ins
usbc USCI event gets called and removal is reported, where bit
0 of mbhc->intr_status i.e. (WCD_MBHC_ELEC_HS_INS) will be set to 0.
So in adc_hs_ins_irq() we can check if the WCD_MBHC_ELEC_HS_INS bit
is 0 or not, if 0 we just ignore the and return.

Change-Id: I5a7753a077f53c5cd26c8ad199899ff9c81ef7b8
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-03-28 14:47:04 +05:30
Prasad Kumpatla
961a510ecb Revert "asoc: mbhc: disable pa while measuring the adc values"
This reverts commit 05a1b9bd4d.

Change-Id: I6121659f31affc6210b1fa0bd2f2d34fa8d17c9f
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-09-21 14:46:59 +05:30
Prasad Kumpatla
4f81d6205e asoc: mbhc: add null check before accessing the pa_enable()
add null check before accessing the pa_enable fucn.

Change-Id: I5f86f8e6ea847b0f5e0eb69f531328e2358d7352
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-08-23 16:17:48 +05:30
Prasad Kumpatla
05a1b9bd4d asoc: mbhc: disable pa while measuring the adc values
While measuring the adc, if PA is on we will get incorrect values of
adc due to which the detection type is missmatched. So disable the PA
While measuring the adc values and restore back PA once measuring adc
done.

Change-Id: I5833452e23a71637353449bb48b937ee44be24ae
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-07-26 10:53:38 +05:30
Vatsal Bucha
5f65bb9592 ASoC: codecs: mbhc-adc: Check if moisture duty cycle enabled during elec rem irq
With moisture_en flag being set as true for legacy moisture detection,
need to check if duty cycle is also enabled so as to report headset
insertion/removal properly when moisture detection enabled.

Change-Id: I6014e2e047d7c33b16bf9229ee1901fd8d042b47
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-11-24 01:35:45 -08:00
Vatsal Bucha
6527fdb4e6 ASoC: mbhc-adc: Enable BCS if plug type already reported
BCS is not enabled sometimes after inserting headset if
plug is already reported and we dont report it again.
Enable BCS if plug type already reported.

Change-Id: I8c9f15ced66a21bda169d3479da96168ebec26a7
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-08-31 05:40:54 -07:00
Vatsal Bucha
47942f03ae ASoC: mbhc-adc: Resolve headset removal detected because of elec irq
When SVA is enabled and headset is inserted and playback is started
on headset, sometimes electrical irq is triggered resulting in
headset removal being reported. This happens because of high mic
voltage being reported. Enable micbias before checking for adc
voltage to resolve issue.

Change-Id: If7445c906b2e62f12b48548a2d435db01f184587
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-08-24 14:16:38 +05:30
Vatsal Bucha
8b5bcc5a56 ASoC: mbhc-adc: Resolve bcs not enabled for us headset
BCS is not enabled for us headset as after 3sec loop
we directly switch to report headset and bcs is still disabled.
Enable bcs only after reporting valid plug to resolve issue.

Change-Id: I69bb71d20583fd2e2be921e9b657d9c44c047708
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-08-02 02:52:43 -07:00
Meng Wang
ecf424366e asoc: mbhc: add extcon device for MBHC
Add extcon device for MBHC.

Change-Id: I2f22223bc62f4f4b5f2e8cb61cf7e7d41548947f
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-04-29 10:04:21 +08:00
Meng Wang
efae28bba9 asoc: mbhc: disable/enable BCS for all headset types
When EU headset is inserted into US headset jack and corrected as
right jack type, BCS will not be enabled. Remove the headset
type check to disable/enable BCS for all headset types.

Change-Id: I9898581727b74795cb357a19a2489761aa294f3b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-03-18 16:19:08 +08:00
Meng Wang
dcc84d6ff8 asoc: wcd-mbhc: report headset when it's not reported
During bootup and headset inserted, headset may first
detect as GND_MIC swap type and not report. During three
seconds polling, it's corrected as headset or headphone.
When wrk_complete is false, it will not report to userspace.
When current_plug is MBHC_PLUG_TYPE_NONE, report headset or
headphone to userspace.

Change-Id: I63394f1704c34cf355f0f4b0c33959332a69a639
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-09-02 13:33:09 +08:00
Aditya Bavanari
313aa17ac4 asoc: codecs: Add comparator autozeroing support for rouleur
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>
2020-06-03 21:04:31 -07:00
Aditya Bavanari
c3fd6cc305 asoc: codecs: Fix button interrupts issue in rouleur
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>
2020-06-03 13:46:02 -07:00
Vatsal Bucha
c2e5189852 ASoC: wcd-mbhc: Fix playback pause during lineout insertion
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>
2020-04-16 09:51:53 -07:00
Vignesh Kulothungan
823f0f01fe ASoC: add config check for QGKI
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>
2020-01-26 03:51:32 +05:30
Faiz Nabi Kuchay
54fe9be449 asoc: codecs: Add NULL check before calling bcs_enable callback function
Add NULL check before calling bcs_enable callback function.

Change-Id: Ic2d65534710d71c074c55d67da3e8a9793bab637
Signed-off-by: Faiz Nabi Kuchay <fkuchay@codeaurora.org>
2019-11-15 15:13:19 +05:30
Vatsal Bucha
d06525fa68 ASoC: Fix audio distortion issue during headset record
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>
2019-10-15 05:07:51 -07:00
Vatsal Bucha
a8f9dc90d8 ASoC: mbhc: Fix left channel getting disabled in hs_rem_irq
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>
2019-06-10 23:23:43 -07:00
Meng Wang
37621b06ee ASoC: wcd-mbhc: correct special headset detection logic
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>
2019-04-16 13:21:42 +08:00
Ramprasad Katkam
ebcfca4e9a asoc: codecs: mbhc: Detect cross connection for mono headsets
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>
2019-01-02 17:07:27 +08:00
Meng Wang
11a25cf657 asoc: update relative header files
Move all relative header files to include folder.

Change-Id: Ic61a61a88823b4749dbe8c1f680d08201a3b4a48
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-18 10:50:27 +08:00
Meng Wang
43bbb87652 asoc: Update file header to GPL-2.0-only
Update file header to GPL-2.0-only.

Change-Id: Ic1542a3209a5fe73c937a5b36491ede4a451936d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-10 14:49:34 +08:00
Meng Wang
15c825d077 ASoC: codec: Update codec driver to component driver
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>
2018-12-08 03:15:55 -08:00
Meng Wang
61af6849e9 ASoC: switch audio drivers to SPDX identifier
Switch audio drivers to SPDX identifier on msm-4.19.

Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 15:47:32 +08:00
Karthikeyan Mani
dd50371847 asoc: mbhc: fix for fake ins irq
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>
2018-08-30 01:05:53 -07:00
Sudheer Papothi
ede0f05017 ASoC: wcd-mbhc: Fix detection of special headset
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>
2018-06-15 04:06:31 +05:30
Karthikeyan Mani
6bcd94a7ce asoc: wcd-mbhc: disable button current source after removal
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>
2018-03-16 14:48:59 -07:00
Karthikeyan Mani
5392d8052e asoc: codecs: modify gnd mic swap threshold for usb-c analog
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>
2017-12-11 21:03:01 -08:00
Linux Build Service Account
50091ca0c6 Merge "ASoC: wcd-mbhc: update electrical removal detection logic" 2017-10-06 03:35:15 -07:00
Meng Wang
6f90162f22 ASoC: wcd-mbhc: update electrical removal detection logic
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>
2017-09-28 17:01:15 +08:00
Meng Wang
4d6a6bef32 ASoC: wcd-mbhc: add support to read new headset detection parameters
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>
2017-09-19 09:48:34 +08:00
Laxminath Kasam
605b42f92c audio-lnx: Rename folders to new flat structure.
Kernel audio drivers can be categorised into below folders.
asoc - ALSA based drivers,
asoc/codecs - codec drivers,
ipc - APR IPC communication drivers,
dsp - DSP low level drivers/Audio ION/ADSP Loader,
dsp/codecs - Native encoders and decoders,
soc - SoC based drivers(pinctrl/regmap/soundwire)

Restructure drivers to above folder format.
Include directories also follow above format.

Change-Id: I8fa0857baaacd47db126fb5c1f1f5ed7e886dbc0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-08-18 16:56:12 -06:00