Gráfico de commits

67 Commits

Autor SHA1 Mensagem Data
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
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
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
Matthew Rice
f23bc97308 soc: Fix SWRM_VERSION_2_0 value
Update version value to match swrm HW_Version register
Fixes an error message seen in logs.

Change-Id: Ia2d6f97b8f11305d73705e2c401af1f013af94bc
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2022-03-31 12:35:00 -07: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
a0a83d7e42 asoc: Update SWR Port Types for Kalama chipset
Add PBR, CPS port types and port parameters for WSA
Update RX and TX port types to include full list of ports

Change-Id: I5b69ee777addebcf4167dccd4ce4ab0af31b754d
Signed-off-by: Matthew Rice <quic_mrice@quicinc.com>
2021-12-09 08:54: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
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
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
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
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
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
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
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
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
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
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
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
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
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
qctecmdr
ace3a85d2f Merge "soc: soundwire: Update sample interval configuration" 2020-04-26 23:42:49 -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
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
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
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
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
qctecmdr
7cbd8f97f1 Merge "soc: soundwire: Update ssp period for fractional sample rates" 2019-12-05 06:56:21 -08:00
Sudheer Papothi
8a8b12b245 soc: soundwire: Update ssp period for fractional sample rates
Frame sync for fractional sample rates is different. Update
ssp period based on frame sync of fractional sample rate
for synchronization of the data channels.

Change-Id: I25eaa5195abcdfad54cfed09beb0abe5aff2499a
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-11-21 11:07:38 +05:30
Vatsal Bucha
8bcaeab611 soc: swr-mstr: Fix unbalanced enable for wakeup irq
Enable IRQ for wakeup is called multiple times resulting in
throttling. This is because irq is not disabled after enablement.
Disable wakeup irq in runtime resume to fix the issue. Also
add check so that irq is not disabled more than once.

Change-Id: Ib5b7493298beb3ca4bcf78b2adbd7d4ac9ce6111
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-11-18 15:16:03 +05:30
qctecmdr
137583f46f Merge "soc: soundwire: change ssp period based on frame shape" 2019-10-30 10:26:57 -07:00
Sudheer Papothi
ac0ae1c298 soc: soundwire: change ssp period based on frame shape
Change SSP period based on soundwire bus clock rate and frame shape
to avoid any synchronization issues.

Change-Id: I376958c6b92eca28b857c4c7c9948b1e56818657
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-10-25 10:16:33 +05:30
Laxminath Kasam
c7bfab9706 soc: soundwire: Update hctl gate setting for SWR version 1.6
In soundwire version 1.6, hw_ctl gating is required to address
HW limitation as SW workaround to get SWR functionality working.

Change-Id: Ia0939b1271f5400319217433de658a55a05ca404
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-10-09 22:38:45 +05:30
qctecmdr
de5b3da5ca Merge "SoC: soundwire: Update debug soundwire master read/write functions" 2019-09-17 00:53:25 -07:00
Karthikeyan Mani
1d750fe50f soc: swr-mstr: Vote for core vote before clock request
For soundwire devices, if core vote function is available,
do a core vote before doing a clock request. This way
we retain any hardware votes needed before doing a read
or write.

Change-Id: If29b5f102be4f2d60e6d71cae70ac43e3fdaa00c
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-09-11 11:22:13 -07:00
Sudheer Papothi
96c842a261 SoC: soundwire: Update debug soundwire master read/write functions
Replace debug read/write register functions with
swr_master_read/swr_master_write to support different interfaces to
access soundwire registers.

Change-Id: I377bb927ee769a18c0179045953a521d0a83057f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-09-02 11:11:50 +05:30
Sudheer Papothi
384addde09 soc: soundwire: request lpass core and audio votes
Soundwire requires lpass core and lpass audio core to be enabled
to receive interrupts and soundwire register read/writes. Change
enables lpass core and lpass audio core in interrrupt service
routine and during register read/writes.

Change-Id: I56da2fc6efe7dfb1a7d59937b123b3972f633448
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-06-21 15:24:16 -07:00
qctecmdr
553c49490a Merge "soundwire: Vote for LPASS HW Core before soundwire register access" 2019-04-14 23:16:15 -07:00
Sudheer Papothi
66d6fd1364 soundwire: Vote for LPASS HW Core before soundwire register access
Vote for LPASS HW core before soundwire register access to avoid
register access violations.

Change-Id: Ie7ff73bbab64825bf07736f11ef9685e732fc8ae
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-04-05 19:16:37 +05:30
Vatsal Bucha
df38c3eb18 soc: swr: Add wakeup source for swr device
Voice call over headset does not disconnect on button press
while device is in suspend state. This is because inband interrupt
is not made wakeup capable. Make inband interrupt for swr tx as
wakeup capable. Also add wakeup source for swr device.

Change-Id: I5f2751672675bc8d62c4d2bfbbd651e640723d52
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-02 12:29:20 +05:30
Sudheer Papothi
63f4815535 soc: swr-mstr: Support to execute commands on command ignore
If the optional commands/registers in soundwire slave(s) are not
implemented, then soundwire bus will ignore the corresponding
commands and executes the next commands in queue.

Change-Id: I24dd929975218a150717f03f5c17c2be173a5005
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-12-26 00:51:09 -08:00
Sudheer Papothi
3d1596e2c6 soc: swr-mstr: Add support for platform specific port configuration
Different platforms have different configuration for soundwire
ports. Add support to get the port configuration information
from the machine driver.

Change-Id: If2c006c4d4a43e2a8dc67c076f6d1c0f36eae16b
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-12-17 12:16:26 -08:00