Commit Graph

197 Commits

Author SHA1 Message Date
Vikram Panduranga
0bcd702216 soc: add fixes for 4-ch config
Add fixes for 4-ch config and other misc fixes.

Change-Id: I393ed7b9ea70cc8cd3d301984bee430135507905
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2020-09-17 16:46:34 -07:00
Vidyakumar Athota
584244b6ac Merge commit '5efb3a4ee3959f20ed2b697663205ec9a6bd1e5c' into audio-kernel-5-4.lnx.1.0
Change-Id: I58fbdf6b91c33ab5d147efbe5f5706616052c7fe
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2020-09-06 18:25:28 -07:00
qctecmdr
d9f2992429 Merge "soc: soundwire: support multi soundwire devices configuration" 2020-08-17 01:44:20 -07:00
qctecmdr
825b7bc047 Merge "soc: update wake interrupt check condition" 2020-08-17 01:44:19 -07:00
Sudheer Papothi
9654ef28aa soc: soundwire: support multi soundwire devices configuration
Update frame shape configuration to support multi soundwire devices
attaching to a single controller.

Change-Id: I7c59b1b09aa0c2417f888b382f8de943f7b62bbd
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-08-13 15:50:53 -07:00
Vignesh Kulothungan
7514e5c33e soc: update wake interrupt check condition
Call pm runtime functions from wakeup interrupt
only if soundwire master is not in SSR and if dev up is
true.

Change-Id: Ic394be964437bdc009f1b4c5dd6e46673875b0df
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-08-05 15:33:50 -07:00
Vatsal Bucha
d4b25f9f73 soc: swr-mstr: Fix random headset detection issue on scuba
When headset is inserted and reboot device sometimes
headset is not detected after reboot as host_irq from
swr slave gets masked. This is because of cmd error seen
after clearing all irq which results in fifo flush.
Read swrslave irq before clearing so as to resolve cmd error.
Also enable host irq after clearing enum interrupt at master.
This ensures irq is properly enabled.

Change-Id: Id66029c65c4d813391bfeb8c0c619560f298eeab
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-08-04 07:50:37 +05:30
Phani Kumar Uppalapati
726d5ea145 Merge commit '33ea77356f47c6c596c8505ca90307fc1245ef3f' into audio-kernel-5-4.lnx.1.0
Change-Id: Iacb389506a643a1ac70a3d51c2dfc1eeb47f690c
2020-07-30 19:48:24 +05:30
qctecmdr
18eded0d2f Merge "soc: swr-mstr: Avoid overflow during swr fifo read/write" 2020-07-28 22:40:06 -07:00
qctecmdr
8de2140998 Merge "soc: swr-mstr: Fix KW issue in swrm_remove" 2020-07-24 00:05:32 -07:00
qctecmdr
ae75f2e737 Merge "soc: swr-mstr: Resolve compilation error during overflow irq" 2020-07-24 00:05:32 -07:00
Vatsal Bucha
47b3116ec1 soc: swr-mstr: Avoid overflow during swr fifo read/write
Avoid swr fifo overflow by checking no. of outstanding
commands in fifo and comparing with fifo depth before
every read/write. If no. of commands is equal to fifo
depth then give some delay and retry. If no of outstanding
commands are still equal to fifo depth then flush fifo
and try writing/reading from fifo again.

Change-Id: Ifd986c7affb70a61f8a90e4960a2779273a7d4d2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-07-22 21:53:18 -07:00
Meng Wang
96262c74ed soc: swr: update interval high register
Update interval high register.

Change-Id: I7c56ba801545f14607796977a976e535cf9da6ca
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-07-14 08:52:40 -07:00
qctecmdr
ab4679a93f Merge "soc: soundwire: Enable audio core voting" 2020-07-14 06:11:20 -07:00
Sudheer Papothi
db0cc84eb7 soc: soundwire: Enable audio core voting
Audio core vote enables soundwire master and establishes
soundwire link without which soundwire master will not power up.
This change votes for audio core during soundwire runtime
resume and unvotes during soundwire runtime suspend.

Change-Id: I3ca283be42670a56102c4f08c0f207ae9dc4e5c3
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-07-07 15:16:47 -07:00
Vatsal Bucha
a20b914402 soc: swr-mstr: Add delay of 100us after last write during bulk write
There is no delay after last write during bulk write. Add 100us delay
so as to ensure that last write goes fine.

Change-Id: Ifc1585f30eec639ffd6b80dde2e0365f368349d7
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-06-30 23:11:50 -07:00
Vatsal Bucha
a1e36bc8bc soc: swr-mstr: Fix KW issue in swrm_remove
irq_set_irq_data is used as argument to irq_set_trigger_type
which can be NULL. Check if irq_set_irq_data is NULL before
access.

Change-Id: I4832d65da22327d184b8a0927e84ff0ca4d40fad
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-06-30 14:58:11 +05:30
qctecmdr
dd29f28450 Merge "soc: swr-mstr: Fix KW issue in swrm_remove" 2020-06-29 11:21:31 -07:00
qctecmdr
92b6ef250c Merge "soc: soundwire: Reduce soundwire runtime suspend delay" 2020-06-29 11:21:31 -07:00
Laxminath Kasam
3afce0de68 Soc: soundwire: Update hw_ctl on HCLK at bootup
For soundwire version 1.6, HCLK remove HW controlled
at bootup before soundwire frame generation status check.

Change-Id: Idc2420d086261766ea4e79f69320f12c4d6b2259
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-06-25 00:40:54 -07:00
Aditya Bavanari
42a8ba550a audio-kernel: Synchronize hw vote and unvote requests
HW vote and unvote is currently called from multiple
clients leading to synchronization issues
during SSR/PDR scenarios. Synchronize all the vote requests
by using digital codec resource manager.

Change-Id: I7e63f69ab5d761a3bb4c7ce70bbef2e8bfd76cfb
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
(cherry picked from commit 31aa875405)
2020-06-25 00:37:32 -07:00
Vignesh Kulothungan
148520fd4d soc: disable swr master probing
Change-Id: I9995f23470d287e2856f2001709f1725137ffff9
Signed-off-by: Taha Azzaoui <tazzaoui@codeaurora.org>
2020-06-25 00:33:34 -07:00
Vatsal Bucha
c9fc630a60 soc: swr-mstr: Resolve compilation error during overflow irq
Fifo status is not printed during overflow|underflow irq.
Print status in hex format to resolve compilation error.

Change-Id: Ia9ececc58ec58b00c1bbd7b097abce1393d155ab
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-06-23 15:52:30 +05:30
Laxminath Kasam
034cd15ba8 Revert "soc: mstr-ctrl: Retain Audio_HM voting until suspend"
This reverts commit d02c7efb35.
and commit 61f235e5bd to avoid AOP
related issues.

Change-Id: I0b8b44bc5cca6bef6bc18c228f08a9c585c79c1c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-06-22 09:40:14 +05:30
Sudheer Papothi
c7cc20abc0 soc: soundwire: Reduce soundwire runtime suspend delay
Reduce soundwire runtime suspend delay for soundwire
to enter into sleep early once the usecase ends.

Change-Id: Idbace0fbe9363f487165865eacf5b85d3be86477
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-06-18 18:41:37 -07:00
Vatsal Bucha
269c76b335 soc: swr-mstr: Fix KW issue in swrm_remove
Irq pointer is first freed and then used in
irq_set_trigger_type and set wakeup capable.
This may lead to Null pointer dereference if
irq is NULL. Free irq after using it.

Change-Id: I86339e9995922cc8111f12593eb781226bb07a2a
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-06-18 09:00:27 +05:30
Vatsal Bucha
f0c7f88868 soc: swr-mstr: Fix headset detection during sva clk switch
Headset insertion/removal is not detected sometime due to
fifo read failure due to swr underflow. This is because if
headset sva is enabled, during clk switch swr force stop
happens and if mbhc has already taken pm vote for 3sec
further mbhc reads/writes will fail. If swr is in clk switch
mode then call swrm runtime_resume during reads/writes
to resolve issue.

Change-Id: I0d65869bd1c645bbf7ded9c0265f8d7de0dc624b
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-06-15 07:06:13 -07:00
qctecmdr
a14bf0fa0a Merge "soc: soundwire: update soundwire debug logs" 2020-06-11 04:15:16 -07:00
qctecmdr
0f5df347f1 Merge "soc: mstr-ctrl: Retain Audio_HM voting until suspend" 2020-06-11 04:15:16 -07:00
Sudheer Papothi
4dc669fa7e soc: soundwire: update soundwire debug logs
Update soundwire debug logs to avoid confusion during soundwire
enumeration of slaves.

Change-Id: Ib265fb3bf777a1461a9041bb269cdcb5c9ac5e2b
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-06-09 06:13:12 +05:30
Laxminath Kasam
d02c7efb35 soc: mstr-ctrl: Retain Audio_HM voting until suspend
Restore change to retain audio_hm voting and
ensure AOP hang issue not seen by masking interrupt
wakeup of swr pinctrl pins.

Change-Id: I51bf36d6d6b0999abf10a4bc94cce900d1adf1d5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-06-08 16:24:54 +05:30
Laxminath Kasam
d941fe254b Soc: soundwire: Update hw_ctl on HCLK at bootup
For soundwire version 1.6, HCLK remove HW controlled
at bootup before soundwire frame generation status check.

Change-Id: Idc2420d086261766ea4e79f69320f12c4d6b2259
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-06-03 11:55:09 -07:00
qctecmdr
40132db5a5 Merge "soc: soundwire: Fix soundwire bus clock frequency" 2020-06-01 10:27:01 -07:00
Aditya Bavanari
31aa875405 audio-kernel: Synchronize hw vote and unvote requests
HW vote and unvote is currently called from multiple
clients leading to synchronization issues
during SSR/PDR scenarios. Synchronize all the vote requests
by using digital codec resource manager.

Change-Id: I7e63f69ab5d761a3bb4c7ce70bbef2e8bfd76cfb
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2020-05-18 09:04:25 -07:00
Vignesh Kulothungan
6142448043 soc: remove reslock usage during wakeup vote/unvote
Remove reslock usage from device wakeup vote and unvote functions.
Mutex lock 'reslock' is to used only within runtime resume
and suspend functions, to avoid race conditions between them.

Change-Id: I221b00db2e762a0803b898a62cd98db1fe3ae3fa
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-05-12 16:15:51 -07:00
Sudheer Papothi
aa730ef492 soc: soundwire: Fix soundwire bus clock frequency
Soundwire bus clock frequency should not exceed MCLK. Fix
the soundwire bus clock frequency to MCLK during clock scaling
for proper SSP calculation.

Change-Id: I347c8ee0f63f34428160a3408eaa0e999142bc78
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-05-11 09:31:22 -07:00
qctecmdr
54255588ac Merge "soc: swr-mstr-ctrl: Remove ssr_lock handling" 2020-05-05 23:55:57 -07:00
qctecmdr
476664c177 Merge "soc: swr: Mask bus clash interrupt" 2020-04-29 22:27:54 -07:00
Aditya Bavanari
56ac5b3ace soc: swr-mstr-ctrl: Remove ssr_lock handling
During SSR and headset detection/removal interrupt
concurrencies, ssr_lock can lead to serv reg ack timeout
issues. Remove this synchronization to avoid this issue.

Change-Id: I242a013a7e9d833db21d737cbdfea2d84bbd29fa
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
2020-04-29 03:34:28 -07:00
Aditya Bavanari
f1c3f00c05 soc: Vote or unvote core and audio hw based on count
In order to synchronize the core and audio hw votes
in SSR use cases, vote or unvote for these
based on clock count.

Change-Id: I0047e2cc689cc96b34992e5f6f59dae84d1d4e4b
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2020-04-29 03:32:56 -07:00
qctecmdr
5bdbc17139 Merge "soc: swr-mstr: Add delay between fifo writes to avoid overflow/underflow" 2020-04-26 23:42:50 -07:00
qctecmdr
ace3a85d2f Merge "soc: soundwire: Update sample interval configuration" 2020-04-26 23:42:49 -07:00
qctecmdr
427dd0d8ed Merge "soc: swr: enable PCM IN/OUT when using pcm interface" 2020-04-26 23:42:49 -07:00
qctecmdr
286b657ee7 Merge "codecs: Enable clock voting logs to debug AHB/NOC issues" 2020-04-26 23:42:48 -07:00
Vatsal Bucha
0dff22d63f soc: swr-mstr: Add node to disable clk switch for rx master
RX Master does not support div2 clk switching as div2_en bit
for rx master is floating. Do not do clk switch for rx master.

Change-Id: Iee1716fe892e792ffd17d0861a807e3711cee5d5
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-21 09:00:58 -07:00
Sudheer Papothi
b51f959486 soc: soundwire: Update sample interval configuration
Update MSB of sample interval in the frame shape
to avoid misconfiguration.

Change-Id: I05e99bc563f6cdc71c7caf424441c4caa44ec4c6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-04-21 04:58:29 +05:30
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
Aditya Bavanari
5c21faa75d soc: swr: Mask bus clash interrupt
Mask bus clash interrupts to avoid interrupt
storm issues.

Change-Id: Ie5634e65c759f0ebbd74cf104888dfbc49a289f6
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2020-04-16 23:46:10 -07:00
Vatsal Bucha
0b07cf669f soc: swr-mstr: Add delay between fifo writes to avoid overflow/underflow
Overflow/Underflow errors are observed sometimes while doing fifo write.
Add delay between writes to resolve error.

Change-Id: Id460e17753001a0dd52acd01a181d91132c36048
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-16 09:38:14 -07:00
Sudheer Papothi
fd25834b84 soc: soundwire: Check for clock source before clock switch
Check for soundwire clock source before clock switch to avoid
redundant clock switch for the same clock source.

Change-Id: I8a7a116cc956f427af677b413928dace5a39a23d
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-04-01 12:53:10 -07:00