In soundwire controller, bank switch happen twice
for a playback session with stereo speakers. Ensure
the setting of div2 applied to inactive bank before
bank switch occurs to avoid impact based on bank chosen.
Change-Id: I033b19e78309485ca9da85ec67b54409e6fe22cc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
When stereo playback start and temperature read
initiated at same time, one of speaker PA bits are
not set in particular race scenario. Handle the
broadcast check in soundwire framework to ensure
broadcast is disabled only when respective gr_sid
slave calls swr_remove_from_group.
CRs-Fixed: 2282230
Change-Id: I6f82a8c3c0f39dc20c1def09c1728ce4c26c2f5d
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
When temperature on a single wsa881x device is being read,
then soundwire master wakes up both wsa881x devices but
regcache_sync is happening only for one wsa881x device on
which the temperature is being read. This results in
audio playback mute after temperature read. Fix the
regcache sync during temperature read and playback usecase.
CRs-Fixed: 2282230
Change-Id: I856b96517c629ac685bbc25caabee841037106c8
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Replace pm resume and suspend inside interrupt
with clk enable and disable. Add clk ref count
to not have the clk disabled when in use.
CRs-Fixed: 2079739
Change-Id: I8f7f6e8e3c7cf8fd176a708ba5171a98546db929
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Increment swr device count before registration to
enable proper device detection in probe call, Decrement
the same count if the registration fails.
CRs-fixed: 2050725
Change-Id: If0133cbf751195542d9e1f16679cc63547b56778
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Move from master probe to the slave probe, the
device init functionality of swr slave. Provide
device remove functionality to remove a given
device from the master's list.
CRs-fixed: 2050710
Change-Id: Iee95c146d8b148e15dca5a8c10de65368cf3b55a
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
These are all driver changes needed for disablement of
CONFIG_CC_OPTIMIZE_FOR_SIZE. CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
is enabled by default once CONFIG_CC_OPTIMIZE_FOR_SIZE is disabled.
Change-Id: Ia46a1f24e8a082a29ea6151e41e6d3a85a05fd4f
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Sridhar Parasuram <sridhar@codeaurora.org>
In SDM660 WSA speaker using MSM over soundwire version,
observe high cold start latency. As interrupt is disabled,
broadcast ack is not received which results in 200ms higher
latency. Reduce latency impact by blocking only for 10ms
for MSM over soundwire version.
Change-Id: Ic0e659d7c443c1462aba4da2f8bf9471031d02d2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Soundwire does not have usecase with smart boost disabled. This
results in data port collisions when smart boost port is disabled
from mixer control which results in noise during audio playback.
Add usecase and port configurations with smart boost disabled.
Change-Id: I014e438b3e5810508f8b52716684cbb9608822ac
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Some of the usecases without compander and with
smart boost, VI sense are added in soundwire controller
driver.
Change-Id: Ia380ee6ad4584c29feb80fdc3b9247dd11e64a3e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
In soundwire read/write commands, register value is defined
as 8 bit but it is accessed through 32 bit pointer which
may cause out of boundary memory access. Fix this issue by
typecast appropriately.
BUG: KASan: out of bounds access in swrm_read+0x1dc/0x30c at
addr ffffffc089871880
Write of size 4 by task kworker/u8:5/236
==addr ffffffc089871880
[<ffffffc00081d174>] swrm_read+0x1d8/0x30c
[<ffffffc000819808>] swr_read+0x5c/0x74
[<ffffffc000741e58>] regmap_swr_read+0xd8/0x11c
[<ffffffc00073a350>] _regmap_raw_read+0x210/0x314
[<ffffffc00073a4b0>] _regmap_bus_read+0x5c/0xb4
[<ffffffc000739548>] _regmap_read+0xe0/0x1ec
[<ffffffc0007396b8>] regmap_read+0x64/0xa8
[<ffffffc000dc9dd4>] snd_soc_component_read+0x34/0x70
[<ffffffc000dc9f44>] snd_soc_read+0x6c/0x94
Memory state around the buggy address:
ffffffc089871780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffffffc089871800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
Change-Id: I3c56dffb4ca197e8fc23d54a44282a60254dd001
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
In soundwire control drivers, some pointers are not
set as NULL after the memory is freed, which will
leave many dangling pointers. Set them to NULL
explicitly to avoid potential risk.
CRs-Fixed: 997062
Change-Id: I18bd73397173187f87af28c78564835eed6d6a10
Signed-off-by: Meng Wang <mwang@codeaurora.org>
Copy speaker configuration from active to inactive bank
and perform bank switch operation while speaker channels
are getting enabled or disabled. This will make sure that
soundwire banks are always in sync and allow independent
control of speaker channels.
CRs-fixed: 1007465
Change-Id: Ic1653194c22fa5669b1c04fd9630158633fb00a5
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Handle soundwire slave devices ungroup in master controller.
Set the group device id to 0 when soundwire slave devices
request ungroup for independent control.
CRs-fixed: 1007465
Change-Id: I4f1b39dac949aa3f6aa3abb12ff0310fb0e98d1c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add soundwire API to remove the soundwire slave devices
from group so that the devices can be controlled
independently as required.
CRs-fixed: 1007465
Change-Id: Ibca3e33c0e85629ae5ce121e75526f4786d6408a
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add support for 48x2 frame structure in soundwire
so that when slave device data path is not enabled,
all control messaging will happen with 48x2 frame.
Soundwire slave devices send an explicit request to
enable data path which in turn change the frame
structure to 48x16.
CRs-fixed: 996586
Change-Id: Ia4329ac982eb2a29a2b925897cd87ca9711c30e3
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add soundwire API to control slave device data path
enable or disable. This gives slave device drivers
more flexibility for data path control during device
path enablement.
CRs-fixed: 996586
Change-Id: Ic0ab015098035418458a5ba7c2ffad9df20f933c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
There is a possible race condition that runtime suspend is being
called after device path bringup. To avoid this race condition,
add a mutex lock during device path bringup to serialize runtime
suspend and resume.
CRs-Fixed: 967442
Change-Id: I268a25b05799c66fc019e19e46939286e54fb514
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Set the group id to default when number of channels are less
than or equal to one. This change will configure the group
id correctly during device switch scenarios.
CRs-Fixed: 961023
Change-Id: I2cb4447b36fef111ed1f9b8991b3882b8d57f6a7
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Fix NULL pointer check while setting group ID to avoid
dereferening of the pointer.
CRs-Fixed: 971240
Change-Id: Ic5aae901244e7b2b96a894d265a6cc5c119f0367
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Slave synchronization is needed to sync frame shape consisting
of different ports with different sample rates. Change sets
the slave synchronization based on the frame shape.
Change-Id: Iae726555b3c158394662c590d1ebc781ff7f54f5
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Use soundwire broadcast command for configuration of all slave
devices simultaneously. This change improves latency during
slave devices configuration.
Change-Id: Ie2985e444e4aa1128856dc6ae372f8f4cca943de
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Devices with the same group id or broadcast command can be
configured simultaneously. This will help improve the latency
during device configuration. Add support to use group id
for slave device configuration.
Change-Id: I5e86e61a0b5223de6c6471f3f342fe1f387d81ef
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Soundwire hardware has two banks for configuring soundwire
slave ports. After playback is stopped, disable soundwire slave
ports in both banks to avoid any port collisions during the start
of next playback on other slave device.
Change-Id: I5cfd1d985a1ca5fd7b4020d7e14697642f207501
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add snapshot of audio codec drivers for MSM targets. The
code is migrated from msm-3.18 kernel at the below commit/AU level-
AU_LINUX_ANDROID_LA.HB.1.3.1.06.00.00.187.056
(e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1)
(Promotion of kernel.lnx.3.18-151201.)
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>