Commit Graph

43 Commits

Author SHA1 Message Date
Vatsal Bucha
5707577c13 ASoC: wcd-mbhc: Resolve warning log when mutex destroy before unlock
Resolve warning log when hph pa mutex lock is destroyed before
unlock. Initialize hph pa locks as global lock and do not destroy
during SSR to resolve issue.

Change-Id: Idc5af793294f7fdc8dbcc17770f68fe2c46ab337
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-04-22 05:53:57 -07:00
Amit Kumar H
bc905e33d5 asoc: codec: Fix compilation for wcd9335 driver
Change macros for 5.4 kernel compatible.

Change-Id: Iaf15183653d8c2f2072437cfb92d048a954e96f9
Signed-off-by: Vivek Malapaka <malapaka@codeaurora.org>
Signed-off-by: Amit Kumar H <amih@codeaurora.org>
2020-10-23 10:31:53 +05:30
Vignesh Kulothungan
a77e386d54 Revert "ASoC: codecs: handle device disconnect during SSR"
This reverts commit 75f229237a.

Change-Id: Ie37d6ac80a3f86df50cdaab65dfd51624f7c7517
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-09-18 13:15:07 -07:00
Vatsal Bucha
625753df87 ASoC: codec: Change name for enum defined for callback between wcd and bolero
Add enum names defined for callback between wcd and bolero in
separate file and include that file in order to have same enum
across wcd and bolero.

Change-Id: I808c2ad3de37655c1ba2b8e096def60703ced7f2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-09-09 20:26:36 -07:00
Vatsal Bucha
48029da3fe ASoC: rouleur: Change hph and ear gain according to soc capacity
Register to power supply framework to get soc capacity.
Reduce ear and hph gain for reduced voltage to optimize
power consumption. Also set LD22 voltage to lower value
for low SoC.

Change-Id: I94de9341b8c7307128d3cd41c7398c31d57fa685
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-07-21 19:33:24 -07:00
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
qctecmdr
a77e7d4be8 Merge "asoc: codecs: Add delay to eliminate playback pause post SSR on hs" 2020-06-09 09:24:19 -07:00
qctecmdr
c1a9199e09 Merge "asoc: codecs: Update LPM voting support for vdd-mic-bias-supply" 2020-06-05 01:54:03 -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
Sanjana B
79fba80fa6 asoc: msm-cdc-pinctrl: Add alternate pinctrl state for DSD input
Add additional pinctrl states to support alternative function.
This change enables support of alternative pins through pinctrl
framework.

Change-Id: I1f3f9a13345846f1714b4ecaeecde975b5cf6813
Signed-off-by: Sanjana B <sanjb@codeaurora.org>
2020-05-29 10:43:09 -07:00
Laxminath Kasam
ec8a0b507c asoc: codecs: Update LPM voting support in codec supplies
For power saving during RBSC, need to vote for minimum
or zero current on load for respective regulator to
enter LPM mode. Add required support from audio WCD/WSA
to vote accordingly during suspend/resume.

Change-Id: I578195b84ba18a0b69dde3b93a3f6461efa85f7f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-05-26 14:22:15 +05:30
qctecmdr
c3c4fd765e Merge "ASoC: update headers for upstream compliance" 2020-05-14 22:04:36 -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
Vignesh Kulothungan
e0bdd11269 ASoC: update headers for upstream compliance
Update uapi header reference path to include
path prefix "audio/"

Change-Id: Ic7b1d22910b07be3ffe8d9f02514ed89facea974
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-05-06 11:26:15 -07:00
Laxminath Kasam
1ecf8184d2 asoc: wcd938x: Add vdd-buck as on demand supply
On lagoon, vdd-buck need to be dynamic supply.
Add required support to handle buck as dynamic supply.

Change-Id: If6c27fffe0d0c44f178e61a6eae6ef63775c8988
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-04-29 23:26:53 -07:00
Karthikeyan Mani
669b885ac7 asoc: codecs: Add codec supply to enable mic bias pin
Add interface to initialize and enable/disable
wcd codec supply.

Change-Id: If2b2a3120f7f0c87dc6ebe1c1e6c9062b7f2891e
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2020-01-28 21:42:29 -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
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
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
Sudheer Papothi
124ec09342 ASoC: msm-cdc-pinctrl: Add support to control wakeup capable gpios
Some clock and data gpios are also treated as wakeup source capable
interrupts. Add support to control the wakeup capability based on
the usecase.

Change-Id: I32a12f004afbf04f82e40be62747b0af8836be82
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-08-07 06:18:00 +05:30
Karthikeyan Mani
b9d7807f4e asoc: codecs: Change TX tuning and reduce RX click and pop
Update TX requantizer gain coefficients to center
gain errors around zero. To reduce click and pop
on audio playback enable reference buffers of
headphone path in hifi mode and then put it to
the usecase specific power mode.

Change-Id: I0013d6258d5e5a8c92fd0f951d1d89e5906b2faf
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-06-27 17:01:46 -07:00
qctecmdr
45b4733d63 Merge "asoc: codecs: defer probe if soundwire pin is not ready" 2019-06-17 20:25:32 -07:00
Karthikeyan Mani
326536d1d6 asoc: codecs: defer probe if soundwire pin is not ready
Defer codec macro probes if soundwire pins are not
ready to be accessed yet during boot up.

Change-Id: I20173e49043a076d73cdbb811863afbff87d4a3b
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-06-11 17:48:35 -07:00
Karthikeyan Mani
7f609a3ca0 asoc: codecs: Add support for class ab low power modes
Add codec enable and disable sequences for class ab
low power modes.

Change-Id: If5b54075985c2d4d1a24423c03e78bee119862bc
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-06-11 17:47:21 -07:00
Karthikeyan Mani
090de46cad asoc: codecs: Add inline keyword to all stub functions
Add inline keyword to stub functions to compile them
inline when the corresponding feature config is disabled.

Change-Id: I933d508fc0fd5c2ad8daa26be7d39eea2a3434b9
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-16 10:54:47 -07:00
qctecmdr
b418f419b0 Merge "ASoC: wcd-mbhc: correct special headset detection logic" 2019-04-30 11:07:14 -07:00
Mangesh Kunchamwar
7f6fc83bc9 asoc: codecs: enable dynamic RX & TX supplies for WCD9335
Enable and vote RX and TX supplies dynamically during respective
usecases.

Change-Id: I671c14b34ce0325e102d94083905329d473d4a78
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
Signed-off-by: Surendar Karka <skarka@codeaurora.org>
2019-04-25 09:52:56 +08: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
Laxminath Kasam
f16ed2f6c2 asoc: wcd938x: Disable EN_CUR_DET bit for receiver noise
Disable EN_CUR_DET to fix receiver noise as per hardware
specifications recommendation.

Change-Id: Ib1ea1eecc3e0f2ffeeb5f41c344e51c903cd2300
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-03-20 08:26:12 +08:00
Karthikeyan Mani
1efdee5fd5 asoc: codecs: make cdc pinctrl common to all core objects
cdc pinctrl needs to be loaded for both v1 and v2 wcd
core objects.

Change-Id: I4742e96b54bbd481583a6d12fd32fddb63216077
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-02-14 00:33:06 -08:00
Meng Wang
b0e04799e4 ASoC: config: add config to compile audio drivers for kona
Add config to compile audio drivers for kona.

Change-Id: I3367a68d0109c80de8525fd74ebaef2959684865
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-21 12:19:44 +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
Linux Build Service Account
355332ce80 Merge "ASoC: switch audio drivers to SPDX identifier" 2018-12-07 13:20:51 -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
Meng Wang
64aae620b0 ASoC: wcd-irq: correct identifier name to fix compile error
The two arguments in functions wcd_request_irq, wcd_free_irq,
wcd_enable_irq and wcd_disable_irq have same identifier names.
Correct wcd_irq_info identifier name to fix compile error

Change-Id: I6f240d3af1cd253336d070d0f3228eae96a4fcb6
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 11:19:46 +08:00
Meng Wang
d6107d0bbe asoc: clean up audio drivers and remove unused files
Clean up audio drivers and remove unused files.

Change-Id: I50559ac3c5f4a1f4336e4480cd3ff235d015441e
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-06 15:04:09 +08:00
Laxminath Kasam
7adc34e496 asoc: codecs: Add new class-H driver for wcd937x
Add new class-H driver with sequences to support
both class-H and class-AB modes on wcd937x variants.

Change-Id: Ie109f3d951af1e8a0079dd39ab2fe1e9883bd6c2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-13 13:15:59 +05:30
Vatsal Bucha
485ec2c851 ASoC: codecs: Add IRQ utils support based on regmap
Add irq utils support for tanggu codec. It is
based on regmap-irq framework.

Change-Id: I93ad71f41a8bf62313bee5b6c374809c93219f5c
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-07-31 03:44:52 -07:00
Vidyakumar Athota
9cbeb97832 codecs: add wcd9360 audio codec driver
Initial commit to add wcd9360 audio codec driver.

Change-Id: Ib4e5e41ce7e540e4426c9ca26db8e834edc3d4da
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2018-02-02 17:24:19 -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
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