ADSP app variables are not initialized in all cases (like at APM
output pin) causing NULL pointer access to app->override_freq_work
NULL check fixes this; override_freq_work will get called at widget
ON event
Bug 200245012
Change-Id: Ie6161c0247d8b15db88bdef706ab6c3b472fa977
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1244336
(cherry picked from commit 6f6c38a0413b20111ff95d3e0d26c631f0a7a639)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1252706
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Added checks whether plugins within and across APM are
connected or not,before sending any control message to adsp
for that plugin.
Bug 1797920
Change-Id: I880d129bac1ec4a885bb60ef6e5eb3d0bb1c8afb
Signed-off-by: sdash <sdash@nvidia.com>
Reviewed-on: http://git-master/r/1203078
(cherry picked from commit 05b04db52c0d35b78291dad8ce107481a78a3aef)
Reviewed-on: http://git-master/r/1216725
(cherry picked from commit 115d61defe5967c6eb66ae0ddcaf92ab705d8d6a)
Reviewed-on: http://git-master/r/1249615
GVS: Gerrit_Virtual_Submit
Tested-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Implemented tegra-alt adsp driver to be used as
common adsp driver for both native and hypervisor
mode.
Added ADSP DAI links in tegra virt alt machine
driver
ADMA Channel 16 onwards to be used for ADSP in
case of hypervisor mode
Added support for sending IVC messages from
tegra-virt-alt adsp driver for admaif cif settings,
and start/stop of playback/capture
Disabled the registration of AMC error interrupt
in case of hypervisor mode
Jira EMA-27
Jira EMA-29
Bug 200172732
Bug 200221932
Change-Id: I9973bd9fcc358786f4d3e9c7eae49def63747e16
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Signed-off-by: Sidharth <svarier@nvidia.com>
Reviewed-on: http://git-master/r/1159268
(cherry picked from commit 49072c9ec35e5b65f41abc8900c402794982a0c8)
Reviewed-on: http://git-master/r/1243043
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Currently adsp pcm device allows only S16_LE. For rest of format
it throws not supported error. Change will allow playback and
capture for S8/S24/S32 formats also.
However machine driver should make sure same format info is
configured for ADSP-ADMAIFx and ADMAIFx dai-links.
Bug 1756112
Change-Id: Iac76d022adc57ea88e6208a66086fdb29bff8c66
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1156127
(cherry picked from commit 39bc390bce81ea8538b3bca0116e3e7c4fa2745e)
Reviewed-on: http://git-master/r/1238420
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
As adma plugin allocates static ARAM memory, having single plugin for both
rx and tx will be waste of ARAM memory, as MEM to AHUB don't need to allocate
memory during plugin loading.
Bug 200220099
Change-Id: I5d713ebd5718e751d341d8d64889a36327277b1c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1184236
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shashank Verma <shashankv@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
These warnings do not cause any issue.
Making them as dev_info.
Bug 1774835
Change-Id: I04357d9465d0113d262f9d1034233ce59b82ee2a
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1201945
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
The adsp audio driver is not hot-pluggable at the moment.
It might cause issues if the driver has to be loaded or
unloaded. The remove() callback is disabled until we have
proper support for hot-plug.
Bug 1779074
Change-Id: I530d50bc1cad3917c712a4322f27256166422bd5
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1168492
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Driver binding/unbinding is causing crash on the driver. The bind/unbind
options are supressed from the driver until there is plan to support this,
since it requires to take care of lot of other dependencies.
Bug 1779074
Change-Id: I61b41d425dac21b1bae1a21d36d0ca22dd4c7c20
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1166724
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Memory for widget names is allocated statically by default widget
name "PLUGINx". If a plugin has longer widget name, then it will
corrupt the widget name memory and tegra210_adsp_routes. This
creates issue in DAPM and playback fails.
Use long name as default plugin name: PLUGINx-PLACE-HOLDER to have
bigger memory. Also add a length check on plugin's widget name.
Bug 200207626
Change-Id: I2442b07492a795ed120766eaee3a0083f80f6cf3
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1164763
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Currently adsp_audio rely on xbar device to keep clock enable.
For some of corner cases it is observed that xbar devices gets to
suspend state leading to disabling of ahub clock, however nvadma
still trying to program adma. This leads to adsp crash.
This change adds support for adsp_audio to enable and disable
clocks as per its runtime_resume and runtime_suspend calls.
Bug 1756112
Change-Id: I5697853d901eed1059bd1ce29099a74cf62d46a3
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1149568
(cherry picked from commit 17d84bd026751e1bc380d69bd89c4a034d9398fc)
Reviewed-on: http://git-master/r/1155917
(cherry picked from commit 0ef2ab54b1da6a9573c863ac8e60e7192ae3b2d6)
Reviewed-on: http://git-master/r/1163157
GVS: Gerrit_Virtual_Submit
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
This commit has changes needed for audio on kernel 4.4
- select SND_DYNAMIC_MINORS for tegra-alt
- use snd_soc_new_compress callback function in snd_soc_dai_driver
instead of setting compress_dai = 1
- use snd_soc_dapm_to_codec() to access codec from widget
Bug 200193757
Change-Id: I1744ca93786086691cb6eabdde33125a995de9e7
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1158639
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Fixed following sparse warning by making local
function static:
$TOP/kernel-3.18/sound/soc/tegra-alt/tegra210_adsp_alt.c:2846:5:
warning: symbol 'tegra210_adsp_tlv_callback' was not declared.
Should it be static?
Bug 200088648
Change-Id: Ia4d78e297da3aa3bd9fe9effd64ddec30c2b67fc
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/1131635
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
This reverts commit f75f4be594f2182d6c422d94fd11f88211b58ed0.
Original change was reverted because dependency was not
integrated from main to dev-kernel and original change
was causing GVS failures. Now putting it back.
Bug 1723185
Change-Id: Ifffcfb019237b448ba6ccd9bcae0423d36eb788e
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1127945
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Instead of ape specific power domain apis use generic tegra
power domain APIs to add/remove devices to/from ape power domain
mentioned in DT. These apis internally set up tegra pd ops.
Bug 200178663
Change-Id: Ifd7c73a44d0d7b729f593e6e3047b56b7f773be4
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/1028814
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.
Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
sound/.
JIRA TPM-704
Change-Id: I5807fa8d35b3fbbd1afdb69d2dbba760abb80e27
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Request acknowledge for params sent via mixer controls. This
ensures parameter messages are processed before suspend.
Use a default message handler to flag completion event when APM
is used in cases other than offload and PCM streams.
Send all messages (connect, io buffer etc.) immediately.
If message queue is full, then trigger APM via maibox interrupt,
wait and attempt to queue again.
Fix check for wait timeout.
Print error if message queues are not empty when suspending.
Bug 200149702
Change-Id: Iddb1d8d62c659949294cfe258f88bad22e28cc92
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1112097
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
"Min ADSP Clock" for the APM is set at the widget ON event, which
sometimes occurs immediately on closing the APM connections (like for
SPKPROT); allowing "Min ADSP Clock" setting only if APM is initialized
causes this to be missed at times
Allowing to set "Min ADSP Clock" before APM is initialized will ensure
that it's always available at the subsequent widget event
Bug 200170455
Change-Id: I5500484f42a23abb290431a8e329e57e741a0e14
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1027039
(cherry picked from commit a3ceb08c60ecb398a192dc607c1587b797ca79b7)
Reviewed-on: http://git-master/r/1029374
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
APM input mode can be set to PUSH or PULL.
In PUSH mode, APM blocks if there is no input available. Usually
a continuous mode ADMA sends interrupt when input data is available.
In PULL mode, APM blocks only if there is no input available and
a input fetch request is pending. Usually a one shot mode ADMA
fetches input data when required and signals event to wake up APM.
Control "APMx Input Mode" is provided to set input mode.
Default mode remains PUSH.
Bug 200150727
Change-Id: I10efd78ab593beb2e8a4b999dfa088e48f1e965b
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1017553
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Support adma as a part iso client to calculate the adma bandwidth based
on the usecase on both cpu and adsp side. This will help the iso manager
to alter the emc frequency.
Bug 1675078
Change-Id: I301aa710929665ea56f8183de8d22851913afa9c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/924061
Reviewed-by: Ayoosh Bansal <ayooshb@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Fix the error check in function tegra210_adsp_app_init(), as return value
is from ERR_PTR this needs to be checked with IS_ERR macro.
Bug 200154983
Change-Id: I951cccf6a65bdfd829da1bd79e2622a40ecf30cd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/926309
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Add mechanism to wait for ADSP acknowledgement.
ACK is requested when resetting to ensure that ADSP is
suspended only after APM stop processing is complete.
This prevents case of ADMA not getting stopped/reset
before suspend.
Bug 200130757
Change-Id: Ia86a31c996d40192210837e61aa95d8f920ee7f5
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/772220
(cherry picked from commit 72a04194685b299a959ecf64b92ba7f160e197f0)
Reviewed-on: http://git-master/r/795560
(cherry picked from commit 6a4a2211bfd1561d96ace832e1b45bee23d9ef3d)
Reviewed-on: http://git-master/r/799367
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Use nvadsp_mbox_send() to send mailbox message. This allows
blocking functionality with time out when sending messages.
Add runtime PM get/put when sending APM messages from widget
events as it was seen that this function is called even when
runtime resume had failed in one of the error cases.
Bug 200123443
Change-Id: I29e0860eadc73af2f32af58c1ca614806741709b
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/779898
(cherry picked from commit 7cb1c2b7b51010ab97e4125825f4658b32479487)
Reviewed-on: http://git-master/r/785351
(cherry picked from commit a150b9f3fc50ed1f6c0df71cad02a8a24b1a866f)
Reviewed-on: http://git-master/r/791628
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Add pm_runtime_get* failure checks. This also captures any
failures in starting ADSPOS.
Remove redundant pm_runtime_* calls from DAPM widget events.
These are not needed as driver's runtime resume and suspend
functions are called before starting and after stoppping the
playback.
Bug 200123443
Change-Id: I2c1f8fcff892634d4129e6cb08d6e21a7d63fdcd
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/746123
(cherry picked from commit 093dc626c51467f3f85d10c3deb97df861ff85dc)
Reviewed-on: http://git-master/r/784832
(cherry picked from commit c5a457bce02fd9bcc5c9e7e89fe4baee7189a075)
Reviewed-on: http://git-master/r/791043
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Certain cases like speaker protection which involve
real-time input require sudden increase in ADSP load.
ADSP DFS fails to cater such sudden increase in load
without compromising power.
Per APM control is added to set min ADSP clock when
APM is running. Min clock is restored when APM stops.
Bug 200126105
Bug 200126363
Change-Id: Icff8cee0b464f9621db0f8ba506d2e3ba307c683
(cherry picked from commit cb5c4c718ea2e8a26126cf70da2c44e26673d531)
Reviewed-on: http://git-master/r/779169
(cherry picked from commit 07e0d3265656ec0a263d9b55e2c9c51d72dc8d17)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/781741
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
suspend/resume function is used when CONFIG_PM_RUNTIME is defined, if
this is not defined then compiler errors about unused-function.
put suspend/resume function under #ifdef CONFIG_PM_RUNTIME.
Change-Id: Ibad9d7a0528ed5be536e987075cbc26a71487d56
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/766222
Reviewed-on: http://git-master/r/769291
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Tested-by: Sumit Bhattacharya <sumitb@nvidia.com>
Add tegra_pd_ops for ape and adsp power domains so
that driver's *runtime_suspend() and *runtime_resume()
routines are called as part of stop_dev() and
start_dev() and not at the last when power domain is
being powered off.
Remove power down delay for APE power domain.
Bug 200090996
Change-Id: Ie7d69964d647b0392728b9f5b147818f4a525928
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/735632
(cherry picked from commit 37ca24d340ddf0b70b406d04bf98ee686ad280a7)
Reviewed-on: http://git-master/r/752259
(cherry picked from commit 0ca955773e6cbd942c2de6f8ed28673ef34b5bbf)
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/766594
Existing app deinit code is setting info and other pointers
to NULL, but not calling nvadsp_app_deinit() to close instance
on ADSP. Due to this multiple instances app get created on ADSP
and causing memory leaks.
Current usecases use static paths so app_deinit functionality
is not needed and adds overhead of freeing and allocating apps
everytime. So making tegra210_adsp_app_deinit() a empty function
for now. Proper app deinit functionality will be added in future
if needed.
Bug 200106688
Change-Id: I2b57efa6fa57253ee249c3dc3c43b5843109e2ae
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/744945
(cherry picked from commit ad17bed71e23a978202de7f7a695a4c4cede5dc7)
Reviewed-on: http://git-master/r/747320
During device switch, runtime count becomes zero and
runtime_suspend gets called which suspends ADSP OS.
ADSP OS is resume immediately when resuming playback
on new device. ADSP OS suspend/resume can happen while
ADMA is running, which disturbs SW/HW sync causing
noisy output.
Prevent ADSP OS suspend as long as compress stream
is open by acquiring a runtime get() from stream open
and releasing it in stream free.
Bug 200100093
Change-Id: Id0da81c16efa3682131e98f6132aa02c8e7cfcab
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/742105
(cherry picked from commit 6f11140bb41166a9797b2d7fe3bfb1610b55b513)
Reviewed-on: http://git-master/r/747319
Change merged from Kernel 3.10 is not
compatible with Kernel 3.18.
Make changes as per kernel 3.18 to fix the
crash.
Bug 1653770
Change-Id: I8b9e416f9dd4a905a465f6bd06732a2ec782995a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/755197
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>