On receive of change enum slave status interrupt, update
slave host_irq bit for all attached slave dev_nums.
Change-Id: Idaad7a73a7ba9ab271f3fb6974f8d09df3f957b8
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Mask bus clash interrupt before clock stop mode to avoid
misfire of the interrupt. Clear and enable the interrupt
after clock is enabled.
Change-Id: I494073a668d298eef466c0f10ab202c3c69f9968
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>
Check comp status based on active and inactive request
and return once status met.
Change-Id: I75669558875d8ab6fc23a02c888e6083e15aee08
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
In soundwire version 1.6 as AHB HCLK and MCLK
are decoupled, need to wait for clock stop
entry and exit scenarios to execute before
any further transactions. Keep monitor on
COMP status accordingly.
Change-Id: I03204526d7dd634a79193b55c6744edca8664d93
Signed-off-by: Sudheer Papothi <spapothi@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>
when triggering SSR during speaker playback and insert headset,
headset insertion/removal IRQ don't reach soundwire master side.
Remove soundwire state check in interrupt handler to resolve headset
detection issue.
Change-Id: If6ff9aaaab9513f713d6106913dfccbc0e75e385
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Switch b/w 44.1Khz to 48Khz and vice versa,mux switch on
HPH path is unable to take place.Add sufficient delay to
happen clock release.
Change-Id: I80c40772c03bbbd3a57a4e6de270de4779f882a7
Signed-off-by: Prasad Kumpatla <nkumpat@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>
exit irq handler gracefully if soundwire clock request
fails, so that soundwire registers are not accessed
without clock.
Change-Id: Ic2c9162e49901c7d5c876115f386d0a5a00fd691
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Changing auto suspend timer to default value without checking module params
is causing audio touch tone to hold CX out of power collapse longer.
Instead set another variable to change autosuspend delay during
swr clk request failed.
Change-Id: Ia85c4ebeea020221c8f385006543a95c69d9124e
Signed-off-by: Vatsal Bucha <vbucha@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>
In register show function, when snprintf returns a negative value
out of bounds access occurs while copying the data to user.
Add return value check on snprintf before copy_to_user
to fix this.
Change-Id: I96bfa64b1603c966852c1d4d4a12651664f17aed
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Avoid SSR state, and do only clock-stop-resume to reset master when
switching between 44.1 and 48k to avoid redundant re-enumeration.
Change-Id: Iaa955c4ceb75f30c68106468676ddb2551537de4
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Sometimes, headset is not detected after pdr during music playback.
This is because enable_irq does not get called as master remains
in suspend state. Decrease auto suspend timer to 1 to fix the issue.
Change-Id: I8cea3e74487977af801dccac7e4f873831c26264
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Add support to register/deregister for event listener to listen to
headset interrupt events during low power island mode.
Change-Id: I9d05261003ef9e4783e03b3acb529c864c07cbec
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Unlock mutex for soundwire bank switch to process the
interrupt before clock pause and request for clock switch
to switch the soundwire clock source.
Change-Id: Idea4306a0e326864431e7cf956044383bf1790db
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update pr_err to dev_err to indicate which device has
clock mismatch.
Change-Id: Icf842ed63aa0a01ace0ff461f8c05194a0e25f92
Signed-off-by: Meng Wang <mengw@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>
Add support to dump soundwire bulk register writes to
analyze port configuration on both soundwire master and
soundwire slave devices.
Change-Id: Ie02b2a0ba40aa5a0b4243022e439e1b545688143
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Existing delay for soundwire to auto suspend is 3 secs. Reduce
the delay to 1 sec to improve the power numbers.
Change-Id: I0c13439567eb73b80897f4cf1bbcfb1eded94a9c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Before proceeding with handling soundwire pm functions
check return value of vote for LPASS HW core and handle
error scenarios.
Change-Id: I4f48c93919a75ebbb072123a12306137118699d0
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Resource lock should not be held while doing bank
switch as bank switch requires interrupt handling
which needs access to the resource lock.
Change-Id: Ic17178c7e6f16a7db91da6577ed2ce70c9c9f084
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
skip port disable when master is already down to avoid
queuing commands to master which is already down due to ssr/pdr.
Change-Id: I7fadc479784feb0fd8afa229599eb217bb579ea2
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Exposure of driver bind/unbind to userspace via sysfs may
lead to unexpected behavior.
Hide bind and unbind by driver attribute.
Change-Id: I20d6ee653bcc16af15d6368664aaf240c6645cd0
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Before proceeding with handling soundwire interrupt check
return value of vote for LPASS HW core and handle
error scenarios.
Change-Id: I0f19a5ddb0af82f33a8d004d008eda9baa40c036
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Suppress the errors from the soundwire master runtime suspend
and runtime resume, if the soundwire slave devices does not
implement the functionality, that avoids pm runtime calling
the runtime functions.
Change-Id: I513a37f37e349a0c435295056df8625f284e13e6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>