Commit Graph

362 Commits

Author SHA1 Message Date
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
Uday Gupta
287853b54f tegra-alt: adsp: Add eavb dma source codec
Add eavb dma plugin interface params
Call eavb dma plugin init when path is complete
Add ADSP-EAVB widget and dai-links

Bug 1704053

Change-Id: Iaf817f3fcabc349bbcad7d71d3f0c00fabe12c2a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Signed-off-by: Arun Mankuzhi <amankuzhi@nvidia.com>
Reviewed-on: http://git-master/r/840906
Reviewed-by: Nitin Pai <npai@nvidia.com>
Tested-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
8867b0f9b2 ASoC: tegra-alt: clean up clock codes
Clean up the clock codes
 - remove clock rate hardcoding
 - move clock rate to DT

Bug 200164600

Change-Id: Iac841e9ef6ac621d1149efa8993bc07fad8f74b6
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/933714
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Sarada Dash <sdash@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
ea7da663e0 ASoC: tegra-alt: add adsp admaif dai
Change adds dais for adsp-admaif dai
links.

Bug 200130700

Change-Id: I9d7ca54b760e77295d6a898ead01bb1033b0dce9
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/934517
Reviewed-by: Nitin Pai <npai@nvidia.com>
Tested-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
cf994c29d6 ASoC: tegra-alt: Cleanup maui defconfig
Removes machine driver specific dependency
for having configs for each platform. Instead
this should be done from device tree.

Change-Id: I6d8ac10dc2d2e25b4882a5e6b163a1d8f042d4fb
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/932743
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
46bfef7068 tegra-alt: adsp: add ADMA plugin param controls
Add controls for sending parameters to ADMA plugin

Bug 200100724
Bug 200150727

Change-Id: I2d8c0dcebf679886d966fc45e96035f963740e10
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/925794
(cherry picked from commit d3b6b4071619d8745ff62b2249a3653e83bf26d4)
Reviewed-on: http://git-master/r/928686
(cherry picked from commit 5c3833b564d826dabaacf527d49a5a21e7fafc23)
Reviewed-on: http://git-master/r/928998
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
76d94dcead ASoC: tegra-alt: Move register store/restore
Move register store/restore from pm API's to
runtime API's for platforms, with CONFIG_PM_SLEEP
not enabled, to work.

Bug 200166409

Change-Id: Ifcdd78206b3ac59edc8ba1279316cfa8c87e7204
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/932101
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
17661675d6 ASoC: tegra-alt: Add SPDIF loopback mixer control
- Add amixer control to enable internal SPDIF
  loopback.
- Add dummy set_bclk_ratio to prevent sound
  card registration error

Bug 1642888

Change-Id: I15832a5f64976f9a40d890d54b47713d1d63b141
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/929948
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
8d4601447c ASoC: tegra-alt: fix coverity defect
fix coverity defect "unsigned compared against 0"

Bug 200116059
CID 20237

Change-Id: I8bf81f0ef77a8bc87d5ba38b01e2a3d0e6b7b948
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/929461
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
d00fea6da9 ASoC: tegra-alt: add check for pointer before access
add check for context pointer before accessing it in suspend.
Also move setting of driver data at the end of probe function.

Change-Id: I5724ee810dd3ca409412aa21d61d35519b1432a3
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/921743
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
56e4b6edb2 ASoC: tegra-alt: fix the error check
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>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
870919fc70 tegra-alt: mvc: curve type and volume gain fixes
- added mixer contols to set curve type,
  cif channels and number of bits.
- modified volume control to increase/decrease
  volume by 1dB for every step (for linear curve)
- changed default curve type to linear
- fixed check on number of channels

Bug 1694107
Change-Id: Ibad07ff2f61fef73e84f5193991b092afaf8db8c
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/828227
Reviewed-on: http://git-master/r/834971
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
Mohan Kumar
d0bb22eb86 ASoC: tegra-alt: Add apb2ape clock in xbar driver
Add apb2ape clock support for xbar driver for ape-pd functionality

Bug 200124772

Change-Id: Ib21a760574d2c1aff1d8a653f016db697e97a31d
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/826159
(cherry picked from commit 76ae6f150cefe0afd79769c652c5a7158188450f)
Reviewed-on: http://git-master/r/838036
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
Gaurav Tendolkar
d99c28330a tegra-alt: sfc: enable 48KHz to 24 KHz conversion
Added SFC RAM coefficients for 48KHz to 24 KHz conversion

Bug 1684121

Change-Id: Ifc1f0689c0d21fcf197b384f032b50324c647c4b
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/834981
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
Dipesh Gandhi
9b3e0282c1 ASoC: tegra-alt: Machine driver for Maui
Change-Id: I25a053140b44a2bce7d23bf3d93f554b1c8b7b68
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/816553
Reviewed-on: http://git-master/r/821157
Reviewed-by: Wahed Syed <wsyed@nvidia.com>
Tested-by: Wahed Syed <wsyed@nvidia.com>
Reviewed-by: Bob Johnston <bjohnston@nvidia.com>
Signed-off-by: Anil Gahlot <agahlot@nvidia.com>
Reviewed-on: http://git-master/r/824936
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f77c18ee6f tegra-alt: fixes for kernel-3.18
Use snd_soc_kcontrol_codec() instead of snd_kcontrol_chip().
Put additional T186 ADMAIF channels under macro.

Bug 200100724

Change-Id: I20d280f067414bec16a4f07e38a05b64306cb217
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/826932
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
0fbbcc3bfe tegra-alt: add controls for CIF channel config
Add controls for configuring CIF channels for AMX and ADMAIF.

Add controls for CIF stereo/mono conversion for SFC.

Remove non-zero check in put_byte_map() to update byte mask.
Due to this check, byte 0 map wasn't getting updated for valid
value of 0.

Bug 200100724

Change-Id: I37b96594464f699db93552f5c1e148c51e963c5e
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/760115
(cherry picked from commit 8c2d36d0303aac45553cc64c148d8c62a8bcf880)
Reviewed-on: http://git-master/r/772770
(cherry picked from commit d17f88c03e55d8f0a250cd013b7d18a27c0d789c)
Reviewed-on: http://git-master/r/781739
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
3dca31ad46 ASoC: tegra-alt: Fix i2s soft reset api
- rx soft reset should be set for playback case
  and tx soft reset for capture case
- make soft reset registers writable by regmap

Change-Id: I840332e9ae30506c16c22ad423dc5e264188a858
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/818828
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
Tested-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30