Commit Graph

53 Commits

Author SHA1 Message Date
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
Ramprasad Katkam
7e35478bf6 soc: swr-mstr: Store enabled interrupts information in master data
Store interrupt mask variable in master private data to
indicate the interrupts which are currently enabled. This
is to avoid reading interrupt enable register, which varies
on hardware version, for knowing the interrupt enabled info.

Change-Id: Ic990decd1b1112a1ad2a6af0d9b42269fe4e1b4c
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-12-11 17:32:21 +08:00
Ramprasad Katkam
5734987f61 soc: swr-mstr: Add wake lock support to prevent suspend
Add lock and unlock sleep functions to master to prevent
system suspend during interrupts or slave wakeup
requests.

Change-Id: Icb4ea354ec6e2925f83c2380f30ea8e37aca7449
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-12-10 21:43:39 -08:00
Meng Wang
43bbb87652 asoc: Update file header to GPL-2.0-only
Update file header to GPL-2.0-only.

Change-Id: Ic1542a3209a5fe73c937a5b36491ede4a451936d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-10 14:49:34 +08:00
Meng Wang
61af6849e9 ASoC: switch audio drivers to SPDX identifier
Switch audio drivers to SPDX identifier on msm-4.19.

Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 15:47:32 +08:00
Aditya Bavanari
c034fadb2c soc: swr-mstr: add support for hardware wakeup interrupt
Add changes to register hardware wake up interrupt
from soundwire data line or ipc wake up interrupt
from LPASS.

Change-Id: Ibe4277db79aa62f34e9b325ae656b3f3fa7a2bcb
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-11-14 17:04:43 +05:30
Ramprasad Katkam
6bce2e7374 soc: swr-mstr: synchronize swr clock requests
synchronize swr clock request using mutex and ensure
count becomes zero during ssr.

Change-Id: I3aa933a137d9439742d84fc23b37653da86f3b42
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-18 02:23:43 +05:30
Linux Build Service Account
b112aeeb50 Merge "soc: swr-mstr: Ignore redundant slave path control command" 2018-10-08 23:04:37 -07:00
Ramprasad Katkam
cd61c6ef14 soc: swr-mstr: Avoid handling redundant swr wakeup events
It is sometimes observed that afe could send multiple wakeup
events at a time. Avoid this by handling wakeup event only once
per swr suspend.

Change-Id: Ieb9ed1b18c8c93cb7db4b75e3411cc25838be492
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-05 22:48:05 +05:30
Ramprasad Katkam
cab8d72ab0 soc: swr-mstr: Ignore redundant slave path control command
Slave could trigger multiple path control api multiple times
after connect/disconnect port. Avoid handling the api without
new connect/disconnect requests to reduce latency.

Change-Id: I4db52fdebfd6b7c0fe3f388f25dfaa4981d5f61c
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-05 18:38:40 +05:30
Laxminath Kasam
1df09a82e5 soc: add SSR changes for swr mstr controller
Add changes to recover audio during SSR and PDR
in swr master controller driver.

Change-Id: Ibe3ae097b5f9d59b135d861c5f50f6bbc1c05af6
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-09-25 11:32:40 +05:30
Laxminath Kasam
b0f27cd9f0 soc: swr-mstr: add changes to support native playback
For MCLK frequency switching to 11.2896 for native
playback support, frameshape also needs to be changed
accordingly. Add changes to support frameshape switch
based on mclk frequency for given master.

Change-Id: I0c4dd69b743f83b45eeed73f27ad10e878b9244b
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-09-11 15:52:47 +05:30
Laxminath Kasam
f0128ef169 soc: swr-mstr: Add wakeup irq support from afe using event notifier
Register and handle swr wakeup irq from afe, using aud event
notifier codec interrupts during clock stop mode.

Change-Id: I76d250adcaa8af4a413f6274482beb5a3469601d
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-09-03 10:18:47 -07:00
Ramprasad Katkam
68765abe11 soc: swr-mstr: Add support to listen for DC detection
Add support to listen for DC detection event.
Shutdown WSA on receiving DC detection event.
Porting the changes from old master driver to new driver.

Change-Id: I4d323bb8074d447b2969dd01c7129e57160b6c04
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-09-03 10:18:36 -07:00
Ramprasad Katkam
14f47cc8a6 asoc: swr-mstr: add rx and tx master frame configuration
Add Rx and TX master frame configuration.

Change-Id: I067931565270e7390d9c5311e0869dfdb6685999
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-08-30 07:48:49 -07:00