summaryrefslogtreecommitdiff
path: root/drivers/soundwire/swr-wcd-ctrl.c
AgeCommit message (Collapse)Author
2018-12-04soc: swr-wcd: Apply div2 setting on slave side before bank switchLaxminath Kasam
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>
2018-09-20soc: swr-wcd-ctrl: Fix wsa mute issue for stereo playbackLaxminath Kasam
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>
2017-08-31drivers: swr-wcd-ctrl: Fix wsa mute at bootKarthikeyan Mani
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>
2017-06-15Merge "soundwire: Remove startup from swr_driver structure"Linux Build Service Account
2017-06-07soundwire: Move device init functionality from masterKarthikeyan Mani
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>
2017-05-31drivers: Warning fixes to disable CC_OPTIMIZE_FOR_SIZEPrasad Sodagudi
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>
2017-03-22ASoC: swr-wcd: Reduce latency for cold start on speakerLaxminath Kasam
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>
2017-02-01soundwire: Add support to disable smart boost data portSudheer Papothi
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>
2016-09-21soundwire: Add support for usecases without companderLaxminath Kasam
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>
2016-08-16Merge "ASoC: soundwire: fix out of boundary access issues"Linux Build Service Account
2016-08-14ASoC: soundwire: fix out of boundary access issuesVidyakumar Athota
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>
2016-08-10swr-wcd-ctrl: set pointer to null after kfreeMeng Wang
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>
2016-06-13soundwire: Fix NULL pointer dereferencePhani Kumar Uppalapati
Fix NULL pointer dereference in soundwire master controller driver. CRs-fixed: 1018329 Change-Id: I716401adda144ac0c03520f747694eaa50ea8e51 Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-05-20swr-wcd-ctrl: Ensure soundwire banks are always in syncPhani Kumar Uppalapati
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>
2016-05-20swr-wcd-ctrl: Handle soundwire slave device ungroupPhani Kumar Uppalapati
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>
2016-05-20soundwire: Add support for 48x2 frame structurePhani Kumar Uppalapati
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>
2016-03-23soundwire: Avoid runtime suspend after device path bringupSudheer Papothi
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>
2016-03-23soundwire: set the group id based on number of channelsSudheer Papothi
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>
2016-03-23soundwire: Add slave synchronization configurationSudheer Papothi
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>
2016-03-23soundwire: Use broadcast command for device configurationSudheer Papothi
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>
2016-03-23soundwire: Disable ports in both banks after playback usecaseSudheer Papothi
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>
2016-03-23ASoC: Audio codec driver changes for kernel 4.4Sudheer Papothi
Audio codec driver changes for kernel 4.4. Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23ASoC: wcd: Add Audio codec drivers for MSM targetsSudheer Papothi
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>