Commit Graph

197 Commits

Author SHA1 Message Date
Meng Wang
b72b79a6b0 soc: swr: enable PCM IN/OUT when using pcm interface
Enable PCM IN/OUT when using pcm interface.

Change-Id: Iff7b234a6d188802619cff112fa9bb54804ac77d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-04-01 14:47:27 +08:00
qctecmdr
2d2ae53b05 Merge "soc: swr-mstr: Fix headset not detetcted issue on devnum 0 detached" 2020-03-25 09:38:23 -07:00
Vatsal Bucha
7da41c372b soc: swr-mstr: Fix headset not detetcted issue on devnum 0 detached
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>
2020-03-24 00:39:07 -07:00
Sudheer Papothi
f3bc7e9e85 soc: soundwire: Update frame configuration for multi slave
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>
2020-03-24 05:03:47 +05:30
Vignesh Kulothungan
a4962dc546 soundwire: add support to disable dynamic port map
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>
2020-03-17 11:18:18 -07:00
qctecmdr
732d4331bc Merge "soc: soundwire: Update bus clock frequency based on usecase" 2020-02-20 22:11:07 -08:00
qctecmdr
ecae50be17 Merge "soc: swr-mstr: reset slave pending irq flag before every call" 2020-02-17 02:58:02 -08:00
qctecmdr
5f0784fece Merge "soc: swr-ctrl: increase num retry count for soundwire link status" 2020-02-17 02:58:02 -08:00
Sudheer Papothi
cdeb593d01 soc: soundwire: Update bus clock frequency based on usecase
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>
2020-02-15 00:32:43 +05:30
Sudheer Papothi
1c11c5cf73 soc: soundwire: Disable clock gating when soundwire is out of clock stop
Disable clock gating when soundwire is out of clock stop mode.

Change-Id: I97187fa2deed26fb3270abee1d05f679ace2c0c4
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-02-06 23:49:10 -08:00
Meng Wang
935e7fb95e soc: swr-mstr: reset slave pending irq flag before every call
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>
2020-02-04 18:36:14 -08:00
Laxminath Kasam
33b343b23d soc: swr-ctrl: increase num retry count for soundwire link status
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>
2020-02-04 18:35:11 -08:00
Sudheer Papothi
669089fdbd soc: soundwire: Handle soundwire slave reset gracefully
If soundwire slave does not implement reset functionality, handle
soundwire slave reset error gracefully in soundwire master driver.

Change-Id: I24f34d3e8665c187c4ac9dd2bc8acb2b39ad2df6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-01-29 23:06:40 -08:00
Vignesh Kulothungan
61b2ca830f soc: swr: update SWRM_MCP_FRAME_CTRL_BANK_ADDR
Update SWRM_MCP_FRAME_CTRL_BANK_ADDR to SWRM_MCP_FRAME_CTRL_BANK.

Change-Id: I092effc8f620aa29cc4e2b48fe977991caae13e6
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-12-27 11:19:06 -08:00
Sudheer Papothi
11d5299f26 soc: soundwire: Add support for PCM data type
Add support to enable PCM data transfer through soundwire interface.

Change-Id: I9b162beb7fcdc6bbb90303acb77c350dbcf8c490
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-12-27 11:15:20 -08:00
Sudheer Papothi
9d6350f7f0 soc: swr: update soundwire master and slave registers
Update soundwire master and slave registers based on the hardware
version.

Change-Id: I8a27bdfbbff133569a7391af8adddadd804bd50f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-12-27 11:14:40 -08:00
Sudheer Papothi
087a9f7661 soc:soundwire: soundwire master updates
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>
2019-12-27 11:14:16 -08:00
qctecmdr
fec5f13aea Merge "asoc: Audio bringup changes for bengal" 2019-12-05 06:57:05 -08:00
qctecmdr
7cbd8f97f1 Merge "soc: soundwire: Update ssp period for fractional sample rates" 2019-12-05 06:56:21 -08:00
Laxminath Kasam
696b14bfa2 asoc: Audio bringup changes for bengal
Audio bringup fixes for bengal target.

Change-Id: Ic79c478fe3c6b80eeb48aa2bcf1887c8dd8f5edc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-12-04 15:07:29 +05:30
Laxminath Kasam
4696fffa8c asoc: Audio bringup changes for bengal
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>
2019-11-27 17:32:41 +05:30
Linux Build Service Account
e96eb4e5b2 Merge "soc: soundwire: Update check link status for master init" into audio-drivers.lnx.4.0 2019-11-24 23:57:22 -08:00
Linux Build Service Account
4c9e23db08 Merge "soc: soundwire: Set slave host_irq interrupt mask for all slaves" into audio-drivers.lnx.4.0 2019-11-24 23:57:13 -08:00
qctecmdr
4faacac8ab Merge "soc: soundwire: Avoid bus clash during clock stop" 2019-11-21 08:43:06 -08:00
qctecmdr
458e1f1e14 Merge "soc: swr-mstr: Fix unbalanced enable for wakeup irq" 2019-11-21 08:39:07 -08:00
Laxminath Kasam
cafe073cf1 soc: soundwire: Update check link status for master init
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>
2019-11-21 12:09:17 +05:30
Sudheer Papothi
8a8b12b245 soc: soundwire: Update ssp period for fractional sample rates
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>
2019-11-21 11:07:38 +05:30
qctecmdr
75d847e3da Merge "soc: soundwire: Update soundwire register access sequence" 2019-11-20 06:47:29 -08:00
Laxminath Kasam
44cedb8f7d soc: soundwire: Set slave host_irq interrupt mask for all slaves
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>
2019-11-20 17:37:23 +05:30
Sudheer Papothi
55fa597e30 soc: soundwire: Avoid bus clash during clock stop
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>
2019-11-18 15:21:16 +05:30
Vatsal Bucha
8bcaeab611 soc: swr-mstr: Fix unbalanced enable for wakeup irq
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>
2019-11-18 15:16:03 +05:30
Laxminath Kasam
09819e980c soc: soundwire: Update comp status check for SWR version 1.6
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>
2019-11-18 14:40:44 +05:30
Sudheer Papothi
921b8657ca soc: soundwire: Update soundwire register access sequence
Update soundwire register access sequence based on the
hardware version.

Change-Id: I6dbdd884f87b62fce4e9f7074c6ccdcdac8456b8
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-11-18 12:11:11 +05:30
Laxminath Kasam
e229197566 soc: soundwire: Handle command response sequence
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>
2019-11-08 14:53:28 +05:30
qctecmdr
137583f46f Merge "soc: soundwire: change ssp period based on frame shape" 2019-10-30 10:26:57 -07:00
Sudheer Papothi
ac0ae1c298 soc: soundwire: change ssp period based on frame shape
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>
2019-10-25 10:16:33 +05:30
qctecmdr
f277ee3154 Merge "soc: swr-mstr: remove soundwire state check in interrupt handler" 2019-10-23 05:21:31 -07:00
qctecmdr
cb0223f0d4 Merge "soc: soundwire: Add delay to over come race condition" 2019-10-23 04:47:27 -07:00
Meng Wang
117ebd0932 soc: swr-mstr: remove soundwire state check in interrupt handler
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>
2019-10-16 00:01:47 -07:00
Prasad Kumpatla
386df4e611 soc: soundwire: Add delay to over come race condition
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>
2019-10-14 17:40:53 +05:30
Laxminath Kasam
c7bfab9706 soc: soundwire: Update hctl gate setting for SWR version 1.6
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>
2019-10-09 22:38:45 +05:30
Karthikeyan Mani
4bee1db049 soc: swr-mstr: exit irq handler if clock req fails
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>
2019-09-24 12:19:35 -07:00
Vatsal Bucha
e50b500f6e ASoc: swr-mstr: Avoid changing auto suspend timer value in runtime resume
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>
2019-09-19 03:06:58 -07:00
qctecmdr
de5b3da5ca Merge "SoC: soundwire: Update debug soundwire master read/write functions" 2019-09-17 00:53:25 -07:00
Karthikeyan Mani
1d750fe50f soc: swr-mstr: Vote for core vote before clock request
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>
2019-09-11 11:22:13 -07:00
qctecmdr
d8a58c6c05 Merge "soc: swr-mstr: Reduce swr register write sleep timings" 2019-09-04 03:30:25 -07:00
qctecmdr
d7c16ff4f4 Merge "soc: Fix out of bounds access in register show function" 2019-09-04 03:24:02 -07:00
qctecmdr
8ff9993fa0 Merge "SoC: soundwire: Add support to register for event listener" 2019-09-04 03:21:31 -07:00
qctecmdr
23104da29d Merge "soc: swr-mstr: reset slave pending irq flag before every call" 2019-09-04 03:18:36 -07:00
Sudheer Papothi
96c842a261 SoC: soundwire: Update debug soundwire master read/write functions
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>
2019-09-02 11:11:50 +05:30