Commit Graph

65 Commits

Author SHA1 Message Date
Aditya Bavanari
236ff485d2 codecs: Enable clock voting logs to debug AHB/NOC issues
Enable clock voting logs to debug stability issues.

Change-Id: Ie1f995ab004778a81ea42baad15ea36858407e9a
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2020-04-20 10:17:02 -07:00
Sudheer Papothi
93bc6299f3 ASoC: bolero: check clock source before clock switch
Check soundwire clock source before clock switch to avoid
redundant soundwire device suspend for the same clock source.

Change-Id: I613789b23c171959a60c9a059a30b3f1494f3dfa
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-04-01 11:49:25 -07:00
Sudheer Papothi
04d31da985 ASoC: bolero: Use TX MCLK for non-island mode usecase
Use TX MCLK for non-island mode usecase.

Change-Id: Iff8f8efd3e83b09e5323abe19aabddb8c4de1964
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-03-30 05:24:58 -07:00
qctecmdr
b8e5bd2fc8 Merge "ASoC: msm: update QUAT/QUIN TDM slot mappings for A2B" 2020-03-30 01:20:37 -07:00
Sudheer Papothi
0e19126c1f ASoC: bolero: Add concurrency support on audio capture path
During voice activation and audio capture concurrency usecase,
there is no common reference count for DMIC clock enablement,
results into mute when one usecase tears down. Change enables
a common reference count in bolero codec driver between voice
activation usecase and audio capture usecase to avoid mute
during VA and audio capture concurrency.

Change-Id: I424c941178d7e9ff91288a50ba27605b2b9d3abe
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
2020-03-26 18:45:23 -07:00
qctecmdr
53e8920027 Merge "asoc: codecs: Add system sleep ops for macro drivers" 2020-03-25 09:38:23 -07:00
Laxminath Kasam
6ac07f666d asoc: bolero: Avoid reg access if audio hw vote fails
Check audio hw vote before register access.

Change-Id: I2753f6abd912910285f586bf95c71e3c99dfe60a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-03-24 00:41:45 -07:00
Aditya Bavanari
e2f52ea5c0 asoc: codecs: Add system sleep ops for macro drivers
Add system sleep ops and invoke force runtime suspend for all
the macro drivers in bolero in order to synchronize
system suspend and runtime suspend callbacks.
Use freezable delayed work queues instead of normal
delayed workqueues in order to avoid contention with
pm suspend callflow.

Change-Id: Ibb0d35ad80c09e7f2a7032b4daef53c359056dfd
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2020-03-23 20:44:38 -07:00
Sudheer Papothi
265ff04ddc ASoC: bolero: Add support for bolero v2.0 hardware
Add support for bolero v2.0 hardware functionality.

Change-Id: I5dca1666b92d6e8de0adae8a11cab0fbca61ab6d
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-01-29 11:54:30 -08:00
Meng Wang
4a03bd5171 asoc: update snd info api
Update snd info API and userspace and get codec info.

Change-Id: Ic9cfc89365cf6263a9b1c02403d68e7740bebbeb
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-12-27 11:15:55 -08:00
qctecmdr
edc7d1364c Merge "asoc: codecs: register notifier for all bolero codec variants" 2019-11-20 07:07:21 -08:00
qctecmdr
c0692e7848 Merge "asoc: codecs: bolero: Do not process ssr disable if already down" 2019-11-20 06:48:53 -08:00
qctecmdr
344bca82e3 Merge "asoc: bolero: Add va/tx macro registers for bolero 2.1" 2019-11-14 20:10:27 -08:00
Laxminath Kasam
fbd95edd79 asoc: bolero: Add va/tx macro registers for bolero 2.1
Update VA/TX macro registers for bolero 2.1

Change-Id: I6be9632407c85a36bc746c65b34a52812548ad2a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-11-12 12:32:37 +05:30
Surendar Karka
c9431f1111 asoc: codecs: register notifier for all bolero codec variants
Playback on speaker is getting mute due to notifier not getting
registered. Register notifier for all  bolero codecs
variants to enable WSA PA.

Change-Id: Id13a533af7096f50de2e1a654393c579a81af953
Signed-off-by: Surendar Karka <skarka@codeaurora.org>
2019-11-06 12:55:12 +05:30
Karthikeyan Mani
91850713f5 asoc: codecs: bolero: Do not process ssr disable if already down
If codec receives ssr disable notification when
already in disabled state do not have to process it.
This makes sure codec register access are not done when
not necessary.

Change-Id: Iafc2b03d7c707c46c69ca995d36119929c34c222
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-11-04 15:32:39 -08:00
Laxminath Kasam
1a58793f4a asoc: codecs: CSR access requires AHB clock from bolero 1.1
From bolero 1.1, Bolero and SWR CSR moving to AHB clock
and no need to enable other macro RCG clocks.

Change-Id: I6663196a88dbf07868d6426bdda98f33e42004d1
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-11-01 13:02:12 +05:30
qctecmdr
16ded023c7 Merge "asoc: bolero: Update version query for bolero 2.1" 2019-10-30 10:33:11 -07:00
qctecmdr
80870fbc90 Merge "ASoC: Fix audio distortion issue during headset record" 2019-10-25 05:37:28 -07:00
Laxminath Kasam
f1623021b1 asoc: bolero: Update version query for bolero 2.1
Expose API from bolero driver to retrieve version
info by macro drivers. Update bolero driver to
get version from dtsi.

Change-Id: Idc3735721de90ee4f74319537b17a530d3c125a6
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-10-22 15:20:01 +05:30
qctecmdr
1543085859 Merge "asoc: codecs: Vote for codec core and NPL clocks before regcache_sync" 2019-10-18 08:29:51 -07:00
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
qctecmdr
f4ad6ff187 Merge "asoc: codecs: bolero: audio HM voting only supported on bengal" 2019-10-15 00:47:21 -07:00
Aditya Bavanari
cfc65e8257 asoc: codecs: Vote for codec core and NPL clocks before regcache_sync
Vote for codec core and NPL clocks before regcache_sync
to avoid unclocked access of bolero registers.
Unvote once the regcache sync is done.

Change-Id: Iae45f487113c55318f33cd1950e2d6b64bcd945a
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-10-11 20:11:10 +05:30
Aditya Bavanari
d577af909c asoc: codecs: Check for core votes count before accessing registers
Check for core votes count before accessing swrm registers
to avoid NOC errors.

Change-Id: I5689d6a6db0886ed4cc791738a28290f3d953412
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-10-10 20:29:49 +05:30
Laxminath Kasam
069df14aa0 asoc: codecs: Fix pop issue on WSA cold start
Observe pop if FS clock is turned on at end of
powerup sequence. Ensure WSA PA is turned on
after FS clock to avoid pop.

Change-Id: Ic1214d361e77db252b7a90a89fc99c69f51e270b
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-09-19 11:37:00 +05:30
Laxminath Kasam
6b01d100ee asoc: codecs: bolero: audio HM voting only supported on bengal
On bengal target, audio HM voting is only applicable.
Update bolero driver to make audio HM vote if audio core handle
is not present.

Change-Id: I9abaf42c04aa8f1b89d9c08e628ab142ce99151a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-08-27 15:14:25 +05:30
Sudheer Papothi
06a4c648f0 ASoC: Add support for event listener from the codec
During low power island mode, register to event listener
to process soundwire inband interrupts from the soundwire
master driver.

Change-Id: Ib15f5ec59ea19010dbb8f9744de76bfc2ca7eebb
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-08-08 05:22:11 +05:30
qctecmdr
aae17991cb Merge "ASoC: bolero: tx-macro: Fix clock sequence for headset SVA" 2019-07-29 02:39:50 -07:00
Sudheer Papothi
6cc7f52a6d ASoC: bolero: tx-macro: Fix clock sequence for headset SVA
Fix soundwire clock sequence for headset SVA usecase to avoid
tx clock voting during low power SVA usecase.

Change-Id: I9613eee6a0b66560fa1108b4887af71507d345e7
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-07-25 00:00:18 +05:30
Karthikeyan Mani
ac555db98e asoc: codecs: bolero: Keep track of lpass core votes
Unvote lpass audio and hw votes from bolero suspend
only if the voting was done from the corresponding
resume function.

Change-Id: I299b8e5639efe2883980abc5d0904733fbdc5a77
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-07-15 18:01:19 -07:00
Karthikeyan Mani
c14c27a7c6 asoc: codecs: bolero: add compander soft reset event
Add compander soft reset event that can be requested
from a slave codec to reset at power down to reduce
click and pop noise.

Change-Id: I2f6ff182e258e02979166b0e76b6a1d439b1cf87
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-06-21 14:14:47 -07:00
qctecmdr
1dffa77438 Merge "asoc: bolero: reset all clks after SSR/PDR" 2019-06-17 21:04:15 -07:00
qctecmdr
7ce7820fac Merge "asoc: bolero: restore all codec registers after SSR" 2019-06-10 06:08:09 -07:00
Meng Wang
8ef0cc2ed4 asoc: bolero: reset all clks after SSR/PDR
After SSR/PDR, the lpass clocks will be in off state. Force restart
clocks after SSR/PDR, if enabled before SSR/PDR, to reenable the clocks.

Change-Id: I3d850d92bdc6324aa7a64a83a9066f388a85c7f7
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-06-06 08:45:19 +08:00
Sudheer Papothi
ba445bfe2d ASoC: codecs: Add support for LPASS Audio HW vote
Add support for LPASS Audio HW vote needed for low power AMIC
VA usecase.

Change-Id: If6642d418dbf2cc9773fbd0ec0fe35c30afac140
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-05-31 10:37:27 +05:30
Meng Wang
930d9751a1 asoc: bolero: restore all codec registers after SSR
Some bolero codec registers are not correctly restored after
SSR and causes DMICs on bolero don't work. Add this change to
restore all bolero codec registers after SSR.

Change-Id: I3666a77f802f62452a0e0de4859f48a0f9e5cbb1
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-05-30 17:17:00 +08:00
qctecmdr
34b7d3b2fd Merge "ASoC: hide bind/unbind in sysfs" 2019-05-21 20:33:23 -07:00
Xiaojun Sang
53cd13a1ab ASoC: hide bind/unbind in sysfs
Exposure of driver bind/unbind to userspace via sysfs may
lead to unexpected behavior.
Hide bind and unbind by driver attribute.

Change-Id: I20d6ee653bcc16af15d6368664aaf240c6645cd0
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-05-17 15:00:33 +08:00
Karthikeyan Mani
70df516a60 asoc: codecs: bolero: Add adc1 condition to tx hold callback
TX hold callback returns without making a callback
to external codec if the ADC with number one is called.
Add the condition for the missing ADC to make the callback
for ADC1.

Change-Id: Iec480b40cfbe199fbe06151abd99d9ad6aaf9c9d
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-14 17:48:56 -07:00
Aditya Bavanari
f4a471de1a asoc: codecs: Bail out from clock enable routine during SSR
When SSR happens, use dev_up flag in codec
to bail out from clock enablement routine.
During interrupt processing if clock enable fails during
SSR, exit isr routine without disabling clock.

Change-Id: Ie2b56521daa70790d6ef53a06c7becc2ee8010a4
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-04-26 14:13:26 +08:00
Vidyakumar Athota
5d45f4c865 asoc: codecs: bolero: add clk resource manager driver
Add Bolero clock resource manager driver to handle/manage
bolero clocks for all the concurrency usecases like record
+ voice activation.

Change-Id: I970a05d96fc9060b44bfe670d465f0b9d72cc53b
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2019-04-05 08:00:03 -07:00
Meng Wang
e59703ce4e asoc: bolero: remove mutex_lock in bolero_runtime_suspend
There can be deadlock between __bolero_reg_read/write and
bolero_runtime_suspend. Remove the mutex_lock in
bolero_runtime_suspend to avoid deadlock.

Change-Id: I712b9f24adeddda8899b39f90291394965443163
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-04-01 17:49:59 -07:00
Mangesh Kunchamwar
cdd68dbe72 msm: vote for LPASS core while access LPASS registers
When ADSP is in power collapse or island state, it would fail
to access LPASS codec register.Vote for LPASS core to avoid
LPASS power collapse with pmruntime approach while accessing
LPASS registers & TLMM.

Change-Id: I74d037e499fb6f1245b9a1bd1b0a77200608c27b
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
2019-03-06 08:50:31 +08:00
Sudheer Papothi
f2afc390ce ASoC: bolero: Check for valid handle before pm_runtime_resume
Check for valid handle before pm_runtime_resume in bolero register
read/write functions to avoid dereference.

Change-Id: I34d567e7575202817f4fcda784d0f3df2ed77bde
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-03-01 08:09:50 +05:30
Linux Build Service Account
2591646070 Merge "ASoC: bolero: Enable clock Fs generation in bolero codec" 2019-02-17 00:21:49 -08:00
Karthikeyan Mani
634fa7593f asoc: codecs: bolero: add split codec check
Add a check to see if split codec is present for
the slaves being probed and add platform data to
such slaves.

Change-Id: I8b143c551a481b88dffc8763421d2aaa02c0012d
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-02-07 14:58:53 -08:00
Sudheer Papothi
ff649f9d73 ASoC: bolero: Enable clock Fs generation in bolero codec
Clock Fs generation registers are in always on domain but
is needed for all the playback and capture usecases. Enable
clock Fs generation in the boloero codec after the clock
enablement.

Change-Id: I3a9cf14660f871b26ec96ef8b3e245ba5dadeb78
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-02-05 23:56:32 +05:30
Ramprasad Katkam
cbb6f02c95 asoc: bolero: set bolero dev_up flag before macro notification
When UP notification is sent to macros, the macros can try
to do regcache sync for their regions. Set dev_up flag in bolero
before sending UP event to macros to enable register access.

Change-Id: Ic04cfef121e9be55e91bf8927da26f9ec249338e
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-01-22 12:49:48 +08:00
Sudheer Papothi
a3e969d6f0 ASoC: bolero: Add support to retrieve soundwire port configuration
Add support to get the platform specific soundwire port configuration
for soundwire master ports.

Change-Id: Ie1d32a77d534f6c3f397936b85c025b14d01f321
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-12-17 14:30:55 -08:00