When SSR happens, use dev_up flag in codec
to bail out from clock enablement routine.
During interrupt processing if clock enable fails during
SSR, exit isr routine without disabling clock.
Change-Id: Ie2b56521daa70790d6ef53a06c7becc2ee8010a4
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Before every slave interrupt handler call, reset slave pending
irq flag, so that if irq is halted it does not retain the old
value.
Change-Id: Ibde5dacf38e78ab19afb6f0e91ffac81f6c22813
Signed-off-by: Ramprasad Katkam <katkam@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>
For codecs like tavil/tasha where the soundwire register access
is through codec bridge, the soundwire bus latency is absorbed
in slimbus io operations, hence do not require extra delay in
soundwire driver for io operations.
Change-Id: If77aa02f0c3c1755916b7a57776115d12e4f08bd
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Some of the interrupt status bits of soundwire interrupt registers
are different in different versions of soundwire. Change is to
handle the interrupts based on soundwire version.
Change-Id: Icac65c9986a3d5724da6343b4202931f04f57f25
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
In trinket target, interrupt for wakeup is provided via
chip TLMM. Add required support to handle wakeup
interrupt on SWR data line triggered over this TLMM line.
Change-Id: I7fb6d7009a6271d54d0f11f99930b0d039f57129
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
MBHC operations may take around 200ms to get stopped
during ssr. Match timeout for clock voting to be zero
to allow any pending mbhc operation to exited.
Change-Id: I82162e96595fb337f19192f58f1aa7792e8b0e90
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Hold system suspend when hardware wakeup interrupt is
received to resume soundwire master.
Change-Id: I99a58aa7d28cfa514d72bacc8c6fc6e95fbe038a
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Do bank switch to default bank during ssr/pdr as master
is reset to default state. This avoids wrong state of
swr master during pdr.
Change-Id: I86a7bd53d471e9d864d25dcb84ad8fe12151cc0d
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Do not disable wake irq during registration of
wake up interrupt as it leads to multiple disable
calls of wake irq during boot up and headset detection
fails sometimes.
CRs-Fixed: 2356299
Change-Id: I79aa0ab46d26dc0e352d399e0d4381a11ed936f4
Signed-off-by: Aditya Bavanari <abavanar@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>
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>
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>
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>
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>
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>
Switch audio drivers to SPDX identifier on msm-4.19.
Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
synchronize swr clock request using mutex and ensure
count becomes zero during ssr.
Change-Id: I3aa933a137d9439742d84fc23b37653da86f3b42
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
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>
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>
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>