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>
Adding the machine driver to support rt565x family of
audio codecs from realtek.
1) The button detection feature is pending which will
be enabled going ahead.
2) The sound card will be registered irrespective of
whether the audio codec is present or not. This is
required since all jetson-cv boards wont have audio
codec connected.
Bug 200118114
Change-Id: I7b9fb236b1e908ad9da73909c7739b9e45a3cee6
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/773940
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
The driver is received from Realtek.
Following changes have been made,
1) Disable button detection IRQ. Required for now to
allow headset/headphone detection to work consistently
2) Introduced a delay of 20ms in rt5659_headset_detect()
(suggested by realtek)
Note: Will update the new version of the driver for latest
kernel once received and tested
Bug 200118114
Change-Id: If5b3e1d25a3815f2cb67edacecddab4f939c262b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/773939
Reviewed-by: Bharat Nihalani <bnihalani@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
- Add mixer control for SFC init. This should be called ONLY when
there is no data flow happening through SFC.
- Use actual rates instead of indices/strings when setting rates
Bug 200082413
Bug 200086391
Bug 200100093
Change-Id: I7969f91e8371466b0e9c2dc0d4433803fb0a558c
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/746033
(cherry picked from commit c3c88d0612affa12b537233d66e480ec743001a9)
Reviewed-on: http://git-master/r/751860
a) add sfc coeff. RAM tables for 48 to 192, 48 to 96
sample rate.
b) add mixer control to change SFC input bit foramt.
c) add mixer control to change codec format and
non pcm link format for HRA usecases to support.
bug 200086376
Change-Id: Id82fc6190ed5978102a3afc290e877f9a772734d
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/738977
(cherry picked from commit a970151270e1200779141464e19d8fe1ba0028d0)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/751859
Add soft reset support for changing the SFC params
dynamically after every stream.
Make changes in machine driver to pick the clk as
per the codec-x-rate set. Configure I2S as per the
codec-x-rate set.
SFC input rate was taken from hw_params which results
in input rate same as stream sample rate. Also the
SFC output rate is set to stream sample rate via mixer
control. This results in same input and output rates
and SFC is put into bypass mode when used in capture
stream path and no rate conversion happens. Fix this
by adding "SFCx input rate" control to allow setting
input rate different than stream rate.
Bug 200097141
Bug 200056741
Change-Id: I294c484050cfa636c8173c5837feb4461ada2ddb
Signed-off-by: Deepa Madiregama <dmadiregama@nvidia.com>
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/730685
(cherry picked from commit a2ee28c6ba423751b8bbc0743a645241391823b7)
Reviewed-on: http://git-master/r/751858
This change will add the alsa controls to set
SFC i/o rates. SFC from 44.1 to 48 Khz is validated
using this change.
Find below the list of added alsa controls :-
1)"SFC# output rate"
2)"codec-x rate"
'#' = 1,2,3,4 for the respective SFC used.
Bug 200090046
Change-Id: Ibbbbcec9b52d5a36b188131fe2cd620e9f3b041f
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/729519
(cherry picked from commit f439a370832f5a8515a8be09c977082c89566111)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/718908
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
Make modifications, so that powergate partition-id for APE
is always read from device tree.
Bug 200105664
Change-Id: I10d3632a4bdaf2b37690f19be82c5431c0c71c7c
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/730743
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/763551
GVS: Gerrit_Virtual_Submit
1. Remove replicate bit and add fifo_size_downshift bit
in cif
2. Update mask value for dma_fifo_size, dma_fifo_start_addr
and dma_fifo_threshold in admaif driver
3. Update the copyright
4. Add run time check function to detect FPGA
Bug 1582514
Bug 1582510
Change-Id: I40a8172ebc3713ead4cb5764f291f04d548c7a75
Signed-off-by: Junghyun Kim <juskim@nvidia.com>
Reviewed-on: http://git-master/r/751602
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
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>
Error in app loading skips loading of other apps and
disables further use of ADSP. This prevents use of
other successfully loaded apps which could have worked
fine.
Avoid skipping of remaining apps when loading fails for
one app. Failed app will anyway throw error whenever
user attempts to use it. This also allows adding entries
for optional apps.
Check if app was loaded when calling app_init().
Bug 200100724
Change-Id: I70a818df6fdeb54f94700e6c5f10a1dd1b269b72
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/736736
(cherry picked from commit 5387c9989420525b6ce7eaafd2ddb913f496740d)
Reviewed-on: http://git-master/r/740608
Reviewed-on: http://git-master/r/750726
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Capture using last ADMA plugin was failing due to incorrect
condition in for loop. Fix it by changing condition.
Increase max number of ADSP ADMA plugins to 10 to support
additional use cases.
Bug 200056741
Change-Id: Ifbc45ee2ad8093f67d357543fa2ffe3597cf77e8
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/735456
(cherry picked from commit d233ba3302b9cda9f8d5e7ef57d005a646c7047c)
Reviewed-on: http://git-master/r/740607
Reviewed-on: http://git-master/r/750725
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
This reverts commit e88ffa5fc211e68b888027ede341e264717a57d6.
If system is suspended before autosuspend time expires,
runtime_suspend does not get called and ADSP does not get
suspended. This breaks audio playback after resume due to
incorrect state of ADSP after system resume.
Originally autosuspend delay was added to avoid frequent
OS suspend and resume. No functionality issues were/are
seen even without autosuspend delay. So removing
autosuspend delay to avoid this issue.
Remove unnecessary debug print.
Bug 200090996
Change-Id: I9bfb5056e74690cf29a56273a825705cbecc0ac1
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/731620
(cherry picked from commit 53d141ffa25c4e89625bfef8d299da452d8859a4)
Reviewed-on: http://git-master/r/740606
Reviewed-on: http://git-master/r/750724
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Add pm runtime callbacks for ADSP OS start/suspend.
Stop ADSP OS if app load fails.
Call to runtime_suspend after stream stop doesn't happen
when audio adsp driver is under APE PD because ADSP os
driver holds APE PD count during nvadsp_os_start() which
prevents APE PD from calling suspend. So do not add audio
driver to APE PD.
Add validity check for prtd in message handler.
Bug 200087374
Change-Id: Ie813e834f4f71fee5bbd4699cbc887e6fe8397f8
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/720215
(cherry picked from commit f49832b8b51b657dc4e3367268788641a9ed4892)
Reviewed-on: http://git-master/r/715488
Reviewed-on: http://git-master/r/750721
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
snd_kcontrol_chip(kcontrol) no more returns pointer to dapm_widget_list
from kernel 3.18 onwards, which is used to get pointer to soc_platform,
instead now use snd_soc_dapm_kcontrol_dapm(kcontrol).
Change-Id: I85457b4edb0d163b77cc9362df6bd0ef2ad39213
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/738921
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
- removed snd_soc_codec_set_cache_io function
- use snd_soc_kcontrol_codec instead of snd_kcontrol_chip
- use codec->component.val_bytes instead of codec->val_bytes
- use devm_ioremap_resource instead of devm_request_and_ioremap
- snd_soc_dapm_mux_update_power prototype is changed
Change-Id: Ieb699a0e8a12b341c6823337ef2deb0d99292240
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Set the plugin params only if ADSP is booted and plugin
is loaded
Bug 200075850
Change-Id: Ib174afe270357ae3c21e50b9e0e85348024ec681
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/715944
There is a scenario where SPK/HP routing change triggers
hw_params callback and DAPM widget events for ADSP stream
while stream is in paused/running state. Call to hw_params,
can re-assign a different ADMA channel than what was
assigned at start of playback. This happens when there
are multiple ADMA apps running on ADSP (eg. 3 in case of
offload + speaker protection). This change of ADMA channel
while stream is in running/paused state is unsupported and
unnecessary.
Avoid re-assignment of ADMA channel and other possible
issues by allocating ADMA channel in ADMA app init and
releasing it in app deinit.
Bug 200082413
Change-Id: I869c2a1c9e92e74e5ab2c6b9893ebd3e664def91
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/713112
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
With multiple APM's present, plugin addition
or removal does not work.
Fix it by checking only for ADSP_APP when
trying to find the APM of which the plugin
is part of.
Bug 1605750
Change-Id: I457b04a5f1ead9ac682f734b0d145f5250c411a9
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/714834
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
Reviewed-by: Stephen Holmes <sholmes@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Do not send message to inactive state transition and flush.
APM moves to inactive state on its own.
Convert sample rate from index to value when sending to user.
Bug 200082504
Change-Id: I9ee1c4a995940882e7cf163ab90fc59ffd0804df
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/710381
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Stephen Holmes <sholmes@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
1. Fix ADSP crash due to reorder of mixer commands
2. Add support to track the PCM paths constructed, have a
record of FE/BE connections made by the user.
3. Support ADSP pipeline breakage, linkage, modifications
4. Plugin params can be set at any time
This change depends on http://git-master/r/#/c/709103/
functionality wise.
Bug 1605750
Bug 1605316
Bug 200075850
Change-Id: I24af6177f8ae21e7a352a58056a7267a129c3846
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/710448
Actmon logic takes time to increase ADSP clock in case of sudden
load. This causes initial glitches in audio. Request higher ADSP
clock at stream start to avoid this. After initial boost, actmon
controls ADSP frequency based on load.
Higher ADSP clock is requested only when using ADSP speaker
protection path.
Bug 200077167
Change-Id: I8d2eae7f1c7e789a1d2012b2fd9b7cf27d6ac851
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/710727
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Update all gain parameters when updating gain. Not doing so
causes mixer to take other parameters in undefined state
causing distortion.
Cache gain values and use that value when setting in hw params.
This avoids overwriting user programmed gain.
Bug 200078605
Change-Id: I2ff9c096445ccd928a7c1c482bf418f5564175c3
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/696351
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>