Commit Graph

550 Commits

Author SHA1 Message Date
Sameer Pujar
5c3be8602c ASoC: tegra-alt: expose i2s fifo threshold control
For some of the use cases we might require to program the fifo
thresholds of Rx cif. Until now we have been using fixed
values for Rx cif. This patch exports the configurability
option to the user space. If no threshold value is specified,
it uses the fixed values as per the previous state of the driver.
Threshold needs to be programmed in terms of frames, where
1 frame = no. of channels * 1 word.

Note: The same control for Tx cif is not needed as this register
is RO and not allowed to be programmed. Reset value is used for
Tx cif.

Bug 200283222

Change-Id: If1e5379dd874a0f1f6f1d9ae71465ac8c1f9f071
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1319742
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Sameer Pujar
8f4d31deb6 ASoC: tegra-alt: AFC driver fixes
Fixes following issues,
  - threshold setting failure due to APIs not reporting
    proper sfc/i2s ids
  - remove dependency on xbar register reads to find the
    sfc and i2s ids
  - more configurations exported to user space for better
    control over the requirements

Bug 200283222

Change-Id: I77494bd1d97325b678f07774e0c47a612b5c23e7
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1312624
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
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
Hariharan Sivaraman
7a799c007b sound: tegra-alt: PEQ enhancement
Add support for 8 channels in PEQ. Add support to
program gain and shift RAMs with integer coefficients
instead of byte arrays.

Fix OPE enable writes to incorrect regmap

Jira EMA-393

Change-Id: Ib509a9f95f4c152c2210f88975a1f7572d79ba08
Reviewed-on: http://git-master/r/1318570
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
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
5ec5417e3c tegra-virt-alt: correct build dependency
Change adds correct build dependency
for virt-alt drivers.
Bug 1828453

Change-Id: Ifa47a3eae0335bcaf6a3473b0e13e1902c31faaf
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1298609
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
9786e0098e Revert "ASoC: tegra-alt: select hwdep to be compiled"
This reverts commit dc8f2f25d3a1.

Removed hwdep device from tegra-alt, since we don't use hwdep and
reduce maintain effort.

Coverity ID 38817
Bug 1880011

Change-Id: Iff020bfb89170aaedecbd6a3f284c35283df700c
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/1309630
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
49d3aebf41 Revert "ASoC: tegra-alt: adding tegra_machine_hwdep device"
This reverts commit 85307d57431c.

Removed hwdep device from tegra-alt, since we don't use hwdep and
reduce maintain effort.

Coverity ID 38817
Bug 1880011

Change-Id: I6357b23ac0867f7b7c31796c1cc37f5eabf4f050
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/1309629
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Dara Ramesh
f0c4dd2fad ASoC: tegra-alt: add rt5640 machine driver
on kernel 4.4 both rt5639 and rt5640 is
unified to single RT5640 driver, so changed
the machine driver to switch over to new
codec driver.

bug 200270111

Change-Id: Ib063af7682c45ae85766207ecf69dfe9ae3d9e8b
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/1303696
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Ishan Mittal
aa31cc268e sound: soc: tegra-alt: Use ARCH_TEGRA_210_SOC
Make use of ARCH_TEGRA_210_SOC instead of ARCH_TEGRA_21x_SOC
so that we can get rid of redundant ARCH_TEGRA_21x_SOC.

ARCH_TEGRA_210_SOC aligns to up-stream as well.

Bug 1766370

Change-Id: I10a9d9bb63b1fbac358d85a228710a208d595281
Signed-off-by: Ishan Mittal <imittal@nvidia.com>
Reviewed-on: http://git-master/r/1306757
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
5fe501ba84 tegra-alt: adsp: add parameter size checks
Fix possible buffer overflow in case of invalid user
parameter by adding size checks

Bug 1869543

Change-Id: I82ac00e24a3ca40915eb6c556454c9649cb644bd
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1297227
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Venkat Reddy Talla
f56b54a18c sound: tegra-alt: get rid of PLATFORM_TEGRA config
Removingg PLATFORM_TEGRA and using ARCH_TEGRA to align with
mainline, in mainline ARCH_TEGRA is used and there is no
PLATFORM_TEGRA, ARCH_TEGRA already enabled in both tegra18 and
tegra12 defconfig.

Bug 200256189

Change-Id: I0931eb801c86d0dc10be29be2312c04afb33cb1a
Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-on: http://git-master/r/1295174
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2022-09-29 15:30:21 +05:30
Shardar Shariff Md
b49c00dac2 soc: tegra: use soc/tegra/chip-id.h for soc header
The soc tegra headers are unified and moved all the content of
linux/tegra-soc.h to the soc/tegra/chip-id.h to have the
single soc header for Tegra.

Change-Id: I8119717635823a642a08ba3e5eeed4e599f8d0df
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
Reviewed-on: http://git-master/r/1288269
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
90b78c8f42 tegra-virt-alt: Match ADMAIF Client and xbar bits
Match Client and xbar bits for ADMAIF Interface

Jira EMA-380

Change-Id: I20fae77b8418f000415acf578aa858b8b12fb54e
Signed-off-by: sdash <sdash@nvidia.com>
Reviewed-on: http://git-master/r/1282761
Reviewed-by: Hariharan Sivaraman <hariharans@nvidia.com>
Tested-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
7a4067a6c3 ASoC: tegra-alt: fix coverity defect 33507
Clean up the code as this part of code is not valid now.

Coverity ID 33507

Bug 200192147

Change-Id: I6f9ce32a5a52c616838649826bce72aba848d8c2
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1260422
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f16184f16f tegra-alt: adsp: fix coverity defects
Add validity checks on data from userspace
Fix variable hiding

Coverity ID 31982 31979

Bug 200192147

Change-Id: I7fd6a8f1016aa5fe819c230e8154e3f82971c2d9
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1275950
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
Ravindra Lokhande
26caa435c1 ASoC: tegra-alt: update audio drivers for kernel-4.4
Made changes needed for t21x to get audio working on kernel 4.4.

Bug 1810165

Change-Id: I85116662083f1430182248e2a7c51165901c0dce
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1267443
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
4ecda75d43 ASoC: tegra-alt: channels inside ahub via controls
Certain usecase requires different audio and client channels settings
inside ahub, so this needs to be handled with dedicated Channels mixer
control for each module.

This change will introduce channels mixer control and cif controls to
admaif,dmic,i2s and all other internal module is control with a single
channel control.

-Support mono channel SFC
-Support mono channel Mixer
-Cleanup drivers

Bug 1839027

Change-Id: Id997519ebdc9f518c83debc2d4cd58fde34e79b6
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1258877
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Laxman Dewangan
dc94ff5770 sound: soc: tegra-alt: Get rid of include of mach/clk.h
mach/clk.h just include the linux/clk/tegra.h and hence directly
include this header instead of via mach/clk.h.

bug 200259454

Change-Id: Iae9061f88ae47ddbc2985a2e8e4268a094c0dba3
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1263982
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
Viswanath L
fa52637ec3 tegra-alt:adsp: NULL check for app variable
ADSP app variables are not initialized in all cases (like at APM
output pin) causing NULL pointer access to app->override_freq_work

NULL check fixes this; override_freq_work will get called at widget
ON event

Bug 200245012

Change-Id: Ie6161c0247d8b15db88bdef706ab6c3b472fa977
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1244336
(cherry picked from commit 6f6c38a0413b20111ff95d3e0d26c631f0a7a639)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1252706
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
445605513d tegra-alt: adsp: avoid sleep in send msg
Do not use blocking flag for mailbox send function.
Use mdelay instead of msleep

Bug 200222934

Change-Id: I9c121f50debb46b191ad735f7445bbe5c026e30a
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1217913
(cherry picked from commit 7cd8a2d558c7d59b020c39f6177b263242c1641a)
Reviewed-on: http://git-master/r/1252705
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
77c3fa9449 tegra-alt: adsp: schedule work for freq override
Schedule worker function for frequency override to avoid
adsp_override_freq() and clk_set_rate() getting called
from atomic context.

Bug 200222934

Change-Id: Ia65ce4a617bfd4494d04bdfac8b28e6d8260943c
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1211239
(cherry picked from commit 008fa5cd7722e3cdcb4ec96b13a73fda7e6bc2ad)
Reviewed-on: http://git-master/r/1252704
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Viswanath L
efd1112f5c tegra: adsp: Max ADSP clock at APM active
Spike ADSP freq. to max when app transitions to active so that ADSP
does not starve

Bug 200196267

Change-Id: I11863b2449cfecc47aefd9bc41059b634b3b2acd
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1154410
(cherry picked from commit 9e6163d9c1f2f07c9b4510d609aa974a75da96c7)
Reviewed-on: http://git-master/r/1236637
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
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