Commit Graph

135 Commits

Author SHA1 Message Date
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
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
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
qctecmdr
28a89ca1bd Merge "wcd938x: add dummy widgets to codec inputs/output" 2020-06-16 20:17:02 -07:00
Sudheer Papothi
b3fa5a0dc5 asoc: codecs: retry for soundwire slave enumeration
Retry for soundwire slave enumeration during bootup before
EPROBE_DEFER to avoid soundcard enumeration failures.

Change-Id: I083ec76fc84a2b367f93a2dc166a1419a75ff8b4
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-06-11 21:40:46 +05:30
qctecmdr
c250412b5d Merge "ASoC: wcd938x: Add dapm ignore suspend for DAIs" 2020-06-11 04:15:16 -07:00
Vignesh Kulothungan
4a38ad6bdc wcd938x: add dummy widgets to codec inputs/output
With multicodec approach, codec widgets are added much earlier during sound
card registration than aux codec approach. The connections between bolero and wcd938x
are done via device tree at a later point. DAPM does power checkup for codec widgets
before the codec-codec path is connected. This results in wcd938x dapm inputs/output
to be considered as endpoints, which results in playback/record failure once after
bootup. Hence, add dummy output/input widgets to wcd938x dapm inputs/output which are not
codec endpoints.

Change-Id: I5ab4839e9b76adba24c9254ae56dc784b4448af7
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-06-09 19:03:26 -07:00
Laxminath Kasam
1e558673c6 asoc: wcd938x: Add WCD ADC Mode mask to control modes
To set correct swr clk rate in concurrency,
use WCD ADC modes as status mask bit to confirm
ADC paths active and control set clock rate.

Change-Id: Id3401d6ed59bd617e0751e7c704268346b36dac4
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-06-09 19:39:22 +05:30
Sudheer Papothi
211f4896ce ASoC: wcd938x: Add dapm ignore suspend for DAIs
Add dapm ignore suspend for playback and capture DAIs to
avoid wakeup during power collapse.

Change-Id: If023597542423253a565dcf0f13ee9f08b357b93
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-06-05 10:29:32 +05:30
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
1164aa6f4a Merge "asoc: wcd938x: adjust swr sequence for wcd mic recording" 2020-05-10 05:35:13 -07:00
qctecmdr
51075bb60c Merge "asoc: codecs: Add delay to eliminate playback pause post SSR on hs" 2020-05-10 05:35:13 -07:00
qctecmdr
bbe7295d17 Merge "asoc: update tx frame config for soundwire port" 2020-05-05 23:55:57 -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
Prasad Kumpatla
bd2c17661b asoc: codecs: Add delay to eliminate playback pause post SSR on hs
Add delay in post ssr to eliminate playback pause on euro headset.On
post ssr hs detected as hp due to where pa become on before the completion
of wcd_correct_swch_plug workqueue which lead to detect plug_type
as hp.

Change-Id: Ie114fcd0458d9f5edebeee087c90600c3b0c3da2
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
2020-04-29 23:26:14 -07:00
qctecmdr
8ff0eb72f9 Merge "ASoC: wcd938x: Do not enable hold_off while enabling watchdog" 2020-04-29 22:27:54 -07:00
Kunlei Zhang
3acbdc5f2c asoc: update tx frame config for soundwire port
Set correct tx frame config for soundwire port
using  wcd9375.

Change-Id: Icbefda65713338908e4d94935296ff30ac4e5f9c
Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
2020-04-27 21:18:23 -07:00
qctecmdr
e63542d6b7 Merge "asoc: codecs: Set EAR compander if mixer ctl set" 2020-04-26 23:42:50 -07:00
Vatsal Bucha
b00df5a5c7 ASoC: wcd938x: Do not enable hold_off while enabling watchdog
Hold_off bit for enabling watchdog will enable mute until
there is a block reset and watchdog bits aren't toggled.
Disable hold_off bit so that wcd is recovered from mute
instantly once watchdog occurred.

Change-Id: Ia87593ead05dde4e31a0afefd6ffaca89bb95448
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-21 00:17:11 -07:00
Meng Wang
5ec99c4a5b asoc: wcd938x: adjust swr sequence for wcd mic recording
SND_SOC_DAPM_MIXER_E widget is powered up before SND_SOC_DAPM_ADC_E
which causes mute on wcd mic recording. Adjust wcd938x_tx_connect_port
and swr_slvdev_datapath_control sequence to fix it.

Change-Id: I3dbfb239dcfbd65102d0d98be40326be71cf8479
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-04-20 14:30:04 -07:00
Vatsal Bucha
fb63ca16cc ASoC: wcd938x: Enable digital clk for tx0 if micbias enabled
Mute is observed in amic record sometimes in concurrency with
sva. This is because if record is over tx0 then digital clk
is not enabled. Enable clk after enabling micbias to resolve mute.

Change-Id: Iba3aa4fade0ac5889218eaee2c5d2c4bd4431d50
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-19 08:25:30 -07:00
Laxminath Kasam
2e025248a2 asoc: codecs: Set EAR compander if mixer ctl set
Enable compander based on mixer ctl set for ear path.

Change-Id: Ie6287469f1baa9dba239d369bd5a29ed8e44522f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-04-19 08:11:52 -07:00
Vatsal Bucha
93f005b878 ASoC: wcd938x: Enable surge protection at bootup
Enable surge protection at bootup for traverso.

Change-Id: I443c576e6fdfc640b8e67c2d3f9622e8c3366d45
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-16 01:15:21 -07:00
qctecmdr
595a926d4f Merge "ASoC: wcd938x: Update hardware sequence for LDOL voltage" 2020-04-08 21:02:08 -07:00
Sudheer Papothi
49f16768f6 ASoC: wcd938x: Update hardware sequence for LDOL voltage
Update wcd938x codec hardware sequence for LDOL voltage.

Change-Id: I863c0832277d3d0533cdd97f15d1576c47cc4d1e
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-04-02 23:50:57 -07:00
Vatsal Bucha
71e95c67ea ASoC: wcd938x: Fix headset detection during SSR/PDR
Headset is corrected as lineout during SSR/PDR. This is
because adc voltage is not measured correctly due to SSR state.
Enable flag deinit_in_progress during SSR down to check if
device is not reported and disable it after device up.

Change-Id: I6fc4fff4149c36ba16aa668a960505504a5d811f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-01 09:54:12 -07:00
Vatsal Bucha
d789e57132 ASoC: wcd938x: Disable ear path at power down
Ear Path is not disabled properly disabled at power down.
Disable clk and other registers depending on whether ear
takes aux or hph path at pwd.

Change-Id: I987904ddd9bf21b9ed96e754e6eb2514b4d277ce
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-03-30 15:05:51 -07:00