Commit Graph

4323 Commits

Author SHA1 Message Date
Viswanath L
7a1abcd3f1 tegra-alt: mvc: Updated mixer controls
Following updates:
 - "input bit format" ctl to set RX CIF bit-width
 - 100x scaling to "Vol" ctl for more granularity
 - Fixes in mixer ctl "get" functions so that current value is read
 - Fix in "Curve Type" ctl so that default volume gets set

Bug 1936284

Change-Id: Ib54b17266c7c3a3e9e42cab13195389c5fa1fbe7
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1497628
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
Viswanath L
725219888e tegra-alt: dmic: Add output bit-width control
"output bit format" ctl added to set TX CIF bit-width

Bug 1936284

Change-Id: Ifeec48c9c8adc50c5ec16c237b39451511a8ceb0
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1499297
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
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
Mohan Kumar
654d951c76 ASoC: tegra-alt: Dump APE register for debugging
Add support with a mixer control using which APE register
status can be dumped from userspace during an error or
while debugging.

Bug 200307023

Change-Id: I489bdaeeec16975a872b9b145a1672f3f4ef1928
Reviewed-on:http://git-master/r/#/c/1478879
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1499107
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Vandana Salve
e1e49b52f6 drivers: update kernel path to kernel/nvidia
Changing references of t18x/ to nvidia/
in linux-4.4

bug 200295104

Change-Id: I12013129e7d55434727f245c8de19d27e04cfdfc
Signed-off-by: Vandana Salve <vsalve@nvidia.com>
Reviewed-on: http://git-master/r/1462293
Reviewed-by: svcboomerang <svcboomerang@nvidia.com>
Tested-by: svcboomerang <svcboomerang@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
50217466ed ASoC: tegra-alt: Avoid reg access after shutdown
Below are the hypothetical scenarios
- Drivers are in suspend state while reboot and PCM Open call from
  userspace is received after driver shutdown [APE is power gated
  already]
- PM domain handling doesn't ensure proper functionality after driver
  shutdown is called

The change handles with the below fix
- ALSA PCM Open API first executes runtime resume of each driver.
  So need to prevent any reg access in runtime resume of drivers.
- ALSA PCM Open executes ADMAIF startup after runtime resume of
  each driver. If ADMAIF startup returns failure based on shutdown,
  PCM Open operation will fail, this will break PCM Open path and
  will ensure no further ALSA APIs/Callbacks are called.

Bug 200289815

Change-Id: Ia03e035569375f37ae4b0faa1a4593ce121d2354
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1475208
(cherry picked from commit 3361e95850563f3009a428bb1c01941ed069a7b0)
Reviewed-on: http://git-master/r/1492664
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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
Dipesh Gandhi
6b67bfa9a0 ASoC: tegra-alt: switch support for adsp
Change allows support to select one FE among allowed
FE's to be routed to ahub, with rest of the inputs
in drain mode.

Jira EMA-389

Change-Id: I31889a52d67390dcfbf0f2d391acd86bb76cd64e
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1331535
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Sameer Pujar
3f5db4388d ASoC: tegra-alt: adsp: callback func ptr for adma
There is a function exported from adsp os code, nvadsp_set_adma_dump_reg,
to set the function pointer for adma regdump callback.

This patch uses the above exported api and sets the callback to
tegra_adma_dump_ch_reg, which is implemented by adma driver.
This is done during tegra210_adsp_init.

Bug 200289390

Change-Id: If1c2826928d5e5d51a805ed0a2211c20a1ecf6f8
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1484830
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Shreshtha SAHU
81f6c7aac5 sound: tegra-alt: register ape-adma ISO_CLIENT only for t18x
Bug 200285287

Change-Id: I93a4cac1b5824db6c74fd833e83987c5c82cbbc9
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1463850
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
9a3f4fe1d7 ASoC: tegra-alt: unify tegra-alt driver
Unify adsp and i2s driver to support kernel unification.

Bug 200257345

Change-Id: Ic472c4fec0e1febf9b26a9a0ad67138329a25884
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1477310
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
f070dc4c40 ASoc: tegra-alt: ADMA channel property parsing
Add code to use the ADMA start channel number from DT
entry nvidia,adma_ch_start

Jira EMA-413

Change-Id: Iec098d133226f70e455dd8ff0b706636f678ab2f
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/1477152
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
104d2c7cea ASoC: tegra-virt-alt: Add 24 kHz support
Use SNDRV_PCM_RATE_KNOT instead of
SNDRV_PCM_RATE_8000_192000 to support 24 Khz
Sampling rate

Jira EMA-412

Change-Id: I05375f8203411d0366b7c0b5e2b4dca35d70342c
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/1475235
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Diwakar Paliwal
f2c8d09fea tegra-alt: adsp: Use devm_clk_get for t210
Use devm_clk_get for t210 during probe. This is
required for successful probe as t210 and t186
use common clock framework on K4.4.

Enable ADSP driver for t210 config.

Bug 200297206

Change-Id: I56a7f6196c07edb00548217fac1f69b03de3a882
Signed-off-by: Diwakar Paliwal <dpaliwal@nvidia.com>
Reviewed-on: http://git-master/r/1471996
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
af364ab0a2 tegra-alt: add drain feature
Change adds draining feature for adsp playback.
NULL-SINK's are used as dapm widgets for alsa
path completion.

Jira EMA-389

Change-Id: Ic4125fc4e1b6dab7f4886fe2ad2dfdefc6962209
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1327309
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Ahung Cheng
946277f5b6 ASoC: tegra-alt: add dma buffer size parse
Add dma-buffer-size parsing in device tree for pcm
driver to allocate required size for each pcm node

Bug 200299289

Change-Id: Ia579c66413912dd0ef7fda34cd47887eec3599f7
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Reviewed-on: http://git-master/r/1464607
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
bff751a2eb ASoc: tegra-alt: fix coverity
Change corrects:
1) Unsigned compared against 0
2) possible null pointer dereferencing.
3) Dereference before null check

Bug 200192143

Change-Id: Ib005e3bb808fb12cb5f8ee6911bd3c522c879b00
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1467216
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
9bdf181610 ASoC: tegra-alt: xbar unification changes
Unification changes for xbar driver to support all chips.

Bug 200257345

Change-Id: I291df54400e24a4a21b1490abb0c9f8ccef68116
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1286569
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
df7fa78105 ASoc: tegra-alt: increase adsp pcm dev
Change adds support to increase the number
of pcm devices exposed by adsp-alt driver.

Jira EMA-389

Change-Id: I34f23bd993c4d53619de7d74cad3c9dc2644afda
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1454052
Reviewed-by: Viraj Karandikar <vkarandikar@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
Dipesh Gandhi
7f5394e3f6 ASoC: tegra-alt: remove pcm ack dependency
Change remove dependency of ack by pcm ops to update
application pointer. MMAP mode can't be used with
ops ack. When trigger is called updated app pointer
info is passed to adma plugin. On adma period
completion callback, updated application pointer
is again passed to adma plugin.

Jira EMA-389

Change-Id: Iad1376cc218b2c7b49812db34e128ed43b10eddb
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1331554
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
76d48d8cd8 ASoC: 8 ch playback/capture support
Change adds support on adsp-alt:
- allows pcm_open for upto 8 channel.
- adds option to pass burst_size for HV
- allows BE to be configured with FE's params
  to be sent via ivc to audioserver.

Change-Id: Ib3ab3fb4d95bfc8335cd1d52eeb71cc4e5a538a5
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1317770
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
c85e969ca0 ASoC: tegra-alt: Unify the tegra-alt drivers
Unify the tegra alt drivers to support all chips.

Bug 200257345

Change-Id: Ie6bff2e421330b0fd9d1deb14f2afd1131d01a44
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1327760
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
30d77a84d6 ASoC: tegra-alt: Select ADSP if TEGRA_NVADSP is selected
SND_SOC_TEGRA210_ADSP_ALT depends on TEGRA_NVADSP so add condition
while selecting it.

As per Documentation/kbuild/kconfig-language.txt
select should be used with care. select will force a symbol to a
value without visiting the dependencies. By abusing select you are
able to select a symbol FOO even if FOO depends on BAR that is not
set.

Change-Id: Icb3824b93c4557ab730a06692b20c4e02784382e
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1326953
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2022-09-29 15:30:21 +05:30
Sharad Gupta
1317e44e89 ASoC: tegra-alt: ADMAIF driver unification
All chip ADMAIF header files are combined into one.
Modified the souce code to support all chipsets via
separate platform data structures. Chip specific parameters
are populated in the structure to beused at runtime.

Bug 200257345

Change-Id: Ib605e32e73ecc46e0a20ec4061149431035705e1
Signed-off-by: Sharad Gupta <sharadg@nvidia.com>
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1262332
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
Sameer Pujar
00ff1f7baa ASoC: tegra-alt: AFC driver unification
T210 and T186 ADMAIF header files are combined into one.
Modified the souce code to support T186 and T210 chipsets via
separate platform data structures. Chip specific parameters
are populated in the structure to beused at runtime.

Bug 200257345

Change-Id: If05ad85e96aec177310491616d082b50b7454331
Signed-off-by: Sharad Gupta <sharadg@nvidia.com>
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1266357
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
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