Граф коммитов

37 Коммитов

Автор SHA1 Сообщение Дата
Vignesh Kulothungan
75f229237a ASoC: codecs: handle device disconnect during SSR
During SSR, when usbc analog device is disconnected, the
respective disconnect interrupt is not handled and hence userspace
is not notified. When ADSP recovers, fsa driver sends a disconnect
notification. So handle device disconnect and notify jack/userspace
through this notification.

Change-Id: Ic695c2267c9289f9528d50202938ec09f634de8a
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-06-17 23:07:21 -07: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
Akhil Karuturi
3ba03d15fe ASOC: Remove support for ANC headphones
ANC headphones are no longer supported, removed dead code related to the feature.

Change-Id: I3dd51b5b1d9f77fd870947608f8a14fc3f7aeed0
Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
2020-05-07 19:51:29 -07:00
qctecmdr
8707284023 Merge "ASoC: wcd-mbhc: Fix playback pause during lineout insertion" 2020-04-29 22:27:54 -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
Vatsal Bucha
7544634ca6 ASoC: wcd-mbhc: Disable moisture detect threshold if duty cycle disabled
Moisture detection is not disabled properly if threshold
remains set as 24k even if duty cycle is disabled.
This is leading into headset not getting detected
sometimes. Disable threshold as well if duty cycle disabled.

Change-Id: Ic90c65d8bbaa965cf147f95edf5add8980889e1f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-16 03:11:42 -07:00
Vatsal Bucha
2ccb20dc4c ASoC: wcd-mbhc: Disable micbias internal pull-up after headphone detected
Micbias2 internal pull-up remains enabled even after headphone is detected.
This results in power issues. Disable pull up after insertion detection.

Change-Id: I335dbb498192738fc282421d92510400a661cf0c
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-01 11:50:10 -07:00
Ramlal Karra
6abe95fd0b asoc: codecs: Avoid MBHC OverCurrentProtection.
In the existing code, Over Current Protection interrupt is enabled
 as part of MBHC insertion event handling.
This is causing audio mute on Stereo Headset randomly.
This OCP through MBHC is no more required as the
 Over Current/surge is handled in HW.
Removing the OCP enabling code to fix the issue.

CRs-Fixed: 2622368

Change-Id: Iae8994aa365eb294793190f665407af111b23c82
Signed-off-by: Ramlal Karra <rkarra@codeaurora.org>
2020-03-24 00:36:46 -07:00
Meng Wang
7f70656cc0 asoc: mbhc: update mode for analog type-c headset check
POWER_SUPPLY_TYPEC_SINK_AUDIO_ADAPTER is not supported on new
kernel-5.4. Update mode to TYPEC_ACCESSORY_AUDIO for analog
type-c headset.

Change-Id: Id46ea2eebea8257a48134431f07a81b6ed7e6c7d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-02-10 09:38:35 +08: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
Vignesh Kulothungan
16a9d512d7 ASoC: codecs: use function if config is enabled
Use "wcd_mbhc_usbc_ana_event_handler" function only when
CONFIG_QCOM_FSA4480_I2C is enabled.

Change-Id: I5211a8ce09fb06021310e528b5815fdbcd3f2dab
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-01-07 18:59:45 -08:00
qctecmdr
3adccae508 Merge "ASoC: wcd-mbhc: Fix headset insert not detected after moisture config" 2019-11-01 21:30:24 -07:00
Vatsal Bucha
7b663b23b2 ASoC: wcd-mbhc: Fix headset insert not detected after moisture config
Headset insertion is not detected after moisture is configured and then
removed. This is because during moisture_detect GND_DET_EN is configured
irrespective of whether it is enabled or not. Add a check before enabling
gnd_det_en. Also as moisture_en is disabled and duty cycle is enabled
change check during removal to disable threshold and polling.

Change-Id: Iee9d79b38b228e78d1509d59e92d37f1328f079e
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-10-25 00:47:21 -07:00
Vatsal Bucha
fc40b33b24 ASoC: wcd-mbhc: Fix null pointer dereference for mbhc
IRQ data pointer is corrupted due to slimbus NGD errors.
This may happen as IRQ will be received from slimbus.
Check for mbhc null pointer before dereferencing to avoid crash.

Change-Id: I142ee535c6d643b53063b57c0f45414aff8b6304
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-10-22 12:22:04 +05:30
Vatsal Bucha
cd339694c5 ASoC: wcd-mbhc: Remove max impedance limit for lineout detection
Max limit of 60k ohms was set for cable to be detected as lineout
to fix headset detected as lineout issue on legacy targets.
This was because of large impedance detected for headset.
This is not applicable for adc based targets as headset is
detected based on mic adc voltage. Remove max impedance limit for
lineout detection.

Change-Id: If73bbe2cd78d04d1fcb359a3e5ed5cd69f3ab9f0
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-09-11 00:11:55 -07:00
Vatsal Bucha
48003fde1a ASoC: wcd-mbhc: Fix high impedance lineout detected as headphone issue
During playback if lineout is inserted it is detected
as lineout then changed to headphone. This is because
we do not compute impedance again as pa is on. Force
jack to be detected as lineout based on initial detection
to resolve the issue.

Change-Id: I243c324dcd251596db97aeef07b8535986550650
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-24 16:12:36 +05:30
Vatsal Bucha
15e7831783 ASoC: wcd-mbhc: Remove hardcoding of hphl and gnd swh to NC for analog USBC
Read hphl_swh and gnd_swh from dtsi instead of hardcoding to NC
for every USBC target. Some platforms use NO switch.

Change-Id: I3dca6c7450579e8feb5d80c1340495958683a026
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-05 07:59:58 -07:00
Vatsal Bucha
e1728c5c3c ASoC: wcd-mbhc: Disable moisture_en when duty cycle is enabled
Moisture Detection should be disabled at init if duty cycle is enabled.

Change-Id: If398928a680174d981b9baefe02d9efd4e21766e
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-02-20 19:00:12 +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
Vatsal Bucha
4b8884a7ae ASoC: wcd: Remove non-essential current source votings from adc
Zdet current source is enabled for 4 pole aux cable and kept
even after plug removal. This increases voltage for both hph left and
right which causes error in cross-connection detection for subsequent plug
detections. Remove current source enablement from unrequired places.

CRs-Fixed: 2234559
Change-Id: Icffbca88f7a6873c509c91e31b494dd6d5d21cb9
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-11-22 00:54:35 -08:00
Md Mansoor Ahmed
26d8bddff4 Asoc: codec: Fix compilation errors for sdmsteppe target
Fix compilation errors for sdmsteppe target.

Change-Id: I511bfd5271d04b455e46a101c47ea1535681dcca
Signed-off-by: Md Mansoor Ahmed <mansoor@codeaurora.org>
2018-11-20 11:07:28 +05:30
Sudheer Papothi
a45a56e824 ASoC: wcd-mbhc: Avoid headset jack corrosion due to moisture
Detect moisture in the headset jack and avoid headset jack
corrosion due to presence of moisture over prolonged duration.

Change-Id: I0227e516feb58c96ddf6a8fbc32423bfe7733ca6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-08-16 03:27:20 +05:30
Karthikeyan Mani
3dd07e6937 asoc: mbhc: ignore mbhc event report during ssr
When ssr is in progress, during some race conditions
mbhc events are getting reported when codec is still
coming up. Ignore such events without reporting.

Change-Id: I3d3f78f97c2b855fc36a480f38c166bda2d979f0
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2018-07-02 11:22:40 -07:00
Karthikeyan Mani
8d772b0efb asoc: wcd-mbhc: enable mbhc clk based on L_DET
Enable or disable mbhc clk in sync with L_DET
so that L_DET interrupt is not raised for
false positives for usbc analog.

Change-Id: I69792e8dc82cdc80751f2c1c705f603074cb9a2f
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2018-03-23 10:35:59 -07:00
Phani Kumar Uppalapati
8fe02478b7 asoc: wcd-mbhc: add support for usbc analog audio on msmnile
Add support for usbc analog audio for msmnile platform
by adding fsa driver calls in mbhc driver to make
any switching orientation changes of gnd/mic.

Change-Id: Iab7511907325a24345734402c10a4cf5f8ebfa23
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2018-03-08 12:02:18 -08:00
Sudheer Papothi
8c9bd0f7d0 ASoC: wcd9xxx: Add new callback for headset pull up current
AQT1000 supports different headset detect pull up current source
values in MBHC. Add a callback function to handle new current
source values in MBHC driver.

Change-Id: I060af1aff3fe7c4dfd4aa4c480542efa54c2777c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-02-16 06:20:33 -08:00
Vatsal Bucha
d6d62b8d3c ASoC: wcd: Avoid multiple insertion/removals for aux cable
High impedance aux cable when inserted causes jack to change to
lineout. This causes removal event to be called which results
in pause during music playback because jack value is not updated.
Do not change current plug while plug is marked as lineout.

CRs-Fixed: 2151012
Change-Id: I99797b58c48be00185a352094e32e8623faee491
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2017-12-21 20:30:38 -08: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
Laxminath Kasam
8b1366a648 Audio: DLKM support for all audio modules
Switch to DLKM for all audio kernel modules.

Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-11-02 13:42:09 +05:30
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