Commit Graph

1129 Commits

Author SHA1 Message Date
Uday Gupta
a304847e65 tegra-alt: adsp: Pass ADMA CH page to ADSP
ADSP NVADMA driver needs to program different ADMA channel
page based on which guest ADSP is assigned to in case of
virtualization

Jira EMA-358

Change-Id: I601965d255ef3ced6c5d8873a21890910689ab9a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/1251785
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
sdash
08899c1d36 adsp_alt audio: Add checks for Plugin connections
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>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
6a29672f96 ASoC: tegra-alt: xbar child suspend fix
platform_pm_suspend should not be called directly
as this is not exported symbol. Changes calls the
xbar child suspend function using ops exposed by
child drivers.

Bug 200176091

Change-Id: Idb275fe76a96e6fa8d6aec10bccb28f39e3bb0f2
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1160288
(cherry picked from commit 508a06f86d52af5d8c6b6d9df97db6e4857773ba)
Reviewed-on: http://git-master/r/1238409
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
90edd0856e ASoC: tegra-alt: use ch select value for no of ch
Use the channel select control input to decide on the no of channels for the
dmic configuration, this way we can capture more than 2 channels using tinycap
which wont effect the dmic configuration, which will sole depends on ch select
mixer control value.

Bug 1833091

Change-Id: I3233913c62a311f3ff08116ebccea0a807e6efb4
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1246322
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
995c9c85a2 tegra-virt-alt: Add adsp virtualization support
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>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
caad555093 tegra-alt: sfc: amixer control for output format
Added mixer control to set output bit format of SFC

Bug 1737704

Change-Id: I947e5d97183d87336976ce5e49124956f57b7db5
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/1155061
(cherry picked from commit f3a31bb524f1ad8629759fef77a9a2058ad55cfa)
Reviewed-on: http://git-master/r/1157727
(cherry picked from commit e88670db0c65ae46befeb5d2b5feb8b2d8c9e88a)
Reviewed-on: http://git-master/r/1166780
(cherry picked from commit 07b739f36f575a5cc287e6eb7fb0fd9620d0d8a0)
Reviewed-on: http://git-master/r/1241652
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
404df98a3c tegra-alt: adsp: Add S32_LE playback/capture support
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>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
0e367830b2 tegra-alt: admaif: fix fifo sizes and start addrs
amdaif fifo sizes and start addresses were being
set such that amdaif x and admaif x+16 fifos were
overlapping causing audio data corruption when used
simultaneously.
use the reset values for fifo sizes and start
adddresses to avoid this overlap

Bug 1748018

Change-Id: I8a87e83d1cbebcd6dc2f487a5925756fd47004a3
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1171651
(cherry picked from commit efef0eaf1434b550e93016264491a16555d7b3de)
Reviewed-on: http://git-master/r/1238417
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
4a5d4c683c ASoC: tegra-alt: Separate out adma as rx and tx
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>
2022-09-29 15:30:21 +05:30
Mohan Kumar
358ce95cbc ASoC: tegra-alt: i2s rate and channel control
Expose mixer controls for i2s sample rate, channel and
channel conversion in rx/tx i2s cif. This is required
to support routing of audio to codec from i2s6.

Bug 1792012

Reviewed-on: http://git-master/r/1227399
(cherry picked from commit 76118138b12220a2cdf25d44fd58fcd83090577c)

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Change-Id: I4e5471b7ca8fcf6d72ab2e0e27ed16b6adb8c94d
Reviewed-on: http://git-master/r/1201220
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Singh
70ea48465f ASoC: tegra-alt: Fix kernel warnings
fixing kernel warnings of the form
"tegra210-i2s tegra210-i2s.[0-9]+:
Missing prop fsync-width for I2S
Either we can set the property to a value of 31
or we can make these dev_warn as dev_info.
We are going with the second option.

Bug 200178609

Change-Id: I29285925a8a88ab8119ec655133462b0714c5092
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1207583
(cherry picked from commit c2bf779f429f5fb02a787026bcc99a22e7a647b4)
Reviewed-on: http://git-master/r/1210057
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Singh
368b5bcd4c Fix kernel warnings
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>
2022-09-29 15:30:21 +05:30
Mohan Kumar
62fba33a1a ASoC: tegra-alt: fix the component probe
The component probe callback needs to be called for K4.4
inorder to assign the component read and write callback
functions implemented in the adsp driver.

Bug 200224813

Change-Id: I63874543411f5ffa10db99a94fb63e0dbb91a925
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1196926
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Tested-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
dmitry pervushin
e1d4b7f2f4 Makefiles: use tegra-path for external projects
Use the tegra-path function to compute the path to external projects.
That allows the external projects to be collaped into this project without
needing to modify the Makefiles.

Also, add both the external and internal path to headers to the include
path.

Bug 1783210

Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Change-Id: Ie085a74cf3097c47a0eeb7cbd0ad653db88ea953
Reviewed-on: http://git-master/r/1174846
Reviewed-on: http://git-master/r/1177283
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Tested-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/1183037
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
336872c171 ASoC: tegra-alt: modify amx byte map disable value
Earlier -1 is used to reset amx byte map, this change use 256 to
disable amx byte map.
Valid values are from 0 to 255, setting value to 256 disables
corresponding byte.

Change-Id: I05667b1cf7b3da8dc1bdfa68ca787e3d86422f0c
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1182785
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
3b4c46e6f1 ASoC: tegra-alt: Support dynamic pinmux for spdif
Support dynamic pinmux settings for dspk, this change will help
to runtime configure the pinmux register to use pinmuxed path.

Change-Id: Ice8236e17e55f9fb58566f65a638b750fc7bdd00
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1181863
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
0b8798133d ASoC: tegra-alt: Support dynamic pinmux for dmic
Support dynamic pinmux settings for dmic, this change will help
to runtime configure the pinmux register to use pinmuxed path like
either AODMIC/DMIC3 etc..

Bug 200119874

Change-Id: Iaebb453293a1c957ae44bc709fa776d28c189b33
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1180530
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
75e706fda1 ASoC: tegra-alt: bclk callback in dmic driver
add dummy bclk callback function in dmic driver.

Bug 1782976

Change-Id: I11e5276cb64c9747fc077188c922352254b3e663
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1180062
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
0f8f5227e2 ASoC: tegra-alt: DMIC Mono channel select control
Add support for channel select control to choose between
left and right, If the capture channels are > 1 then
the stereo channel settings is selected by default.

Bug 1782976

Change-Id: Ife7f554c93741a3232ae0b65b44eaeb9e4215c98
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1176100
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Vandana Salve
abd65aedf7 tegra-alt: adsp: fix coverity issue
Fix coverity defects, Resource leak
Coverity id 33603

Bug 1781383

Change-Id: If03f2854ae58d3a2218d6df392d12a11d1c510dc
Signed-off-by: Vandana Salve <vsalve@nvidia.com>
Reviewed-on: http://git-master/r/1173653
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
0ec788ec71 tegra-alt: adsp: disable remove() callback
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>
2022-09-29 15:30:21 +05:30
Sameer Pujar
f05cbe122b tegra-alt: adsp: supress bind/unbind attributes
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
fcd36dccf3 tegra-alt: adsp: increase space for widget name
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>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
c279bec375 tegra-alt: adsp: clk to adsp_audio
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>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
962185df88 ASoC: tegra-alt: changes for kernel-4.4 transition
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>
2022-09-29 15:30:21 +05:30
Sri Krishna chowdary
e69c77b9a8 ASoC: tegra-alt: fix compilation issues
1. clang found out that this header is unprotected.
   Fix it by correcting the typo.
2. clang incorrectly warns about overflow in DMA_BIT_MASK(64)
   This is incorrect. So, ignore it.

bug 200174682

Change-Id: Ib6294dad8e92844a04fad46d49f801cd2a32c866
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1150396
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
5d903ff971 ASoC: tegra-alt: i2s: clock fixes
i2s clock is required to be configured
only when controller is programmed as master.
Also when clock source is sync clock need to
program the sync clock selector to pick correct
external clk.

Bug 1747842

Change-Id: Iadddebb21f7b0990114f4ad25093638ab996ce9f
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1139580
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Tested-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
ff10659ee8 tegra-alt: adsp: change local function to static
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f230f18f24 Revert "Revert "tegra-alt: adsp: add support for 4kb read/write""
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
6477cf9ec9 Revert "tegra-alt: adsp: add support for 4kb read/write"
This reverts commit 7a72df25d0004716e03d8b062906d132baa265dd.

Change-Id: I941acae01ae163863c15d756c003cb0979c06d54
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1127324
Reviewed-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
Tested-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
72cf476367 tegra-alt: adsp: fix adsp mux texts
This corrects the ordering in tegra210_adsp_mux_texts for
ADSP-EAVB widget. Also remove unnecessary comments which were
incorrect.

Bug 200189793

Change-Id: Ie32aef90ca0b1fd688ca5888a3947f7b2ab37f6a
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1125908
Reviewed-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
Tested-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
df8a0d1503 tegra-alt: adsp: add support for 4kb read/write
- added support for reading upto 4k bytes from APM
- increased write suppport to 4k bytes

Bug 1723185

Change-Id: I154bb6f699ce4eb441a0e5e0374770d40e7b631f
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/1019963
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
07fa34730b sound: soc: tegra-alt: Fix Out-of-bounds read
It fixes Coverity defect of logically Out-of-bounds
read.
Coverity ID: 20425

Bug 200116059

Change-Id: I77c0c90f23beb7bf8938fc9ab3701d1ad8065267
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1115850
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Sidharth
363ad47a54 ASoC: tegra-alt: improve i2s clock parent config
Added support in i2s driver to have an option
to drive an i2s in master mode from another
i2s sync clock

Bug 1733691

Change-Id: I2f2b7bbdbbdf8af97e6aef4563d5729b8f2d8c52
Signed-off-by: Sidharth <svarier@nvidia.com>
Reviewed-on: http://git-master/r/1118980
Reviewed-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
1c5a5afe43 tegra-alt: adsp: request correct adma isomg bw
ALSA does not know pcm stream rate, format etc in
pcm_open call. Hence wrong bw was getting set.
Moved set_bw call to pcm_prepare

Bug 200187675

Change-Id: I715c9e035d0212251c7f7a867abd93f8ac728d8d
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/1119585
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
5766c8f102 tegra-alt: adsp: update adsp pointer in apm_out
Bug 200164448
Bug 200149702

Change-Id: I7352de827cd9fcae90931816bcaa0b3f2c23ee5f
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1118335
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Tested-by: Dara Ramesh <dramesh@nvidia.com>
2022-09-29 15:30:21 +05:30
Nitin Kumbhar
2d905f4eb5 ASoC: tegra-alt: use generic tegra pd api
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
2022-09-29 15:30:21 +05:30
Viraj Karandikar
b302d0a2a0 tegra-alt: adsp: request ACK when closing PCM stream
Request ACK and wait when closing PCM stream.

Bug 200100724

Change-Id: I1a12a3a8efff0e25152c148e4b74b163f0b4f63d
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/834456
(cherry picked from commit 21b996e65952154add4238e87c690a7e086c89c5)
Reviewed-on: http://git-master/r/840362
Reviewed-on: http://git-master/r/921976
(cherry picked from commit 58c0b15e4912538f6da2e7437a6f111f9b47a07a)
Reviewed-on: http://git-master/r/1000803
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
b210db3b08 tegra-alt: sfc: enable 16/8KHz to 24KHz conversion
Added SFC RAM coefficients for 8/16KHz to 24 KHz conversion

Bug 1737704

Change-Id: Ied5c47b3ab277642c48e363ac1181d3f2187f46b
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1117439
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
2b8e5b84b9 ASoC: tegra-alt: i2s: Move sw-reset to PRE_PMU
Moving sw-reset at PRE_PMU stage where we
reset i2s controller it start of playback/
capture to clean up fifo's in case last run
was not good.

Bug 1736992
Bug 200181219

Change-Id: I716eb736242440360dc1e13426a69adfac08c6ed
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1112855
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Sumit Singh
bf77cfbf26 ALSA: HDA: Replace CONFIG_PM_RUNTIME with CONFIG_PM
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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f5e1951ebe tegra-alt: adsp: messaging fixes
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>
2022-09-29 15:30:21 +05:30
Srinivas Anne
24478baeaf asoc: tegra-alt: add kcontrol to set i2s bitwidth
Audience require 32 bits/channel for power optimized routes.

Added k-control to update 12S bit width. This change will also take care
of converting XBAR_BITS to CLIENT_BITS by padding zeros from LFSR to LSB

DAI format is hardcoded to 32 bits in Audience codec driver.

Bug 200118587

Change-Id: I3cf35977e8ba57d83084bd86ae6a2720a6acde7e
Signed-off-by: Srinivas Anne <sanne@nvidia.com>
Reviewed-on: http://git-master/r/830893
(cherry picked from commit a7b79a1b71e4e11cad1fb323e8ccbcd42894a2a0)
Reviewed-on: http://git-master/r/832487
Reviewed-on: http://git-master/r/1028395
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viswanath L
93b24a451e tegra-alt:adsp: Allow "Min ADSP Clock" ctl always
"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>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
6c30a39444 tegra-alt: adsp: add APM input mode control
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>
2022-09-29 15:30:21 +05:30
Ajay Nandakumar
a15d51b4ab sound: tegra-alt: Route interrupts from DT
Routing ADMA interrupts to ADSP or HOST from Device tree. This reduces
adding un-necessary code for routing interrupts using
tegra_agic_route_interrupt for statically routing.

Bug 200152320

Change-Id: I15df7a9c65f1ec0322122bb7301900217b8d36d2
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/1000827
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
9d576648ea tegra-alt: amx: allow disabling of AMX slots
AMX slot can be disabled by sending negative value via
Byte Map control.

Bug 200100724

Change-Id: I67d8e0896b739f94187e4401ceb09382a4a7ed8d
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1008822
(cherry picked from commit 0d12eeba0d0b9e411bab4eb899b19d33254f484c)
Reviewed-on: http://git-master/r/1010807
(cherry picked from commit 36cc2f41ab7a54d729a7f237c877569f5ab841d1)
Reviewed-on: http://git-master/r/1022463
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
b57470cec4 tegra-alt: admaif: flag ENABLE reg as volatile
ADMAIF channels used by ADSP are enabled/disable from ADSP.
So mark ENABLE register as volatile to avoid CPU writing
incorrect values into it.

Bug 200173637

Change-Id: Ic441d890e90dd087ae6bdd2a0b9ef8ceec0bb333
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1013345
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
d50bf8eeb6 ASoC: tegra-alt: Add parent source for spdif clock
Add parent source for spdif clocks in the driver.

Bug 200162115

Change-Id: I3e4f3c73fbc4f5ac8dc25d26879cf8115d506f13
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/932064
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
2f07906bd0 ASoC: tegra-alt: Support adma iso client
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>
2022-09-29 15:30:21 +05:30