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>
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: I2c78500e83eca7864029f58cffa80f8648902fb2
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Increase retry count to check soundwire link status at bootup
inorder for probe to succeed. Handle error scenario if
soundwire probe fails to cleanup device properly.
Change-Id: I4a545530e68221a1f428e05aff3d8a93b1dacf84
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Add support to enable PCM data transfer through soundwire interface.
Change-Id: I9b162beb7fcdc6bbb90303acb77c350dbcf8c490
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update soundwire master and slave registers based on the hardware
version.
Change-Id: I8a27bdfbbff133569a7391af8adddadd804bd50f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Set the number of auto enumeration slaves to six.
Handle auto enumeration failed status.
Change-Id: I322e228ccee57c87840b585ab40947a0afd1b554
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update change for audio playback and record to work
on bengal target with wcd937x codec.
Change-Id: I2f781e2132b018995f30f4192efd08732196cd28
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
After master init sets COMP_CFG, wait for soundwire link
status to be connected for SWR version 1.6. Update wait
for soundwire link disconnect for all masters.
Change-Id: I0c0b34f225f88f1b3838b0aa653b57b2c7c0cc40
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
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>
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>