Commit Graph

55 Commits

Author SHA1 Message Date
Sudheer Papothi
4c322b1c80 Soundwire: Fix soundwire master port configuration
Existing soundwire master controller driver uses static tables
directly for soundwire port configuration. But, this is not
scalable to add support for new targets. So, define platform
specific soundwire master port configuration from machine driver.

Change-Id: I37d499c77914b413e6e16ab2689dbaae8fcd194c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-12-17 15:25:48 -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
Linux Build Service Account
d0dd6a6284 Merge "Soundwire: Check complete soundwire slave device ID" 2018-12-12 17:51:57 -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
Sudheer Papothi
6abd2debae SoC: swr-mstr: Add support for device wakeup
Add support for soundwire device wakeup through bus driver.
These APIs will be used by slave driver through bus driver
to vote and unvote for master wakeup, when it requires
master for register access operations. Master will be
aware of the slave usage with the vote for device wakeup.

Change-Id: I24f0ec0344f05926dc866edb04294cb31348e1ce
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-12-10 18:58:12 -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
Sudheer Papothi
7c067e898b Soundwire: Check complete soundwire slave device ID
Soundwire slave device ID is 48 bits. Check the complete
soundwire slave device ID during enumeration for proper
slave driver registration.

Change-Id: Iac11eb818a29c227947f3cf50cafd336b4e410a2
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-12-06 10:51:01 -08:00
Linux Build Service Account
86a34cd9cc Merge "soc: swr-mstr: add support for hardware wakeup interrupt" 2018-11-14 23:15:24 -08:00
Linux Build Service Account
708004630d Merge "soc: swr-mstr: Update hparams for all swr master ports" 2018-11-14 23:15:23 -08:00
Linux Build Service Account
9592f46b51 Merge "soc: swr-mstr: Remove master access from slave api" 2018-11-14 23:15:21 -08:00
Linux Build Service Account
fab8a74412 Merge "soc: swr-mstr: Ignore device up during SSR" 2018-11-14 23:15:20 -08:00
Linux Build Service Account
216d69750d Merge "soc: swr-mstr: Reinit clk off signal before waiting" 2018-11-14 23:15:17 -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
0db4801f4d soc: swr-mstr: Remove master access from slave api
The read/write api exposed by soundwire master is intended
to be used only for accessing soundwire slave registers.
Remove master access from the api, to avoid invalid access
due to slaves sending devnum as zero incorrectly.

Change-Id: Ia00179f87908f95f03ef027630d178016affdb18
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-11-14 11:44:46 +05:30
Laxminath Kasam
990c70b004 soc: swr-mstr: Update hparams for all swr master ports
Need to specify hstart and hstop bit fields
even if those are not used in frameshape for
given port. Soundwire master register config
needs to set as 0x0, 0xF for hstart and hstop
for those ports.

CRs-Fixed: 2333434
Change-Id: I78e103a3d4c9085ea14884691d5df3f35fa7a754
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-13 23:44:23 +05:30
Ramprasad Katkam
0fed92f477 soc: swr-mstr: Ignore device up during SSR
New audio session may be opened just before SSR
has occured. Ignore device up notification due to
new session during SSR as soundwire hardware is
not ready.

Change-Id: I06a558d0fa9e31ed6bbdfab80402ba7b337e7ad8
signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-11-12 20:45:42 +05:30
Ramprasad Katkam
7f6462ebd7 soc: swr-mstr: Reinit clk off signal before waiting
Reinit clk off signal before waiting to avoid false
positives because of the signal complete that happened
prior to the waiting.

Change-Id: I678fdc8589039d9f59e6590a4899309dad479181
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-11-12 20:38:57 +05:30
Laxminath Kasam
e30eef71d4 soc: swr-mstr: Update class-H port params
Update sampling interval for class-H as per HW spec
and hstart/hstop bit fields in swr master register
since master fields are not same as slave fields
for this setting as defined in HW register document.

Change-Id: Iefb5bb83bb8984ee964f405f53ab6f8f0ba47f75
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-09 23:31:31 +05:30
Ramprasad Katkam
18bc8e228a soc: swr-mstr: suppress continuous warning interrupts
Some warning interrupts keep flooding as long as data
path is enabled. Disable the interrupt after the first
interrupt to avoid flooding, and reenable for new data
path.

Change-Id: Ie4cd447be908ab40568fa24d6111d8a1f0483ee4
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-31 15:34:26 +05:30
Ramprasad Katkam
833035127f soc: swr-mstr: Change master interrupt to edge type
Change master interrupt to edge type handling to avoid
recurring interrupts during ssr. Add loop logic to handle
concurrent edge type interrupts.

Change-Id: I3c789a24c035a6a00b1a2f515aa5328546ad80a9
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-29 01:25:43 +05:30
Ramprasad Katkam
86c45e0761 soc: swr-mstr: Avoid race condition during device up
During device up call from platform driver, if master
is already up pm get_sync is currently skipped. However
pm suspend can get called after this check. Hence do a pm
get_sync even if master is already up to avoid race
condition.

Change-Id: I1779db3d65f58bda220d1ec07706e91745814c1f
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-25 19:25:54 +05:30
Linux Build Service Account
979ae8e796 Merge "soc: swr-mstr: Mask swrm debug interrupts" 2018-10-20 04:04:10 -07:00
Linux Build Service Account
e25f9003c6 Merge "soc: swr-mstr: synchronize swr clock requests" 2018-10-20 00:23:56 -07:00
Ramprasad Katkam
6a3050d838 soc: swr-mstr: Register for wakeup irq after disabling clk
During clock stop, Register for lpass wakeup only after
disabling the clock to avoid flooding of interrupts when
master is turned on for pending slave irq.

Change-Id: Ifbf604048d4972beb22b6286930193b83a2249e8
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-19 09:41:16 +05:30
Ramprasad Katkam
13e051c9ab soc: swr-mstr: Mask swrm debug interrupts
Mask swrm debug interrupts as workaround for interrupt
storm issue.

Change-Id: Ic623a3a161d7d04812c4dd4b2e07a3331f5ed7ec
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-19 09:27:12 +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
13bf73f231 Merge "soc: swr-mstr: Add proper handling of SSR and clock stop" 2018-10-08 23:04:39 -07:00
Linux Build Service Account
b112aeeb50 Merge "soc: swr-mstr: Ignore redundant slave path control command" 2018-10-08 23:04:37 -07:00
Linux Build Service Account
1e509a5e2c Merge "soc: swr-mstr: Fix port collision during wsa playback" 2018-10-08 23:04:35 -07:00
Linux Build Service Account
6f9a94c8ee Merge "soc: swr-mstr: Avoid handling redundant swr wakeup events" 2018-10-08 23:04:27 -07:00
Ramprasad Katkam
2a0996bc17 soc: swr-mstr: Fix port collision during wsa playback
Fix block pack mode parameter in wsa frame params to
to get proper frame allocation avoiding port collision
between DAC port and SMART BOOST port.

Change-Id: I3e552f189a67661d63a6cd0affc1cb233b53bda7
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-06 00:42:23 +05:30
Ramprasad Katkam
2a799b4065 soc: swr-mstr: Add proper handling of SSR and clock stop
When SSR occurs master needs to restart even though clock
stop mode is supported. Add proper handling of master
during SSR and suspend.

Change-Id: I21c0ffd4fb741788dd12671fe4bd04cca9d7ff59
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-06 00:39:37 +05:30
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
Ramprasad Katkam
48b49b2117 soc: swr-mstr: Avoid master reinit during clock stop-resume
Avoid reinitializing master when resuming from clock stop
to avoid possible slave sync lost.

Change-Id: I8b2403bf10c0ec2ab7b294d64441b4d9a8afcaa0
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-05 17:59:52 +05:30
Linux Build Service Account
168576aeb9 Merge "soc: swr-mstr: Enable required soundwire master interrupts" 2018-10-04 07:46:52 -07:00
Ramprasad Katkam
62d6d76b81 soc: swr-mstr: Add logic to recursively trigger slave irq handler
Soundwire slave interrupt is only edge type, so any pending slave
side interrupts could not cause a new slave interrupt, if
they are triggered before clearing of existing interrupts.
Recursively trigger slave irq until there are no pending slave
interrupts to handle this issue.

Change-Id: I254f2467f09172490796114b48f1f0feb604ad17
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-01 11:37:36 +05:30
Ramprasad Katkam
debe893b7c soc: swr-mstr: Enable required soundwire master interrupts
Enable soundwire master interrupts by setting the interrupt
enable bits in new CPU_n interrupt register.

Change-Id: Iec2502129cd04da2c8cbc3d3f43278a2ed3ba7d6
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-09-28 13:41:23 +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
Ramprasad Katkam
7cb4ff6b65 soc: swr-mstr: Use single pm runtime call during port enable
Add changes to call pm runtime calls only once for soundwire
master active, to be able to decrement and put to suspend
during SSR.

Change-Id: I068040e2a224d1ee97f472f69f25af77ae632be2
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-09-25 11:32:16 +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
Linux Build Service Account
c523b34cc0 Merge "soc: swr-mstr: Add wakeup irq support from afe using event notifier" 2018-09-03 23:29:30 -07:00
Linux Build Service Account
de663528f9 Merge "soc: swr-mstr: Add support to listen for DC detection" 2018-09-03 23:29:29 -07:00
Linux Build Service Account
8e9f1b03cb Merge "soc: swr-mstr: fix noise issue with mono speaker" 2018-09-03 12:15:15 -07:00
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
c8d52a1f56 soc: swr-mstr: fix noise issue with mono speaker
Fix noise issue with mono speaker by properly disabling
the previous port config.

Change-Id: I55fde87fcea5c8a7f05ff82a0d8967bc7688882b
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-09-03 15:08:38 +05:30
Laxminath Kasam
4721b16381 soc: swr-mstr-ctrl: porting fix from wcd controller to mstr controller
When temperature on a single wsa881x device is being read,
then soundwire master wakes up both wsa881x devices but
regcache_sync is happening only for one wsa881x device on
which the temperature is being read. This results in
audio playback mute after temperature read. Fix the
regcache sync during temperature read and playback usecase.

Change-Id: Icee46d5105bb449f14855d33bdcb00cf5c77cb91
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-09-03 14:13:00 +05:30