Commit Graph

215 Commits

Author SHA1 Message Date
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
Aditya Bavanari
9f599b4a78 soc: Fix out of bounds access in register show function
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>
2019-08-27 22:18:41 +05:30
qctecmdr
ab0a45b0db Merge "soc: swr: avoid SSR state when switching between 44.1 and 48k family" 2019-08-20 00:02:12 -07:00
Karthikeyan Mani
5d52dd8613 soc: swr-mstr: Reduce swr register write sleep timings
Reduce swr bulk write and swr command fifo write sleeps
to reach coldstart latency numbers.

Change-Id: I52f2868a488e167b0a0f617b6af3e79cbf6f7eea
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-08-15 17:11:34 -07:00
Ramprasad Katkam
2e85a54634 soc: swr: avoid SSR state when switching between 44.1 and 48k family
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>
2019-08-12 01:31:48 -07:00
Vatsal Bucha
63b193fcd0 soc: swr-mstr: Fix headset detection after pdr
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>
2019-08-12 13:22:45 +05:30
Sudheer Papothi
72ee264c0c SoC: soundwire: Add support to register for event listener
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>
2019-08-08 05:22:06 +05:30
qctecmdr
863ab8865a Merge "soc: soundwire: Avoid wakeup after clock pause" 2019-07-29 02:33:32 -07:00
Sudheer Papothi
06f43418bf soc: soundwire: Avoid wakeup after clock pause
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>
2019-07-24 02:43:30 +05:30
Sudheer Papothi
07d5afc4cb soc: soundwire: Enable soundwire slave host irq
soundwire slave devices gets reset resulting in setting
host irq to default state. Enable soundwire slave host irq
to process slave interrupts.

Change-Id: I49c3482a22b89fe2a28768edcf7d1e19ba0b978f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-07-17 06:25:45 +05:30
Meng Wang
8c60bb5664 soc: soundwire: update log type for soundwire
Update pr_err to dev_err to indicate which device has
clock mismatch.

Change-Id: Icf842ed63aa0a01ace0ff461f8c05194a0e25f92
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-06-29 09:20:50 -07:00
Sudheer Papothi
384addde09 soc: soundwire: request lpass core and audio votes
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>
2019-06-21 15:24:16 -07:00
qctecmdr
45d02bcf0b Merge "soc: soundwire: reduce the auto suspend delay to one second" 2019-06-21 03:39:03 -07:00
Sudheer Papothi
0016db19a7 soc: soundwire: Add support to dump bulk register writes
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>
2019-06-18 00:44:30 -07:00
qctecmdr
e7afbdeeb6 Merge "soundwire: exit from pm function for LPASS HW Core fails" 2019-06-17 20:30:33 -07:00
qctecmdr
295db4585f Merge "soc: swr-mstr: skip port disable when master is down" 2019-06-10 05:57:59 -07:00
Sudheer Papothi
3590b312ba soc: soundwire: reduce the auto suspend delay to one second
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>
2019-06-04 23:51:30 +05:30
Karthikeyan Mani
4e7401aff9 soundwire: exit from pm function for LPASS HW Core fails
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>
2019-06-03 10:52:46 -07:00
Karthikeyan Mani
f68219039a soc: swr: Release resource lock when not needed
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>
2019-05-28 14:15:12 -07:00
Ramprasad Katkam
979b7c9814 soc: swr-mstr: skip port disable when master is down
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>
2019-05-28 21:43:05 +05:30
qctecmdr
34b7d3b2fd Merge "ASoC: hide bind/unbind in sysfs" 2019-05-21 20:33:23 -07:00
qctecmdr
4a0cf5086c Merge "asoc: Ratelimit error logs" 2019-05-18 03:03:10 -07:00
qctecmdr
8105363ccb Merge "soundwire: return error if vote for LPASS HW Core fails" 2019-05-18 02:55:52 -07:00
Xiaojun Sang
53cd13a1ab ASoC: hide bind/unbind in sysfs
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>
2019-05-17 15:00:33 +08:00
Ramprasad Katkam
14efed6eb7 asoc: Ratelimit error logs
Ratelimit error logs to avoid excessive logging during
ssr/pdr.

Change-Id: Icdc9823cef5b070ed70cdd002bb3cd00d482a869
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-05-14 17:42:22 +08:00
qctecmdr
e7072b0ae4 Merge "asoc: codecs: Bail out from clock enable routine during SSR" 2019-05-07 22:35:09 -07:00
Karthikeyan Mani
035c50b0bd soundwire: return error if vote for LPASS HW Core fails
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>
2019-05-02 14:09:35 -07:00
Sudheer Papothi
79c9075948 soundwire: Suppress errors due to unsupported slave functions
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>
2019-05-01 05:48:39 +05:30
Aditya Bavanari
f4a471de1a asoc: codecs: Bail out from clock enable routine during SSR
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>
2019-04-26 14:13:26 +08:00
Ramprasad Katkam
2586a4b195 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: Ibde5dacf38e78ab19afb6f0e91ffac81f6c22813
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-04-15 02:52:17 -07:00
qctecmdr
553c49490a Merge "soundwire: Vote for LPASS HW Core before soundwire register access" 2019-04-14 23:16:15 -07:00
Sudheer Papothi
66d6fd1364 soundwire: Vote for LPASS HW Core before soundwire register access
Vote for LPASS HW core before soundwire register access to avoid
register access violations.

Change-Id: Ie7ff73bbab64825bf07736f11ef9685e732fc8ae
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-04-05 19:16:37 +05:30
Vatsal Bucha
df38c3eb18 soc: swr: Add wakeup source for swr device
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>
2019-04-02 12:29:20 +05:30