Graphe des révisions

280 Révisions

Auteur SHA1 Message Date
Vangala, Amarnath
443ca7a00e soc: swr-mstr: add support for bt swr ports
Add support for BT Soundwire port configurations.
Add support for flow control modes for fractional channel rates.
Configure slave side data ports for flow controls modes.
Fix the direction adn offset1 fields for Tx ports on BT Soundwire.
When the flow control mode is not required,
 update the slave configuration accordingly.
Sample Interval HIGH field in slave port controls needs to be
reset to zero when Sample Interval value is less than 255.
Avoid clock stop mode for bt swr slave during runtime suspend call.
In case of fractional sampling rates, additional offset bits need
 to be added between samples to carry flow control information.

Change-Id: If023946f62c5157119836cf43e8542cfd6e0ce16
Signed-off-by: Vangala, Amarnath <quic_avangala@quicinc.com>
2024-03-14 00:31:39 +05:30
Sarath Varma Ganapathiraju
b58f10f76f soc: add support for swr version 1p7
-add support for swr version 1p7.
-Return 0 instead of EBUSY during swrm_suspend to
allow system to enter suspend without rx swrm
preventing it.
- Update proper reg value during pcm port config.

Change-Id: Id42d3625a0609507fffc92b650cfae92b0e1dc4f
Signed-off-by: Sarath Varma Ganapathiraju <quic_ganavarm@quicinc.com>
2024-03-08 04:03:52 -08:00
Prasad Kumpatla
bd6e28b958 soc: add irq_set_irq_wake() enable and disable IQRs
from Linux version(>= 5.10) for disabling the irq need
irq_set_irq_wake() along with disable_irq_nosync(). Only
disable_irq_nosync() not allows IQRs to fully disable.

Change-Id: I4eb18ec0d6b96cdb11dcc35d847fefb0ed59cc82
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2024-02-12 19:05:28 +05:30
Deepali Jindal
db2a1f4e28 soc: Address SWR rate mismatch interrupt
SWR unknown interrupt value: 131072 happens when
disable handset/headphones. Handle DOUT_RATE_MISMATCH
irq to fix this issue.

Change-Id: Ibf3e93df0594eae10dc568bcd4de73526510b963
Signed-off-by: Deepali Jindal <quic_deepjind@quicinc.com>
2024-01-22 03:26:14 -08:00
yuayang
568d8d0822 asoc: audio-kernel: Remove trace_printk
Remove trace_printk point.

Change-Id: I76b53eda77bc41c75e06a885084022d74c248188
Signed-off-by: yuayang <quic_yuayang@quicinc.com>
2023-12-21 16:26:31 +08:00
Faiz Nabi Kuchay
da3a17a06c soc: handle invalid address passed to swrm_peek debugfs node
Add logic to handle invalid address passed to swrm_peek and swrm_poke
debugfs node.

Change-Id: I46443734e6b4b758276cdf8fd28a022d37112bfc
Signed-off-by: Faiz Nabi Kuchay <quic_fkuchay@quicinc.com>
2023-07-31 05:03:11 -07:00
Ganapathiraju Sarath Varma
4b8497c773 SOC: Update swr master num port based on ports enabled.
During swr disconnect port, swr master num port is
updated based on the portinfo we receive from slave.
Instead update the master num port based on the ports
enabled. and also if requested port is not enabled
continue to check for other enable port instead of
returning error.

Change-Id: Ia8a6e4935df443f9833e01d56195b590afe3bb4a
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2023-04-04 21:46:21 +05:30
Prasad Kumpatla
ecbb93d98d soc: define ratelimit for prints to avoid flooding of logs
Change-Id: I7aa38c992716152ebb336190d9d3cd2e9a60e8e0
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-03-30 05:33:58 -07:00
Ganapathiraju Sarath Varma
4c76e50b0b soc: Boundary check for swr master num_port.
During stress testing, observed master num port is
going out of bounds which is impacting the next usecase
and leads to bus clsh error.
added a check to set master num port to 0 if it is
going out of boundary.

Change-Id: If273230fcef612bae484b19c5b69506606b0e911
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2023-03-28 11:26:29 +05:30
Prasad Kumpatla
f76f408091 soc: swr-mstr-ctrl: dedicated ports for enable/disable of PCM usescases
For PCM usecase enable/disable we have dedicated ports, so no need of
using counter to manage enable and disable of ports.
This is revert of change-id: I2c65e7658bf90ae01203ebb1b15f14db581ffa55.

Change-Id: Id1953f529569ae48b01dce1c88d2790479cf1a6b
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2023-01-04 12:42:53 +05:30
Meng Wang
2b2d743455 soc: swr-mstr-ctrl: disable pcm out/in when all ports are disabled
PCM_DP_OUT/IN enable bit are used for any data_port which supports
word_length larger than 8. Disable these two bits only when all
the ports are disabled.

Change-Id: I2c65e7658bf90ae01203ebb1b15f14db581ffa55
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2022-11-30 11:49:19 -08:00
qctecmdr
04f7220eea Merge "soc: swr-mstr-ctrl: reset PCM_DP_OUT/IN count when SSR" 2022-11-22 06:44:34 -08:00
Yuhui Zhao
39e7f936b4 soc: swr-mstr-ctrl: reset PCM_DP_OUT/IN count when SSR
during SSR, swrm_disable_ports() is not called so the pcm_enable_count
never decreased. Reset the count to 0 when SSR

Change-Id: I937dd309ab9fb2c28c0962053cd1632c891fb598
Signed-off-by: Junkai Cai <junkai@quicinc.com>
2022-11-21 01:36:16 -08:00
Prasad Kumpatla
ec92742831 soc: avoid unnecessary attempts during SSR
as part of swrm_runtime_suspend, multiple attempts are made
to write into swr regisers. Incase of SSR state, all those write
 attempts are bound to fail.
Hence avoid swr read/write operations during SSR state.
Also move updating dev_up flag for SSR event to an early point in call flow.

Change-Id: I805d1ccf8bcdab5fdde7b74582a65463d5bcbd6e
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
2022-11-14 01:38:41 -08:00
qctecmdr
239b1155ff Merge "soc: swr-mstr-ctrl: Update SWR V1.6 registers" 2022-09-01 01:59:41 -07:00
Yuhui Zhao
4b2a2b04ee audio-kernel: Add missing “\n” for trace_printk() in Audio drvier.
Add missing “\n” for trace_printk() in Audio drvier.

Change-Id: I444464dc717c13330e9d4ea686340db4ccd01d6e
Signed-off-by: Yuhui Zhao <quic_yuhuzhao@quicinc.com>
2022-08-17 13:45:22 +08:00
Soumya Managoli
a5dda29cfd soc: swr-mstr-ctrl: Update SWR V1.6 registers
Update swr ver 1.6 registers.

Change-Id: I074a22305915b2ca38b6d6107fa253a435f92214
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2022-08-12 20:02:32 +05:30
Phani Kumar Uppalapati
42f2072808 soc: swr-mstr-ctrl: allow runtime suspend first before system suspend
Allow the swrm to runtime suspend first before entering system
suspend. This will prevent suspend being blocked for about 700ms.

Change-Id: I8f90a9f1ba4f6af0decc256cace2f3bd2295dece
2022-08-09 12:02:24 -07:00
Ganapathiraju Sarath Varma
e517fca722 soc : swr-mstr-ctl : Disable PCM port wth proper condition check
disabling pcm port only when master port needs to be disabled.

Change-Id: I666d4acdad5d7c01e366fac972cb72f85f99d75e
Signed-off-by: Ganapathiraju Sarath Varma <quic_ganavarm@quicinc.com>
2022-07-29 23:53:02 +05:30
Phani Kumar Uppalapati
12625e7622 soc: swr-mstr-ctrl: check for device number before port params init
If the peripheral device is not enumerated, device number is stuck at
0. Check device number for 0 before initializing port params.

Change-Id: I444b37d56bebdebf75e8e7554cd435beece6b066
2022-07-25 14:06:21 -07:00
Phani Kumar Uppalapati
e7b87f2fcc Revert "soc: Fix PDR WSA auto-enumeration issue"
This reverts commit d17a0ca85e.

Change-Id: I23792f4926184f4e37afed59b08a870d7279979d
2022-06-27 23:37:31 -07:00
Matthew Rice
d17a0ca85e soc: Fix PDR WSA auto-enumeration issue
During PDR, WSA auto-enumeration is swapped (WSA2
gets enumerated before WSA1 unlike bootup).
This causes offset1s to be swapped because dev_nums are
swapped and are used to index into device tree data.
Store dev_id during enumeration and use this instead of
dev_num to pick out offset1 from device tree data.

Change-Id: Ia98ba6554acf67055357625fc789065b60d7006b
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-06-10 11:35:44 -07:00
Meng Wang
95c95b2d67 asoc: update digital_cdc_rsc_mgr_hw_vote API
Update digital_cdc_rsc_mgr_hw_vote_enable/disable API with device
info for easy debug. Also, add swrm clock enable checks during SSR.
When SSR happens, swrm->hw_core_clk_en and swrm->aud_core_clk_en will
be reset without resetting audio_vote and core_vote clk. This would
cause clk mismatch in audio driver and adsp and device fails suspending
when there's no audio usecase. Make this change to reset audio_vote
and core_vote clk when receiving SWR_DEVICE_SSR_DOWN.

Change-Id: I9875aac9f6faf8b6481457a70f31b005073369e0
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-05-06 10:50:36 -07:00
Matthew Rice
ba5d48660f asoc: codecs: Fix WSA Offset1, BP Mode SWR config
Update settings to match how swr_mstr_ctrl driver is using the
SWR settings to set the registers. Previously, an offset1 of
0xFF would write 0xFF to the register instead of skipping it, unlike
other swr settings. This is similarly true for SWR Slave setting
for bp_mode.

Change-Id: I3c5b2635c5a88a52639cbac9455a544d5cfee154
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-04-21 14:58:38 -07:00
Shazmaan Ali
a20e11e0c3 asoc: codecs: Replace dev_err/info with ratelimit prints
replace all dev(pr)_err/info logs
that could potentially flood kernel logs with
ratelimit functions dev_err_ratelimited and
dev_info_ratelimited

Change-Id: I32dc6002dead1a07622978c4de63d541c01982fd
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
2022-04-13 12:43:20 -07:00
Meng Wang
018369d65f soc: swr-mstr-ctrl: remove FIFO_Flush for overflow
FIFO_Flush should only be for SWRM_INTERRUPT_STATUS_CMD_ERROR.
For other usecase, it should not be flushed otherwise it would
cause register write mismatch and cause some sideeffect.

Change-Id: I6d40a30129dfdf48993125fb57042ab97a13a631
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
2022-03-02 22:02:00 -08:00
Matthew Rice
3a6ef472dd asoc: codecs: Enable custom WSA SWRS port settings
For PBR and CPS ports, need the ability to customized slave
SWR frame OFFSET1 settings. Add similar method to WCD TX where
offset1 and lane_ctrl parameters are parsed from WSA device tree
and configured in SWRM.

Change-Id: Ib973ed93d9daa5ba02461a156e5b0a8c816d371e
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-03-02 22:01:34 -08:00
Matthew Rice
0aca66e5fe soc: swr-mstr-ctrl: Add a uniq CMD_ID for every slave action
For all FIFO_WR/RD_CMDS, add function that increments cmd_id
every time for easier sw debugging.

Change-Id: I53d133d9b427dd6b80201aab3c6f367600e82bfc
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-28 08:36:52 -08:00
Matthew Rice
b6785ab5bc soc: swr-mstr-ctrl: Remove SI_HIGH write if > 0xFF
Slave reg SAMPLE_CONTROL_2_BANK (0x23) should only be written
when sample interval is > 0xFF otherwise we get CMD_Ignored IRQ.
Also add handling for this CMD_IGNORED_AND_EXEC_CONTINUED Irq.

Change-Id: I4693fb17ba78c73d4fda2e4ddce9fa6e0311309d
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-02-27 22:01:38 -08:00
Matthew Rice
8f819a5cda soc: Fix bugs found in register updates to SWRM
Add CPU_m calculation in CPU_SW_MESSAGE.
Fix CLK_CTRL value. Skip 0x2C54 to 0x4000 in reg_show.

Change-Id: I487bfab9c9fa6c1e99af1b778da7d150ef5ac927
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-01-20 21:29:57 -08:00
Matthew Rice
0209346e14 soc: Fix PCM Port Config and CLK_CTRL Writes
Simplify register write logic for PCM ports due to multi-ee changes.
Update SWRM_MCP_CTRL to SWRM_CLK_CTRL(ee).

Change-Id: I36e78f3f2abdb65925b141d5192adf618697d674
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2021-12-06 10:39:03 -08:00
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