Commit Graph

4323 Commits

Author SHA1 Message Date
Uday Gupta
4aff5a0e14 tegra-alt: adsp: fix crash in apm_get/apm_put
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
0b3f6dae2b tegra-alt: adsp: ignore app load failure during init
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
a4fc4a6c3b tegra-alt: adsp: fix condition in admaif params
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
57d003c3ef Revert "tegra-alt: adsp: add runtime suspend delay"
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
8ccccf865d tegra-alt: adsp: add control to set APM priority
Add control to set APM priority.
Do not hold plugin connect messages.

Bug 200093193

Change-Id: I359566585a3e07d715bf044d6aaad954cf398a5b
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/723648
(cherry picked from commit 777b03337100d366c4467cbf2d2b0b3ef1f90797)
Reviewed-on: http://git-master/r/740602
Reviewed-on: http://git-master/r/750723
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
9b6c02f70f tegra-alt: adsp: add runtime suspend delay
Add autosuspend delay to avoid freuquent suspend/resume
of ADSP OS. Remove redundant PM_SLEEP ops.

Bug 200087374

Change-Id: I0164f8b890b7edf0fb882706a8ada2fab121e280
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/720996
(cherry picked from commit e88ffa5fc211e68b888027ede341e264717a57d6)
Reviewed-on: http://git-master/r/740601
Reviewed-on: http://git-master/r/750722
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
44e11500e3 asoc: tegra-alt: adsp: add pm runtime callbacks
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
8bc369d475 tegra-alt: mixer: add control for instant volume
Add control for setting volume instantly without ramp.

Bug 1626776

Change-Id: Ief8c31ce5c537381496e85b585020291d1e1b470
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/739519
(cherry picked from commit f4b25e4114839ddded939cf838ca00902f05c23a)
Reviewed-on: http://git-master/r/740611
Reviewed-on: http://git-master/r/750719
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
20605880fa ASoC: tegra: Add one more ADSP PCM device
Conditional build. Added only for embedded
platform

Bug 1608299

Change-Id: I602add4be5d4b0c0515044f9aca60c8a1342550a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/742368
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
d07e72bb9f ASoC: tegra: Enable AD1937 I2C based codec
1. Enable AD1937 I2C based codec by selecting
   SND_SOC_AD193X_I2C for T210 embedded build
2. Miscellaneous fixes in driver as per K3.18
   guidelines

Change-Id: I7a1442304909a9778e96d4545b2b3eee8565c14a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/740246
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
b7fefa443e ASoC: tegra-alt: Fix crash in adsp platform driver
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>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
642d1a314c ASoC: tegra-alt: Fix build errors for kernel 3.18
- 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>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
c8e1e7558e ASoC: tegra-alt: Fix ADSP crash at set_params
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
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
f981c5f62f ASoC: tegra-alt: Set driver params iff clock is ON
Enable the module clock before the setting of any parameters.
Fix I2S Loopback, MVC volume & mute, Mixer Gain parameters.

Bug 200075850

Change-Id: Ieaa532be286de09a47d02db6dbe25db039cccaf3
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/715943
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
127bb19825 asoc: tegra-alt: reserve adma channel in app init
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>
2022-09-29 15:30:21 +05:30
Uday Gupta
63bb55cf62 ASoC: tegra-alt: ADSP plugin removal/addition fix
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
3c96a17c10 asoc: tegra-alt: fix coverity errors
Coverity id : 29432 Dereference before null check
Coverity id : 29416 Out-of-bounds access

Bug 1416640

Change-Id: Ifde2587e1e26c3118ec9751a24abc6ada26f3726
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/713735
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
49081f7136 asoc: tegra-alt: update adsp set param function
Allow setting plugin specific parameter by sending
nvfx_call_params_t based structure via mixer control.

Remove extra indent.

Bug 200026571

Change-Id: If111f18ea0b0fdce8c06491b8546d7fb92e889b2
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/711263
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
a26eb619f5 asoc: tegra-alt: fix for repeat of offload stream
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
469da04e35 asoc: tegra-alt: fix offload position when using SRC
Correct offload stream position when using
sample rate converter by using sample rates of
compress stream and i2s.

Bug 200026571

Change-Id: Ica2d5e24132c43bcca427f339de5d30a34b13a35
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/711649
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Tested-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
02d90673d9 ASoC: tegra-alt: ADSP driver enhancements
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
2022-09-29 15:30:21 +05:30
Viraj Karandikar
fb6932c04a asoc: tegra-alt: set higher adsp clock at start
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
32771bb391 asoc: tegra-alt: fix mixer gain update
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>
2022-09-29 15:30:21 +05:30
Dara Ramesh
9fb4155740 asoc: tegra-alt: add prod support
This change is for adding prod settings for i2s
dmic devices through device tree.

bug 200059617
bug 200062746

Change-Id: I905743de44f556d7b5f02289545f0c472e540eb1
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/682790
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
5923b73016 asoc: tegra-alt: add nvfx flush method
Add nvfx flush method to support seek

Bug 200034859

Change-Id: Ibc6e0d2ba5d2e69ee3baa399fabe22c31ea16b49
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/680640
GVS: Gerrit_Virtual_Submit
Reviewed-by: Stephen Holmes <sholmes@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
3151fe4c79 ASoC: tegra-alt: Use MSG_FLAG_SEND in ADSP
- Fixed static warning for param_info.

Bug 1587869
Bug 200067946

Change-Id: Idbae33c465d89efe2c692b1fc229ee036efcf9aa
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/679678
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
b75cc383f7 ASoC: tegra-alt: Add support to enable I2S_CYA_0
I2S_CYA register is a spare register reserved for any issue
in design. I2S4 has "i2s4a" and "i2s4b" pins in the pinmux.
In order to select i2s4b pin for I2S4 instance, we need to
enable CYA register

Bug 1602439

Change-Id: I42c401a301efb648e1141159367038a084718a93
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/677018
(cherry picked from commit ecae3a30ba4bd9333872f1aff6e6215169fd16d0)
Reviewed-on: http://git-master/r/679674
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Justin Kim (SW-TEGRA) <juskim@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
096fe92f57 ASoC: tegra-alt: Add parameter passing for ADSP
set params format for the plugin is as follows
@byte_format: <param1>,..<paramN>
@int_format: <plugin_method>,<#params>,<param1>,..<paramN>

Default parameter type for plugins is @byte_format

Bug 1587869

Change-Id: Ie1b8fc4c9229e8b149ea0ff7a985e9e99ab26fc1
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/676566
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
2925f870cd ASoC: tegra-alt: Support ADSP generic plugins
1. Remove hardcoded plugins from ADSP ASoC driver
2. Enable to feed plugins, widgets from DT

Bug 1587869

Change-Id: I607a6a0a093e523a9720ce0ebeef9c17f3f98340
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/676561
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
1baade3187 ASoC: tegra-alt: Add p1889ref machine driver
Bug 1552690

Change-Id: I45ee3218034fadc5a1d657e02cdcdcbce9fa6ce3
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/655535
Reviewed-on: http://git-master/r/671529
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
21e6177bea asoc: tegra-alt: keep ADMAIF Global Enable bit set
ADMAIF Global can get disabled before ADSP disables
its ADMA channels. This is not recommended as per
programming guidelines. So set ADMAIF Global Enable
bit in probe and keept is set always.

Bug 200069840

Change-Id: I73b38c4554b33c1af9d9027333ad12c55892ed7c
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/668983
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2022-09-29 15:30:21 +05:30
Manoj Gangwal
b2ec94e8e7 ASoC: tegra: Add support for ALC5639
Add change to build both machine driver
ALC5639 & Audience es755 together.

Bug 200058730

Change-Id: I067a5bb721f4b56165ed0d30f6f894148809f1f4
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/658967
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Sachin Nikam
e718f996b9 sound: tegra-alt: KConfig: Use right depends on
Use CONFIG_ARCH_TEGRA_21x_SOC instead of CONFIG_MACH_GRENADA

Bug 200064961

Change-Id: I8e5dcddaad2b4572c851764f87897c6ea08960ea
Signed-off-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/666230
(cherry picked from commit c52c7b62ad0f7436184d46b26658411e9cc04b27)
Reviewed-on: http://git-master/r/667128
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Dara Ramesh
69b9c724e2 asoc: tegra-alt: support High Resolution Audio
- suport HRA (24 bit, 192 Khz) format on t210.

bug 1502003

Change-Id: I0169b3485dff7316551ebb5541bde158b5a36744
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/661242
(cherry picked from commit f76e5afd5f3b1f0d6861cf5def5e23fcee19d425)
Reviewed-on: http://git-master/r/663308
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ashok Mudithanapalli <ashokm@nvidia.com>
Reviewed-by: Srinivas Anne <sanne@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
55d40a92e7 ASoC: tegra-alt: Fix ADMAIF codec dai id
Register FIFO dais before CIF dais to retreive corrrect DAI ids
in the hw_params.

Bug 1587869

Change-Id: I498a82fed6e30aab9949a42b34ab7cf781552ea3
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/663554
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Justin Kim (SW-TEGRA) <juskim@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
906ab7661c ASoC: tegra-alt: E2573 + E2581 audio bring up
1. Support E2110 audio test board with AD1937 codecs
2. Support P1892 EBB with AD1937 codec
3. Fix AMX/ADX power management options

Bug 1587869

Change-Id: Ie460a9d75b4e5ff1e48f66da3f6406e0bc6065e2
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/661110
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Tested-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Justin Kim (SW-TEGRA) <juskim@nvidia.com>
2022-09-29 15:30:21 +05:30
Sumit Bhattacharya
5bbc3938f4 ASoC: tegra-alt: Fix coverity failures
Coverity ID: 28084

Bug 1416640

Change-Id: I533cc8c0ca4c35d9f2996390445da6e728796234
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/658366
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Rahul Mittal
11a52e63fe ASoC: tegra-alt: Fix coverity issues in dmic
Coverity id : 28230
Bug 1416640

Change-Id: Ie0a5b28541c9c750ac6d45e8fe2f088757bcbe3f
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-on: http://git-master/r/658389
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Sumit Bhattacharya
8f8c3d0aa9 ASoC: tegra-alt: Add default reg values
Set default register values for AHUB modules in regmap. This will
ensure after runtime suspend/resume AHUB register POR values
does not get reset to 0.

Bug 200039212

Change-Id: I38e4c04721450b7511404c0db2911b314b68a880
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/603339
2022-09-29 15:30:21 +05:30
Shawn Joo
3186618fae asoc: tegra-alt: correct make rule
tegra_asoc_machine_alt can not be module drv by itself.
correct makefile for module drv.

Bug 200029409

Change-Id: If6b1e2d702bc7458da0c605716368b87d34c838a
Signed-off-by: Shawn Joo <sjoo@nvidia.com>
Reviewed-on: http://git-master/r/590794
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
d4f3d20ef1 ASoC: tegra-alt: Fix coverity issues in amx/adx
Coverity ID: 28085, 28086

Bug 1416640

Change-Id: Ic8fd3b9569d02ebee9225158ca59376b580cbb04
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/606415
Reviewed-by: Automatic_Commit_Validation_User
2022-09-29 15:30:21 +05:30
Sachin Nikam
a1b537c669 sound: soc: tegra-alt: Fix sparse warnings
Make local data and funcs static.

Bug 200032218

Change-Id: Ib2270a19df65b53f1b547efd3f4bc7bcfc0f15a4
Signed-off-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/600190
2022-09-29 15:30:21 +05:30
Sumit Bhattacharya
8bd1b0a7ae ASoC: tegra-alt: Add APE power domain support
1. Add APE power domain support to xbar and adsp driver.
2. Also add runtime PM support in adsp audio driver to ensure APE PM
   domain works properly.
3. Add code in xbar system suspend callback to support calling of all
   xbar child driver system suspend. This is required to properly
   support APE PM domain.

Bug 200039212

Change-Id: Ieb937b05e39d4e980872745e3b6580bca3eb6956
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/555433
2022-09-29 15:30:21 +05:30
Viraj Karandikar
dbae79bb60 sound: soc: tegra-alt: fix sparse warnings
Fix sparse warnings. Errors left in tegra210_adsp_alt.c are due to
non-NV code in soc.h

Bug 200032218

Change-Id: I0b17487684dddb7249e3c0c8132c5a1453f596ce
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/591743
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Ajay Nandakumar
dd98011be3 include: linux: rename MSGQ_MSG_SIZE
Renaming MSGQ_MSG_SIZE to MSGQ_MSG_WSIZE as this macro returns the
size in word rather in bytes.

Bug 200025742
Bug 1526538

Change-Id: I7f1dd858fa9c8fc779d80afda95b66d66d7bd554
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/558844
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Dara Ramesh
e38df8b899 asoc: tegra-alt: t210: admaif: remove clk apis
remove admaif clk get apis from admaif driver.

admaif module is under ahub clock and no separate
clock for this module.

Change-Id: I5354aff4aba5c1d3c5c759704e35e53803e67242
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/555497
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Sumit Bhattacharya
1f080ab1eb ASoC: tegra-alt: T210 power management support
Set idle_bias_off for all t210 xbar modules to ensure module runtime
suspend/resume works when module is idle.

Ensure regcache is synced back to hardware during runtime resume so
that register content does not get lost if it is written during
runtime suspend state.

Add suspend APIs for all module to mark regcache dirty while device
goes into suspend to ensure register values does not get lost across
system suspend/resume.

Change-Id: I2828beeed859df4f8084dd70bbcde5ed62f2525c
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/555028
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Sumit Bhattacharya
36359cf890 ASoC: tegra: Enable/Disable parent runtime pm
Instead of using duplicate clock of "d_audio" for all AHUB modules
get/put runtime pm reference of the parent module from runtime_pm
suspend/resume routine of all AHUB modules. This will ensure AHUB
xbar is up before other drivers tries to access any register. Also
it will ensure both d_audio and APE clocks are enabled when needed.

Bug 200042312

Change-Id: I0346728f15b135bb619de40fbd3fc440a5505940
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/554863
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
5066fe1a3a ASoC: tegra-alt: Use flat regcache
When using RBTREE cache, there can be allocations the first time
a register is accessed. This can cause an attempt to schedule while
atomic in the case that the regmap is using a spinlock. This can be
resolved by using a flat cache.

Bug 200041820

Change-Id: Id69592cd5fadbb5ad9ccfdbb1f184733a332512c
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/552940
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
684a5ee845 ASoC: tegra-alt: Reset T210 driver modules
1. Add soft reset for I2S, ADMAIF, AMX and ADX modules
    to handle successive start/stop scenarios
2. Flush AMX/ADX map table before sucessive mapping changes
3. Restore tx/rx_crtl, tx/rx_cif_crtl, i2s_ctrl
    and offset after soft reset

Bug 1442940

Change-Id: Id275fccf32857f897080f40ec2d9f25a532c262f
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Signed-off-by: Junghyun Kim <juskim@nvidia.com>
Reviewed-on: http://git-master/r/457198
2022-09-29 15:30:21 +05:30