Call pm runtime functions from wakeup interrupt
only if soundwire master is not in SSR and if dev up is
true.
Change-Id: Ic394be964437bdc009f1b4c5dd6e46673875b0df
Signed-off-by: Vignesh Kulothungan <vigneshk@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>
Audio core vote enables soundwire master and establishes
soundwire link without which soundwire master will not power up.
This change votes for audio core during soundwire runtime
resume and unvotes during soundwire runtime suspend.
Change-Id: I3ca283be42670a56102c4f08c0f207ae9dc4e5c3
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
There is no delay after last write during bulk write. Add 100us delay
so as to ensure that last write goes fine.
Change-Id: Ifc1585f30eec639ffd6b80dde2e0365f368349d7
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
irq_set_irq_data is used as argument to irq_set_trigger_type
which can be NULL. Check if irq_set_irq_data is NULL before
access.
Change-Id: I4832d65da22327d184b8a0927e84ff0ca4d40fad
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Fifo status is not printed during overflow|underflow irq.
Print status in hex format to resolve compilation error.
Change-Id: Ia9ececc58ec58b00c1bbd7b097abce1393d155ab
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>
Reduce soundwire runtime suspend delay for soundwire
to enter into sleep early once the usecase ends.
Change-Id: Idbace0fbe9363f487165865eacf5b85d3be86477
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Irq pointer is first freed and then used in
irq_set_trigger_type and set wakeup capable.
This may lead to Null pointer dereference if
irq is NULL. Free irq after using it.
Change-Id: I86339e9995922cc8111f12593eb781226bb07a2a
Signed-off-by: Vatsal Bucha <vbucha@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>
For soundwire version 1.6, HCLK remove HW controlled
at bootup before soundwire frame generation status check.
Change-Id: Idc2420d086261766ea4e79f69320f12c4d6b2259
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
HW vote and unvote is currently called from multiple
clients leading to synchronization issues
during SSR/PDR scenarios. Synchronize all the vote requests
by using digital codec resource manager.
Change-Id: I7e63f69ab5d761a3bb4c7ce70bbef2e8bfd76cfb
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Remove reslock usage from device wakeup vote and unvote functions.
Mutex lock 'reslock' is to used only within runtime resume
and suspend functions, to avoid race conditions between them.
Change-Id: I221b00db2e762a0803b898a62cd98db1fe3ae3fa
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Soundwire bus clock frequency should not exceed MCLK. Fix
the soundwire bus clock frequency to MCLK during clock scaling
for proper SSP calculation.
Change-Id: I347c8ee0f63f34428160a3408eaa0e999142bc78
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
During SSR and headset detection/removal interrupt
concurrencies, ssr_lock can lead to serv reg ack timeout
issues. Remove this synchronization to avoid this issue.
Change-Id: I242a013a7e9d833db21d737cbdfea2d84bbd29fa
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
In order to synchronize the core and audio hw votes
in SSR use cases, vote or unvote for these
based on clock count.
Change-Id: I0047e2cc689cc96b34992e5f6f59dae84d1d4e4b
Signed-off-by: Aditya Bavanari <abavanar@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>
Overflow/Underflow errors are observed sometimes while doing fifo write.
Add delay between writes to resolve error.
Change-Id: Id460e17753001a0dd52acd01a181d91132c36048
Signed-off-by: Vatsal Bucha <vbucha@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>
Headset is not detected if devnum 0 gets detached at bootup.
This is because on detach being called hw will mask interrupt
at slave side but will not unmask it afterwards.
Also device 0 is used only for discovery purpose and
interrupt shouldnt be masked if it detaches.
Change-Id: I78d47243ef67ea5ee1fe3badaec94e596bc8faf3
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Update offset1 of soundwire slave devices in a multi mic usecase
for proper audio capture from the soundwire mics.
Change-Id: If81ab1c2defeacb87b917fb6e3645c6df866f679
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>
Disable clock gating when soundwire is out of clock stop mode.
Change-Id: I97187fa2deed26fb3270abee1d05f679ace2c0c4
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>