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>
-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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- Skip audio hm voting during bootup.
- Vote and unvote audio hm vote during swrm_runtime_suspend
and swrm_runtime_resume
Change-Id: I7a9c20f62ba0d87779b26da218bfe7373132b565
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>
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>
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>
This reverts commit d02c7efb35.
and commit 61f235e5bd to avoid AOP
related issues.
Change-Id: I0b8b44bc5cca6bef6bc18c228f08a9c585c79c1c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
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>
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>
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>
Update MSB of sample interval in the frame shape
to avoid misconfiguration.
Change-Id: I05e99bc563f6cdc71c7caf424441c4caa44ec4c6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
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>
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>
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>
Add support to enable PCM data transfer through soundwire interface.
Change-Id: I9b162beb7fcdc6bbb90303acb77c350dbcf8c490
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>