Commit Graph

249 Commits

Author SHA1 Message Date
Matthew Rice
cb9ebaa0b7 soc: Initial Register Updates for SWRM2p0
Change-Id: If4bc240017cbec8c536ecfbbdb327231caa037da
Signed-off-by: Matthew Rice <mrice@quicinc.com>
2021-11-09 15:32:53 -08:00
Vatsal Bucha
87f8b1c7db soc: swr-mstr: Fix headset detect issue during clk stop wakeup
When ext clk stop wakeup and slave_pending_irq come together
then interrupt at swrslave is cleared due to calling
enable_slave_irq. Do not clear interrupts for enable_slave_irq
when its called from clk stop wakeup.

Change-Id: Ia710030ab80306d6750bea7264f0d4c07053d701
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-09-22 16:55:35 +05:30
Laxminath Kasam
001ba433b2 wsa: soundwire: Add support for 4p8MHz DAC rate
Add support to use 4p8MHz DAC rate for receiver over WSA.

Change-Id: Ia0811670326be8131687fbdff70464da063902b2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-09-15 22:22:09 -07:00
Meng Wang
642659b2a3 soc: swr-mstr-ctrl: ignore interrupt when master is in clk stop mode
When swr master is in clk stop mode, the value of interrupt_status
is not actual interrupt value. Add check for pm_runtime status to
avoid endless interrupt handler.

Change-Id: I4cd7fe5f01ffdca2a441521088ea39f8804d6b51
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-09-03 22:10:54 -07:00
Junkai Cai
30fbd08bca soc: reduce the auto suspend timeout when swr event finished
the APSS would suspend within ~120ms after audio off, if system suspend
swrm_suspend() is called before swrm_runtime_suspend. The clock stop
sequence require writing IPC and expect interrupt, which would stop
the APSS to be suspended. Reduce the auto suspend time specifically when
swr event is done can call the swrm_runtime_suspend

Change-Id: Iee0c9143d65e5a8e68a8e20ab73bea9def1920bd
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-09-01 21:49:25 -07:00
Junkai Cai
c1fe3f72c2 soc: swr-mstr: Avoid underflow due to CPS spkr prot enabled
Underflow is observed sometimes with CPS spkr prot enabled.
Reduce no of retry count for wsa to 1 so as to optimize delay
between reads on wsa and prevent underflow.

Propagated from the 5.0 branch.

Change-Id: I9b20a242ad4e8375718844c9dfeb0e4996588a19
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-08-25 23:14:49 -07:00
Junkai Cai
319e140119 soc: swr-mstr: Update soundwire state to SSR during UP
During SSR up event handler, if soundwire state is
already up or auto suspend jiffies is not completed,
ensure put in suspend/SSR state.

Propagated from the 5.0 branch.

Change-Id: I2a8a995399e7844cbc1d6a5676f0d57d97577862
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-08-25 23:12:47 -07:00
Junkai Cai
16acb739c4 soc: swr-mstr: Enable device wakeup only for tx macro
At bootup device wakeup enable is called for all masters
causing issue for wsa. This is because wsa
supports interrupts. Thus enable device wakeup
only for tx master.

Propagated this change from previous target.

Change-Id: Iade70defc599952b77b664b752cc55570b4aed27
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-08-25 23:12:05 -07:00
Junkai Cai
1f7c8acba3 soc: add check condition before enabling irq
propagated from component audio-drivers.lnx.5.0 with same time.
However, original 5.10 code includes the change functionally already.
Adding check when irq_get_irq_data returns NULL.

Original comments:
Enable interrupt request only when the interrupt is
in disabled state.

Change-Id: Ic5048d2fbddf53bd0e42536677bf5d935f4e0683
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
2021-08-21 15:52:04 -07:00
Meng Wang
2344f44b9c asoc: lpass-cdc: add ftrace log for NOC issue
Add ftrace log to debug NOC issues.
When writing/reading lpass codec registers, add vote_lock
to make sure clk is not disabled.

Change-Id: I1df924d6aefee2899f7e5008851c1c324dabf62a
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-07-13 23:16:45 -07:00
Meng Wang
9cf7f24da5 asoc: swr-mstr-ctrl: return when requesting hw vote fails
In swrm_runtime_resume, when hw vote fails, it still requests
clk and tries to access gfmux which may cause kernel panic.
Update the logic to return when requesting hw vote fails.

Change-Id: I15d2913ae69bf7442ef504b588e0a55917a26071
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-06-07 10:20:07 +08:00
Meng Wang
c0c4216d1d Revert "soc:soundwire: disable pm_qos in soundwire master driver"
This reverts commit 068e2722da.

Change-Id: I2725889bc3feb83642a6da57e2b2e02b51cf28f5
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-16 23:43:21 -07:00
Meng Wang
2042476ef0 soc: swr-mstr-ctrl: add check for dev_num and port_id_offset
0 is invalid slave swrm device_num and it should
avoid config swr frameshape.
Add check for port_id_offset to avoid overflow.

Change-Id: I1eae8936c90bb7b66c27f2ff549eef099c25f011
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-05-13 04:15:22 -07:00
Vatsal Bucha
fa2a8f1b26 soc: swr-mstr: Check for fifo avail before bulk write
Check for fifo availability before writing slave registers
during swrm master bulk write so as to prevent swr
overflow, underflow errors.

Change-Id: I97a914cac289b3f1215ccf5c1abec88b959a9f21
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-05-10 09:34:27 -07:00
Linux Build Service Account
fe0aa26767 Merge "soc: swr-mstr-ctrl: add new lock to sync runtime_resume and runtime_suspend" 2021-05-02 22:55:47 -07:00
Meng Wang
42d4d58d8b soc: swr-mstr-ctrl: add new lock to sync runtime_resume and runtime_suspend
runtime_suspend may get from multi functions and reslock is
unlock and lock inbetween which may cause clk count mismatch
with multi rutime_suspend called. Add new lock to make sure
runtime_suspend is run in sequence.

Change-Id: Ie465ded6dc1db1244035e9f4d216466b630df82b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-04-27 16:33:32 +08:00
Laxminath Kasam
1162b303cf soc: soundwire: Update interrupt masks based for CPU1 bits
In soundwire v1p7, CPU1 register bits used from Apps EE.
Update interrupt status and mask bits for CPU1 also to
be included.

Change-Id: Ied86e11756db8609fcd5b81e505f07a4c066c2b8
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-04-26 22:09:43 -07:00
Meng Wang
37b25ca9ac soc: swr-mstr: update logic to dump soundwire register
Some soundwire register dump is skipped with current logic.
Update ppos logic to dump all soundwire registers correctly.

Change-Id: Id053e2b71705ca17caf2de2bb85f8c987790099a
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-03-30 08:39:20 -07:00
Meng Wang
c33716c930 soc: swr-mstr-ctrl: update sampleinterval low only when disconnect swr port
Register SWRM_DP_PORT_CTRL_BANK only has sample interval low.
When disconnecting swr port, only update sampleinterval low for
active port.

Change-Id: I79e52a54c5ff1d08cf320835a8401041a10b8181
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-03-23 15:23:09 +08:00
Vatsal Bucha
3165e40082 soc: swr-mstr: Change default swrm mstr version to 1.7 for waipio
Change default swrm mstr version to 1.7 for waipio.

Change-Id: Ide746806363e6fa8abfe142ca4462ac938491257
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-03-15 12:24:29 +05:30
Linux Build Service Account
851902df59 Merge "soc: swr-mstr-ctrl: remove unnecessary check in swr_remove_from_group" 2021-03-12 08:02:05 -08:00
Laxminath Kasam
d45f83b5bf soc: swr-mstr: Add out-of-bound check
Update out-of-bound check in parse swr port mapping.

Change-Id: I3735ff68c293fdb96dd7b004438faa999195adb2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-03-11 12:28:19 +05:30
Meng Wang
eda9e79453 soc: swr-mstr-ctrl: remove unnecessary check in swr_remove_from_group
swrm->num_cfg_devs is never changed and it would cause
swr_remove_from_group doesn't work. Remove swrm->num_cfg_devs
to fix this issue.

Change-Id: Id3e39e3e95dfa32e1d81234b1669af3d2b6737bf
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2021-03-09 14:47:09 +08:00
Vatsal Bucha
79d3ed87ca asoc: codecs: fix race condition of core vote and reg access
Auto suspend timer for core vote is triggering before read write complete.
Move the auto suspend of core vote to post read write operation.

Change-Id: I758cf57bde4e0b56320ef18f6f17adc655fc8fcb
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-03-08 06:24:35 -08:00
Laxminath Kasam
45d07c545c soc: swr-mstr: Update master port max check
In pcm port config, update max port check.

Change-Id: I6e0aa683137678962827469914633adade937132
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-03-08 13:51:37 +05:30
Laxminath Kasam
39c95cbca4 soc: swr-mstr: Handle error exit for swrm probe fail
In one of failure for swrm probe, swr unregister
is not done causing crash. swr unregister device
in respective error case.

Change-Id: Idbf50b2ae1d66eafa1db8dbbd386db7982c3b0f8
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-03-05 10:12:42 +05:30
Laxminath Kasam
a87c793e30 soc: soundwire: Ungate the swr rx ports
In soundwire version 1.7, rx soundwire port2/3
are extended to 32bits to use as PCM port too.
When using for PDM port as well, need to ungate
the ports for functionality to work.

Change-Id: I1815a9337ab21e0000ca7dbfeaac4c01dadec0dc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2021-03-01 13:54:02 +05:30
Sudheer Papothi
068e2722da soc:soundwire: disable pm_qos in soundwire master driver
Disable pm_qos in soundwire master driver.

Change-Id: I0f042faf48f003bef8b43641ef0ccb3cf82d7dd9
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2021-02-13 06:35:22 +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
Laxminath Kasam
9a4b45f6bb soc: swr-mstr: Update port params for TX master runtime
Remove static tables for master port params for soundwire TX.
As master port params are dependent on slave port config,
determine master port settings runtime and apply for
TX soundwire master ports.

Change-Id: I5e606404521abd514097ddf7500ba4e427024914
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-18 14:32:13 +05:30
Jyotirmoi Sarma
eb74cdddba soc: Upgrade soc to support 5.10 kernel
Change symbolic links of header files
Update kbuild file to include waipio config
Upgrade to new QoS APIs

Change-Id: Idbbc734e79e50bfae8aa5baa0a5cd4b566f02e50
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-14 17:18:47 +05:30
Laxminath Kasam
2489ca529c soc: swr-mstr-ctrl: Update multi_EE setting for clock_stop
Update link_manager and multi_EE clock stop settings
during master_init and clock stop wakeup.

Change-Id: Idc1610551304209c2688486b1061452ee4e2e46a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-03 22:57:08 -08:00
Laxminath Kasam
98799c5e2f soc: soundwire: Update auto enum value from HW
remove macro for supported auto_enum slaves and
read from master comp_params. Update num_dev logic
to compare with supported auto enum slaves.

Change-Id: Iedadde5a3ee83645c4d8d16e738376e1797fc649
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-03 22:56:59 -08:00
Laxminath Kasam
38adb70f3c soc: swr-mstr: Update default val of comp_cfg
for PCM_OUT/IN dataport, update enable bit logic
using default value based on SWR version.

Change-Id: Ibfd342d9046834d074a12003f15e868c5336798c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-03 22:56:31 -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
Ashwini Muduganti
7c9ef4221e soc: add check condition before enabling irq.
Enable interrupt request only when the interrupt is
in disabled state.

Change-Id: I67795bf0ee344661e02b0fec3181cd7980d56652
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-10-23 11:04:00 -07:00
Vidyakumar Athota
88c1c0288c Merge commit '1a7cee75ba63d6cce68924591b125d604bef39f5' into audio-kernel-5-4.lnx.1.0
Change-Id: Ie4363b4d1be12c7fd85e261bf728462009d8a2cf
2020-09-30 10:01:03 -07:00
Harshal Ahire
4015ed0c54 soc: fix HS LPI issue for holi target
- Skip audio hm voting during bootup.
- Vote and unvote audio hm vote during swrm_runtime_suspend
  and swrm_runtime_resume

Change-Id: I7a9c20f62ba0d87779b26da218bfe7373132b565
2020-09-29 00:35:35 -07:00
Sudheer Papothi
001b648150 soc: soundwire: Update frame configuration for native audio playback
Update frame shape configuration for native audio playback for better
performance during native audio playback.

Change-Id: I2d7c22e1cb69e73e4f474be020931d74715a1a60
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-09-19 10:58:26 -07:00
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
Meng Wang
91437a36ea soc: swr-mstr: check swrm->state in swr_runtime_suepend
in swrm_runtime_suspend, current_state is not updated and
causes audio_core_vote is not disabled. Update to check
swrm->state to resolve this issue.

Change-Id: I2c5be360fe5ddd964d7bc45696e254579aae5392
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-09-08 13:13:56 +08: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
d22126dbda Merge "soc: soundwire: Fix soundwire audio core voting sequence" 2020-09-03 18:06:23 -07:00
qctecmdr
9fd22f4064 Merge "soc: soundwire: fix for headset mic recording issue with wcd937x." 2020-09-03 18:06:23 -07:00
qctecmdr
c0411d8c3a Merge "soc: soundwire: support 600KHz bus clock scaling" 2020-09-01 18:11:51 -07:00
Sudheer Papothi
e649c72517 soc: soundwire: Fix soundwire audio core voting sequence
Fix soundwire audio core voting sequence during sub system restart.

Change-Id: I1653cc8b62083b5b736e661d608b0249e03f6093
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-08-31 16:49:57 -07:00
Vangala, Amarnath
03357c3d52 soc: soundwire: fix for headset mic recording issue with wcd937x.
Add slave device address for wcd937x in soundwire master.
Update slave port configuration for wcd937x for holi.

Change-Id: I1f953e47b1520efd99b6f400593242ae5fc6158a
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
2020-08-31 16:42:25 +05:30
qctecmdr
b387595408 Merge "soc: swr-mstr: update component and interrupt enable sequence" 2020-08-29 00:30:36 -07:00
qctecmdr
d605e7c781 Merge "soc: swr: release transaction slot at failure" 2020-08-29 00:30:36 -07:00
Xiaojun Sang
7eef74a32f soc: swr: release transaction slot at failure
Transaction slot is not freed when failure happens. Accumulated
error may lead to breach of transaction slot limit. Free the
transaction slot at failure.

Change-Id: I8588be18a820306d2a596fe2bf4a97346076b9b9
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2020-08-26 05:56:02 +08:00