Commit Graph

189 Commits

Author SHA1 Message Date
qctecmdr
8a3a2be86e Merge "asoc: wcd: add NULL pointer check for wcd component" 2022-11-22 07:28:44 -08:00
Meng Wang
bae0770e2b asoc: wcd938x: add more ADC volume support
ADC volume can support upto 27 different gain.
Current driver only supports 20. Make this change
to add more ADC volume support.

Change-Id: Ia315e15465affd5430d36637efb0cf3a12bb7b7e
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-11-02 02:54:26 -07:00
Yuhui Zhao
c9ec60ea62 asoc: wcd: add NULL pointer check for wcd component
add NULL pointer check for wcd component.

Change-Id: Icfba04b689ace34f8f82b3ee58dd79ce139861b5
Signed-off-by: Yuhui Zhao <quic_yuhuzhao@quicinc.com>
2022-10-27 22:25:04 -07:00
Yuhui Zhao
19b039aa73 asoc: add config files to support pineapple target
add pineapple config file to all drivers:
Kbuild, including soc/dsp/ipc

Change-Id: I2357c7c96739bd42cb8764753d2a4fd5dd1c9634
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-10-07 11:24:42 +05:30
Yuhui Zhao
1dacaf014f audio-kernel: Compilation fixes with "Break" and "fallthrough"
Compilation fixes with "Break" and "fallthrough".

Change-Id: Ica05d0410efc5e9dc52addcf4cd8c0253f49fada
2022-10-06 22:40:29 -07:00
qctecmdr
de434a4c92 Merge "Revert "asoc: mbhc: disable pa while measuring the adc values"" 2022-09-22 01:14:10 -07:00
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
Ganapathiraju Sarath Varma
838364dbb4 asoc: codec: Update the readable swr slave registers.
Update the readable swr slave registers while taking the regdumps.

Change-Id: Id38efceb49b6a223f51c24c6d88865b2116b3d29
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2022-09-14 00:32:30 -07:00
qctecmdr
3211af5e43 Merge "asoc: codec: add sufficient delay to enumerate wcd tx slave" 2022-09-13 02:03:24 -07:00
Prasad Kumpatla
683015da66 asoc: wcd938x: add flags to update the digital clk b/w HPHL and EAR
add flags to avoid race conditions in on/off for digital clock ctl HPHL and EAR path.

Change-Id: I4b4fee2e90d8e1024176fdf5b36f89d219431300
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-09-09 03:30:00 -07:00
Prasad Kumpatla
0da1f0114e asoc: codec: add sufficient delay to enumerate wcd tx slave
add sufficient delay to enumerate wcd tx slave at the time of
SSR/PDR.

Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-09-08 10:52:55 -07:00
qctecmdr
6c35de32f9 Merge "asoc: mbhc: disable pa while measuring the adc values" 2022-08-04 09:00:21 -07:00
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
Phani Kumar Uppalapati
52ca984e68 asoc: use BIAS_LEVEL_OFF for LPM trigger
Use BIAS_LEVEL_OFF trigger from ASoC to mark the wcd/wsa power
supplies to LPM (if supported).

Change-Id: I9afdd255ecb385176de82813ed9a638adfdf0292
Signed-off-by: Uppalapati, Phani Kumar <quic_phaniu@quicinc.com>
2022-07-15 15:50:14 -07:00
Prasad Kumpatla
ed84f5abe1 asoc: wcd938x: add ear pa gain kcontrol for wcd9385
add ear pa gain kcontrol for wcd9385.

Change-Id: I3ead7a76598d6cdee6223807c1720b6c66edbf71
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-06-14 11:22:01 -07:00
Shazmaan Ali
a20e11e0c3 asoc: codecs: Replace dev_err/info with ratelimit prints
replace all dev(pr)_err/info logs
that could potentially flood kernel logs with
ratelimit functions dev_err_ratelimited and
dev_info_ratelimited

Change-Id: I32dc6002dead1a07622978c4de63d541c01982fd
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-04-13 12:43:20 -07:00
Matthew Rice
a0a83d7e42 asoc: Update SWR Port Types for Kalama chipset
Add PBR, CPS port types and port parameters for WSA
Update RX and TX port types to include full list of ports

Change-Id: I5b69ee777addebcf4167dccd4ce4ab0af31b754d
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2021-12-09 08:54:57 -08:00
Meng Wang
0bd4c39e4e asoc: codec: enable use_single_read for wsa and wcd regmap
When interrupts are triggered on the second or third interrupt
status register, current logic cannot clear that interrupt status
after handling it. Enable use_single_read for wsa and wcd regmap
to resolve the issue.

Change-Id: Ieac57e169505d4455dde1dcd0e80e222e3e8eb1e
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2021-12-07 09:15:42 -08:00
Meng Wang
f48ad4780a asoc: wcd938x: update logic to close BCS correctly
For SVA usecase, BCS is not needed. For other usecase,
BCS is enabled. When voicecall and SVA are running
concurrently and do device switch between headset-mic
and handset-mic, BCS SWR port may not get closed when
teardown headset-mic. When closing ADC2, check BCS_STATUS_MASK
only and remove check for bcs_disabled flag to make sure
BCS SWR port is closed.

Change-Id: I01b1cadc0143a4f46eb6a04c3fc8a2509aa13ec3
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2021-11-24 03:47:53 -08:00
Junkai Cai
bd4a663a65 asoc: add config files to support kalama
add kalama config file to all drivers' Kbuild, including soc/dsp/ipc

Change-Id: I56a6092da515f211a56617f0cff60079dbf0aa39
Signed-off-by: Junkai Cai <junkai@quicinc.com>
2021-10-27 14:37:34 -07:00
sarath varma ganapathiraju
2db2fd8857 asoc: codec: wcd938x: Get swr device number
add wcd938x_codec_get_dev_num to return
swr device number

Change-Id: I45f4324645643b4edc6182cee508ce1e647c3612
signed-off-by: sarath varma ganapahiraju <ganavarm@codeaurora.org>
2021-09-15 22:19:33 -07:00
Meng Wang
06e614b09f asoc: move some kernel headers to vendor SI
Move some audio kernel headers to vendor SI.

Change-Id: I41df0cdb2789359e1fded84ec0bf6c30eaa4a25f
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-03-24 14:10:02 +08:00
Junkai Cai
fbfd93a2dc asoc: lpass-cdc: allow register write via debugfs
allow QTI regmap debugfs register writes for debugging purpose
on lpass-cdc, wsa and wcd codecs.

Change-Id: Icdedb8f0a5e198bbb6afecb4b6995cc0d1a35833
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-03-20 21:29:06 -07:00
Vatsal Bucha
77ac79f6c7 asoc: codec: add range check to avoid overflow
Add range check for ucontrol value to avoid array
overflow.

Change-Id: I7b699519bec6f605e5ca5ece8f67badbefc7a094
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-03-15 21:53:06 -07:00
Laxminath Kasam
7962130af8 audio-kernel: Fix compile error on wcd
Fix compile error on wcd codec.

Change-Id: I65a3db216234ab798f8a85dd2401ac605b09f7f0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-22 13:21:44 +05:30
Linux Build Service Account
8522efef7a Merge "audio-kernel: Enable out of tree compilaton" into audio-kernel.lnx.5.10 2020-12-20 23:03:21 -08:00
Laxminath Kasam
6a7bb13614 soc: swr-mstr-ctrl: Update SWR_TX to receive port params from slave
Update swr_tx slave port config to use slave provided port params
and remove slave port static tables.

Change-Id: Icfedf1229a88432e80c2294e13f2ccc3949417c5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-18 14:40:06 +05:30
Jyotirmoi Sarma
6b78aacd7f audio-kernel: Enable out of tree compilaton
Add Makefile in each sub-folder
Add Android.mk file on top level folder of audio-kernel

Change-Id: I024aa5080ae52b55700f0a65ab05034be8c9cdad
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-17 18:05:48 +05:30
Vatsal Bucha
1469dc6bf6 ASoC: wcd938x: Enable micbias in pull up mode for VA AMIC
VA AMIC requires micbias to be enabled in pullup
mode. Pullup mode for micbias is required for SVA usecase.

Change-Id: Ied71147bc813cee2ad95b0c8b342788b9c0ba10b
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-12-16 21:07:13 -08:00
Jyotirmoi Sarma
a3d8911945 audio-kernel: asoc : Upgrade asoc to support 5.10 kernel
Change-Id: Ia54112cfbde418d66b9314d4ba731928aa057558
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-08 08:49:44 -08:00
Phani Kumar Uppalapati
b15db3b6c8 Merge commit 'd9fa9d435ba1b92cf0f0361a0749107b7abc45a5' into audio-kernel-5-4.lnx.1.0
Change-Id: Iaf98532030ee4ef5fe6a70df083a685733dd5670
2020-11-05 19:15:07 -08:00
Linux Build Service Account
8c6f982167 Merge "asoc : Fix for 384k clips on headphones" into audio-kernel-5-4.lnx.1.0 2020-10-29 15:40:22 -07:00
Aditya Mohan
8301940a18 asoc : Fix for 384k clips on headphones
hw_refine failing for clips of sample rate
384000 as codec is configured to support 192000
sample rate as max. Due to this playback is not
happpening over headphones.

Change the max to 384000.

Change-Id: I2f9cad3bc708f3e4cc8cd38eb2ef2a98ec640f57
2020-10-15 10:40:08 +05:30
qctecmdr
ddba57b58c Merge "asoc: wcd938x: move 500ms after dev_up sets to true" 2020-10-07 01:58:57 -07:00
Meng Wang
62cbd21506 asoc: wcd938x: move 500ms after dev_up sets to true
Trigger SSR during headset recording may cause recording
mute after SSR. Before dev_up is set to true, micbias
enablement for headset detection will return error and micbias
enabled for recording return true. After headset is done,
micbias is disabled. Move 500ms after dev_up to the end to
resolve this issue.

Change-Id: I7b9e094321997d64c96cf0e86a4f447d97b5fdb6
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-10-02 10:29:11 -07:00
Vignesh Kulothungan
dbbb97ce5e ASoC: codecs: add null check before use
Add null check for wcd938x component and wcd938x_priv
before use.
Add array bounds check for slave channel index before
accessing the array.

Change-Id: Ida6b2044f5f9b9a65f4b45d868040af8bd2116eb
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-09-30 11:54:35 -07:00
qctecmdr
69fffecae6 Merge "ASoC: wcd938x: clear digital CDC analog CLK bit 0x08" 2020-09-27 03:10:55 -07:00
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
Xiaoyu Ye
0cdc710d1d ASoC: wcd938x: clear digital CDC analog CLK bit 0x08
Update the bit 0x08 of WCD938X_DIGITAL_CDC_ANA_CLK_CTL
to 0 during DAPM post PMD.

Change-Id: Iea7d3878e9c56f8e219240007b8dbe30683d3161
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2020-09-16 22:12:13 -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
Sudheer Papothi
e2abf6fc7a ASoC: wcd938x: Update the soundwire clock rate based on the tx paths
Update the soundwire clock rate based on the number of TX paths enable
to avoid noise issue.

Change-Id: I8c73bfd73751d4b79de30f3347081929501a877e
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-08-13 12:06:52 +05:30
Laxminath Kasam
214f88cc12 asoc: wcd938x: Update SWR clock rate based on modes
Update SWR clock rate based on active ADC modes
for concurrency during powerup and teardown.

Change-Id: I610aa205a857a5fac2163a248de4800f3c8042f7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-08-11 08:54:31 +08:00
Meng Wang
94bb2f8fb6 asoc: wcd938x: reverse datapath_control and connect_port for teardown
swr_slvdev_datapath_control should be called after
wcd938x_tx_connect_port to cleanup disconnected ports.

Change-Id: I53e6e9140ed0be5a0a0704358e3e7f600ab62863
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-07-28 09:36:55 +08:00
qctecmdr
52c21204de Merge "ASoC: wcd938x: Reduce glitch during headset record" 2020-07-10 01:59:34 -07:00
Vignesh Kulothungan
b50df74ac4 ASoC: update swr dmic device down mechanism
Add notification from wcd938x to sound wire dmics
during SSR. Remove device down from dev ops to avoid
deadlock scenarios.

Change-Id: Ifdcbebb748c10deb89ad51ada1a8ce1cf33f2462
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-07-07 15:11:51 -07:00
qctecmdr
5a6876340c Merge "ASoC: codecs: handle device disconnect during SSR" 2020-06-29 11:21:31 -07:00
qctecmdr
dc40c1136d Merge "asoc: wcd938x: Add WCD ADC Mode mask to control modes" 2020-06-19 23:23:56 -07:00
Vatsal Bucha
a1f8374cf5 ASoC: wcd938x: Reduce glitch during headset record
Enable ADC Mode and tx channel cfg as part of enable_adc.
This should be enabled before enabling bolero dec so as
to reduce glitch or saturation for headset.

Change-Id: I94045d0c3b7b96744afb9e6a9a3eecf0abc5a55f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-06-19 08:56:07 +05:30
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
6b6cf2666c Merge "asoc: codecs: retry for soundwire slave enumeration" 2020-06-16 20:17:02 -07:00