Building the tegra-virt-alt driver with Linux v6.13 fails because some
of the header files are not found ...
sound/soc/tegra-virt-alt/tegra210_virt_alt_admaif.c:17:10: fatal error:
tegra_pcm_alt.h: No such file or directory
17 | #include "tegra_pcm_alt.h"
| ^~~~~~~~~~~~~~~~~
The 'tegra_pcm_alt.h' header is located in a 'include' sub-directory and
although the cflags add this path for find headers, the header is not
found because the '#include' of the file uses double-quotes and not
"<>". This could be fixed by simply updating the file with
'#include <tegra_pcm_alt.h>'. However, reviewing the code it simplifies
the Makefile to remove the 'include' sub-directory and directly include
the header files. Similarly, we can remove the search path of the
'nvaudio_ivc' headers and directly include these.
Bug 4991705
Change-Id: I1993d1f619698f33fc9edab05ad9235334fd3b5b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3260938
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
- Rename the mixer controls to match with L4T mixer controls.
- As most of the controls are matching between t234 and t264,
the difference controls are added as part of component driver
probe.
- Comment ARAD and regdump controls as ARAD and regdump are
non-functional currently.
- Remove unused controls. MIXER, ASRC and AMX Enable controls are
not required to be set explicitly as AudioServer handles this.
Bug 4796520
Change-Id: Ia6fdd507819b1b354544b2b1217d9aa399e106b9
Signed-off-by: Sheetal <sheetal@nvidia.com>
- Defined the 32 dai-links for T264.
- Add T264 soc_data to fetch the number of channels based on soc.
Jira TAS-2331
Change-Id: I75b331ef34b8015b30ec48c72e6adceded10924b
Signed-off-by: Sheetal <sheetal@nvidia.com>
Add I2S, AMX and ADX controls as chip specific data to fetch
controls based on Max number of channels supported by chip.
Jira TAS-2387
Change-Id: Ieac8f7d55581856a595ffff093fa9d1b8ef493f9
Signed-off-by: Sheetal <sheetal@nvidia.com>
- CIF register bitmask is updated in T264, it is mandatory
to update it for T264 audio usecases.
- With this change all T234 AHUB usecases can be verified.
TAS-2330
Change-Id: I9b64fcb5725bfd4dd01ef29466f7255bdfd6a53f
Signed-off-by: Sheetal <sheetal@nvidia.com>
Upstream sound card machine driver is used now and legacy machine driver
is not required anymore. Hence following cleanups are made:
- Remove legacy machine driver 'tegra_machine_driver.c'.
- With legacy driver removal many of the APIs in tegra_asoc_machine.c
are not required. So remove all such APIs and update the header file
as well.
- The ASoC utils 'tegra_asoc_utils.c' is not needed after removal of
legacy machine driver. Remove the corresponding header as well.
- BW manager support needs to be pushed in upstream and it is needed
for ADMAIF and ADSP ASoC drivers. The downstream BW manager code
can't be used by the ADMAIF driver. So remove downstream BW manager
code and put FIXME item in ADSP driver.
Bug 4596865
Change-Id: Iac154b00759571a5593c3d75bbacbae5a68385e2
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3110862
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Added ADSP audio driver support for tegra soc and tegra virt alt.
Below are the changes made with respect to Kernel 5.10:
- Removed the ADSP COMPR DAI links due to differences in compress DAI
link registration in Android (ACK 6.6) which causes build issues.
- Omitted the callback function for dumping ADMA registers, as the
upstream ADMA driver does not support it.
Bug 3910602
Bug 4635899
Change-Id: I63ea878ef2e9a960d127d02470e8048535878518
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3132128
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
There are test cases in ap_audio, which check for different data
formats and producer/consumer modes for Tegra I2S and external
codec I2S. Add these controls for a full GVS coverage.
Two types of DAI links are handled:
- Normal/codec2codec DAI links where the DAI mapping is done
by default between Tegra and external codec I2S. So just
calling legacy tegra_machine_add_i2s_codec_controls() API
from override driver is good enough.
- For DPCM case, the DAIs are not directly mapped and thus
codec is dummy for Tegra I2S. Hence for this DAPM function
snd_soc_dapm_dai_get_connected_widgets() is used to find
the connected codec widget and apply the complementary DAI
format setting.
Also use this opportunity to cleanup Linux version code check.
It is now recommended to define a macro for the relevant kernel
version and macro name is related to what actually is changing
for a kernel version.
Bug 4451662
Bug 4453772
Change-Id: I881838411af5498e4d7f1dec76b3c11ad05de12b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3097585
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
When booting kernels that have both the upstream and out-of-tree audio
drivers for Tegra present the following errors are observed ...
Error: Driver 'tegra210-ahub' is already registered, aborting...
Error: Driver 'tegra210-amx' is already registered, aborting...
Error: Driver 'tegra186-dspk' is already registered, aborting...
Error: Driver 'tegra210-mvc' is already registered, aborting...
Error: Driver 'tegra210-adx' is already registered, aborting...
Error: Driver 'tegra210-ahub' is already registered, aborting...
Error: Driver 'tegra210_mixer' is already registered, aborting...
Error: Driver 'tegra186-asrc' is already registered, aborting...
Error: Driver 'tegra210-dmic' is already registered, aborting...
Error: Driver 'tegra210-i2s' is already registered, aborting...
Error: Driver 'tegra210-admaif' is already registered, aborting...
The problem is that the upstream Tegra audio drivers are loaded first
and then the kernel attempts to load the out-of-tree variants because
they have a different name. The out-of-tree are installed under the
'updates' directory in the file-system and by dropping the 'oot' suffix
from the driver name, then depmod will not attempt to load both variants
of the audio drivers and prioritise loading the drivers in the 'updates'
directory.
Bug 4590647
Change-Id: I6c6fe1eb84bc9fdfa4a8f4abf1ce3a75f3bfba8a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3110266
(cherry picked from commit fc8c410eb6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3112030
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
1. Add BUILD.bazel file.
2. Add build target of kernel module and required include folder
srctree.* in Makefile to fix the build issue
3. The tr (a build tool defined by kleaf in the sandbox) which
supported by toybox will cause the conversion of header files
to file_define to fail. Fixed it by separating with two tr
commands.
Bug 4344670
Change-Id: I56dcc148960f3b7703335943281589f42caa9af7
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066225
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
There is GVS intermittency where few audio tests fail because there is
no APE sound card available. The card registration itself does not
happen because there is kernel data abort and following dump is seen:
[ 36.163223] Unable to handle kernel paging request at virtual address ffffffffffffffc0
[ 36.171180] Mem abort info:
[ 36.171182] ESR = 0x0000000096000004
[ 36.171183] EC = 0x25: DABT (current EL), IL = 32 bits
[ 36.171186] SET = 0, FnV = 0
[ 36.174218] EA = 0, S1PTW = 0
[ 36.174219] FSC = 0x04: level 0 translation fault
[ 36.174221] Data abort info:
[ 36.174222] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[ 36.174223] CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 36.174224] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 36.174226] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000813b67000
[ 36.174228] [ffffffffffffffc0] pgd=0000000000000000, p4d=0000000000000000
[ 36.174234] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
This seems to happen because mixer control override driver has the
dependency over the sound card and this dependency check is incorrect.
The attempt is made to register override controls before the sound card
is fully ready.
One option is to use 'card->instantiated' flag to add the dependency.
However this flag update is protected by card mutext and client_mutex
which is local to the core. So this flag check does not appear fully
reliable.
As a safer option, the override device is made child of sound device.
This way the probe order is ensured and override probe happens only
after a successful sound probe. This requires a change in machine driver
to allow probe() happen for child devices. This may be a concern during
usage of upstream machine driver which does not have provision for child
device probing. For now unblock the upstream AHUB usage by using this
safe option and investigate the best option to make the override driver
independent.
Bug 4508166
Bug 4451662
TAS-2251
Change-Id: Ib13f0a3a0ac272a0f2325b9d74efbc31128f0991
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3083180
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Most of the AHUB module drivers are already upstreamed and there are
alternate ways to have the same feature parity with the legacy OOT
drivers. Thus there is no need to maintain the legacy OOT drivers
going forward. This commit removes all AHUB drivers which are already
in upstream and the same have been enabled as a default choice for
Terga234 and later chips.
Removal of OOT versions of upstreamed drivers resulted in following
build errors:
- AFC, IQC and machine driver include "tegra210_ahub.h". Due to
the removal of AHUB driver, the header is not found. It is found
that there is no actual dependency for these drivers on the AHUB
header.
Fix this by just removing the header inclusion.
- ARAD driver has dependency on ASRC driver for few helper functions.
Upstream ASRC driver does not expose these helpers yet, because
these are only required by ARAD module and all of these should go
together for upstream.
Fix this build error by guarding the header 'tegra186_asrc.h'
under macro 'CONFIG_SND_SOC_TEGRA186_ASRC_WAR'. The helper function
calls in ARAD driver are guarded under the same macro and this macro
is not enabled. This may leave ARAD broken with upstream ASRC driver
which is fine since there is no ARAD productization yet and this
will be taken care in bug 4432184.
Bug 4451662
Bug 4432184
TAS-2251
Change-Id: I5aa9ee1ae5ce58f3db8910f7e940dd2980da163a
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3074654
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Sheetal . <sheetal@nvidia.com>
Reviewed-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-by: Aditya Bavanari <abavanari@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
There is plan to use OOT machine driver with upstream AHUB drivers
as a first step in alignment with upstream drivers. The machine driver
will be taken up after this.
To allow usage of upstream AHUB drivers, make following changes:
- Update OOT PCM override driver to work with codec2codec links
as well. Note that PCM override controls in the module drivers
were rejected in upstream and it is one of the major differences
between upstream and OOT AHUB drivers.
- Register dummy DAI to use with I/O DAP DAI link. Exposure of
dummy DAIs was not encouraged in upstream from the I/O module
drivers. The codec2codec I/O links require a codec to be present.
Hence expose dummy DAI from machine driver and use the same in
I/O DAI links.
Bug 4451662
TAS-2251
Change-Id: If6904073eca29167620bf5d273cdcd306196f6ba
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059819
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.
Bug 4448428
Change-Id: Ia40ab13f865d5631c96855ecc49145848f99c996
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032442
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Tegra audio uses multiple ASoC components in an audio path. In doing
so, each component may require a separate set of DAI PCM configurations.
Presently this is facilitated by exposing mixer control overrides from
each of the component drivers to override sample rate, channels or bits.
Above satisfies our needs. However this type of solution is rejected by
upstream maintainers. The suggestion is to not bypass the configurations
passed by ASoC framework via hw_params() calls.
With kernel OOT model gaining momentum in downstream, we are stuck with
partially upstreamed drivers where above mentioned feature is an
important missing item.
This commit adds a new driver to override DAI PCM parameters. Idea is to
use this as an OOT driver and insmod it for our downstream applications
or for testing.This comes with few limitations, mentioned below, which
is fine looking at the overall requirements.
- Client overrides are not possible for AHUB internal modules. This is
because DAI hw_param() call can carry one configuration and thus
both XBAR and client setting overrides are not possible.
- No overrides are provided for ADMAIF. The client configuration is
passed by aplay/arecord applications and DAI hw_param() call carries
the same.
- The DAI overrides need to be set every time before any use case and
these are not persistent. This is because when an use case ends ASoC
core clears DAI runtime settings. If necessary, it can be improved
later by storing all DAI settings in the driver.
This driver is intended to be used on both DPCM/DAPM solutions.
Bug 3583581
Change-Id: Ia05316a10eb9c298f2a56d2ef3ccaa37c5985ddd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3043569
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Use conftest to find if struct snd_soc_dai_ops have the probe()
callback or not. In Linux 6.5, commit 516ee7009ff20 ("ASoC:
tegra: merge DAI call back functions into ops") added probe()
callback into the struct snd_soc_dai_ops.
Bug 4346767
Change-Id: If292f10d6e52a2cf80c7700ff7aba5805041531f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028743
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.
Note that the function snd_soc_dai_init_dma_data() has been present
in the Linux kernel since v3.13 and so use this for all kernel versions.
In Linux v6.3, the 'playback_dma_data' and 'capture_dma_data' members of
the snd_soc_dai_driver structure were replaced and so these could no
longer be set directly. However, the arguments to
snd_soc_dai_init_dma_data() have not changed and so can be used for
older kernels and well has the current.
This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.
Bug 4221847
Change-Id: Ibac0c6bab78e93f03981dfe3d1b2025ea19d4c92
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993795
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.5, the arguments to the function snd_soc_of_get_dai_name()
were updated and this is causing the Tegra ASoC machine driver build to
fail. Add a new test to the conftest script to check the arguments for
snd_soc_of_get_dai_name() and use the definition generated by the
conftest script accordingly.
Bug 4221847
Change-Id: I32772da12ab59eb09e2f9d8bc66471d859201f8e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990531
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.4, the 'params' member of the snd_soc_dai_link was replaced
with the 'c2c_params' member. Add a new test to the conftest script that
checks if the 'c2c_params' structure member is present and use the
definition created by conftest to select which structure member is used.
Bug 4221847
Change-Id: I7ebb4187fd1cd70097bf65409bda3b2a6830a303
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989731
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
It is nice to have downstream DTB working well with upstream kernel
drivers. This gives a flexibile option for users to choose between
out-of-tree and upstream audio drivers by selectively adding either
of these to deny list.
For clock PLLA_OUT0, upstream DT uses 'plla_out0' clock name where
as downstream uses 'pll_a_out0'. So aligning with upstream DT makes
probe to fail. Thus update the clock name in driver to match upstream
DT bindings.
The sound DT supports compatibles to either work with upstream or
downstream machine drivers. Earlier the source 'tegra_codecs.c' was
modified to make it potentially usable for upstream machine driver
as well and thus it has upstream compatible checks. This check is
now replaced with a flag which is known to be set only during
upstream machine driver probe.
Bug 4119612
Change-Id: Icd5d97343029e35a5702ff4dc527881fb9277346
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2948525
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Kernel OOT audio support uses different compatibles to pick specific
OOT drivers for audio. This method requires additional compatible
overrides in the DT overlay which is not a very flexible way to pick
driver modules.
It is possible to pick specific driver modules by adding the not
needed ones to the denylist in the configuration files in the
'/etc/modprobe.d/'. This means different compatibles are not
necessary and modules can be filtered based on the name in
configuration files. With this it will be easier to switch between
driver modules and also will reduce the overrides in the overlay.
Thus remove all 'oot' reference from the driver compatibles.
Bug 4119612
Change-Id: I9496a7daf8b9c75c68b83557198a59f7d3903522
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2927028
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sheetal . <sheetal@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Tested-by: Sheetal . <sheetal@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
When building the out-of-tree drivers with virtualization support
disabled, symbols for some of the virtualization functions are not found
...
nvgpu: Unknown symbol tegra_hv_mempool_unreserve (err -2)
nvgpu: Unknown symbol is_tegra_hypervisor_mode (err -2)
nvgpu: Unknown symbol tegra_hv_mempool_reserve (err -2)
nvhost_pva: Unknown symbol is_tegra_hypervisor_mode (err -2)
mc_utils: Unknown symbol is_tegra_hypervisor_mode (err -2)
mc_utils: Unknown symbol is_tegra_hypervisor_mode (err -2)
Update the hv-ivc.h header to ensure that these function stubs are
defined when virtualization support is disabled and only build the
hv-ivc driver if virtualization is enabled.
Finally, move populating the ccflags to the top-level Makefile and use
the subdir-ccflags directive to ensure the ccflags are passed to all
sub-directories.
Bug 4159372
Bug 4170085
Change-Id: I35edb91007524c3143dff7564f9ad545bd34e969
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921199
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Upstream Linux commit ("3653480c6812 ASoC: soc-dai.h: cleanup
Playback/Capture data for snd_soc_dai") removes the capture_dma_data
and playback_dma_data variables from snd_soc_dai structure and this
breaks building the Tegra210 ADMAIF driver. Fix this by using the
appropriate API for Linux v6.3.
Bug 4014315
Change-Id: I76c8401571130a3d7ebaecacdfc299d59c1eaf8e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2867123
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>