Commit Graph

225 Commits

Author SHA1 Message Date
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
Meng Wang
b72b79a6b0 soc: swr: enable PCM IN/OUT when using pcm interface
Enable PCM IN/OUT when using pcm interface.

Change-Id: Iff7b234a6d188802619cff112fa9bb54804ac77d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-04-01 14:47:27 +08:00
qctecmdr
2d2ae53b05 Merge "soc: swr-mstr: Fix headset not detetcted issue on devnum 0 detached" 2020-03-25 09:38:23 -07:00
Vatsal Bucha
7da41c372b soc: swr-mstr: Fix headset not detetcted issue on devnum 0 detached
Headset is not detected if devnum 0 gets detached at bootup.
This is because on detach being called hw will mask interrupt
at slave side but will not unmask it afterwards.
Also device 0 is used only for discovery purpose and
interrupt shouldnt be masked if it detaches.

Change-Id: I78d47243ef67ea5ee1fe3badaec94e596bc8faf3
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-03-24 00:39:07 -07:00
Sudheer Papothi
f3bc7e9e85 soc: soundwire: Update frame configuration for multi slave
Update offset1 of soundwire slave devices in a multi mic usecase
for proper audio capture from the soundwire mics.

Change-Id: If81ab1c2defeacb87b917fb6e3645c6df866f679
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-03-24 05:03:47 +05:30
Vignesh Kulothungan
a4962dc546 soundwire: add support to disable dynamic port map
Add support to disable dynamic port map via device tree
property.
Do not update master clock when dynamic port map
is disabled for a sound wire master.

Change-Id: I9f9344866faa4d1c342787e014102d9182ed56ae
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-03-17 11:18:18 -07:00
qctecmdr
732d4331bc Merge "soc: soundwire: Update bus clock frequency based on usecase" 2020-02-20 22:11:07 -08:00
qctecmdr
ecae50be17 Merge "soc: swr-mstr: reset slave pending irq flag before every call" 2020-02-17 02:58:02 -08:00
qctecmdr
5f0784fece Merge "soc: swr-ctrl: increase num retry count for soundwire link status" 2020-02-17 02:58:02 -08:00
Sudheer Papothi
cdeb593d01 soc: soundwire: Update bus clock frequency based on usecase
Some usecases need soundwire bus clock frequency to run at
lower clock rate for better power and performance. Update
soundwire bus clock frequency based on usecase.

Change-Id: I2e786d9f5d5d2ec3841daa934802eeafa79a8f6c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-02-15 00:32:43 +05:30
Sudheer Papothi
1c11c5cf73 soc: soundwire: Disable clock gating when soundwire is out of clock stop
Disable clock gating when soundwire is out of clock stop mode.

Change-Id: I97187fa2deed26fb3270abee1d05f679ace2c0c4
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-02-06 23:49:10 -08:00
Meng Wang
935e7fb95e soc: swr-mstr: reset slave pending irq flag before every call
Before every slave interrupt handler call, reset slave pending
irq flag, so that if irq is halted it does not retain the old
value.

Change-Id: I2c78500e83eca7864029f58cffa80f8648902fb2
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-02-04 18:36:14 -08:00
Laxminath Kasam
33b343b23d soc: swr-ctrl: increase num retry count for soundwire link status
Increase retry count to check soundwire link status at bootup
inorder for probe to succeed. Handle error scenario if 
soundwire probe fails to cleanup device properly.

Change-Id: I4a545530e68221a1f428e05aff3d8a93b1dacf84
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-02-04 18:35:11 -08:00
Sudheer Papothi
669089fdbd soc: soundwire: Handle soundwire slave reset gracefully
If soundwire slave does not implement reset functionality, handle
soundwire slave reset error gracefully in soundwire master driver.

Change-Id: I24f34d3e8665c187c4ac9dd2bc8acb2b39ad2df6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-01-29 23:06:40 -08:00
Vignesh Kulothungan
61b2ca830f soc: swr: update SWRM_MCP_FRAME_CTRL_BANK_ADDR
Update SWRM_MCP_FRAME_CTRL_BANK_ADDR to SWRM_MCP_FRAME_CTRL_BANK.

Change-Id: I092effc8f620aa29cc4e2b48fe977991caae13e6
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-12-27 11:19:06 -08:00
Sudheer Papothi
11d5299f26 soc: soundwire: Add support for PCM data type
Add support to enable PCM data transfer through soundwire interface.

Change-Id: I9b162beb7fcdc6bbb90303acb77c350dbcf8c490
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-12-27 11:15:20 -08:00
Sudheer Papothi
9d6350f7f0 soc: swr: update soundwire master and slave registers
Update soundwire master and slave registers based on the hardware
version.

Change-Id: I8a27bdfbbff133569a7391af8adddadd804bd50f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-12-27 11:14:40 -08:00
Sudheer Papothi
087a9f7661 soc:soundwire: soundwire master updates
Set the number of auto enumeration slaves to six.
Handle auto enumeration failed status.

Change-Id: I322e228ccee57c87840b585ab40947a0afd1b554
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-12-27 11:14:16 -08:00
qctecmdr
fec5f13aea Merge "asoc: Audio bringup changes for bengal" 2019-12-05 06:57:05 -08:00
qctecmdr
7cbd8f97f1 Merge "soc: soundwire: Update ssp period for fractional sample rates" 2019-12-05 06:56:21 -08:00
Laxminath Kasam
696b14bfa2 asoc: Audio bringup changes for bengal
Audio bringup fixes for bengal target.

Change-Id: Ic79c478fe3c6b80eeb48aa2bcf1887c8dd8f5edc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-12-04 15:07:29 +05:30
Laxminath Kasam
4696fffa8c asoc: Audio bringup changes for bengal
Update change for audio playback and record to work
on bengal target with wcd937x codec.

Change-Id: I2f781e2132b018995f30f4192efd08732196cd28
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-11-27 17:32:41 +05:30
Linux Build Service Account
e96eb4e5b2 Merge "soc: soundwire: Update check link status for master init" into audio-drivers.lnx.4.0 2019-11-24 23:57:22 -08:00