DAI links are getting parsed in a reverse order with Kernel OOT,
where the DAI link nodes are now defined in overlays which gets
applied to the upstream DTB. Due to this PCM and compress devices
get a very large number which makes existing applications fail.
This seems to be expected as the overlay subnodes are merged just
after the parent properties. Each subnode comes just after the
properties. Because of this the later merged subnodes come before
the earlier merged nodes and eventually the DAI link nodes, in
this case, get reversed.
Given above it would be better to not assume DAI link node order.
To fix this use full name of DAI link nodes and identify the DAI
link index from it during parsing in kernel. The DAI link nodes
are named as 'nvidia-audio-card,dai-link@<xxx>', where <xxx>
signifies link index. Parse this info and store it under DAI link
ID. With this the PCM and Compress device IDs do not depend anymore
on the parsing order of DAI links.
Bug 3583581
Change-Id: I3d0e7ed9fb0edfe1f066e12527b44a85c2716df0
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2776061
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Upstream Linux kernel commit 3989ade2d1e7 ("ASoC: soc.h: remove
num_cpus/codecs") removes the 'num_cpus' member from the
'snd_soc_pcm_runtime' structure because this is also available under the
dai_link structure. This breaks building the Tegra ASoC drivers for
Linux v6.1 and so update the Tegra ASoC drivers to align the latest
mainline. Note that this also works for earlier kernel versions and so
no need to check for kernel version.
Bug 3835208
Change-Id: Ib846e937d761b65276ace73f7817ef8bd21c21d8
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2795754
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
- Added mutex protection for init_done flag reads in
mixer control callbacks relevant to "ADSP init". Otherwise
during shutdown sequence that includes alsa store service,
this leads to inconsistent behaviour
- Shutdown callback is added to deinit ADSP OS during
abrupt shutdown.
- In case ADSP OS is crashed during boot/boot has not
started yet, shutdown does not issue OS deinit as
init is not complete yet
Bug 3391964
Change-Id: I207e2141af9386f5914e07a8dd231d0fcd803a6e
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2607727
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
On later kernels 'snd_pcm_ops' structure is removed from the
'snd_soc_component_driver' and instead explicit callbacks were
provided in the component driver structure. In doing so ack()
callback was left out for PCM interface. This was probably
intentional because there are currently no users for this
callback in upstream.
But in downstream we have ADSP audio driver which relies on
this callback to communicate buffer positions with ADSP and
currently DMA transfer is not happening due to missing ack()
callback. Issue is fixed by exposing ack() callback from the
core.
Bug 200568556
Change-Id: I76e9fcf21e087bb2c470868a2bd1eb668345e382
Reported-by: Asha Talambedu <atalambedu@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2414392
Tested-by: Asha Talambedu <atalambedu@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Resolve linux-5.8-rc3 merge conflicts in k5.9 branch
(currently tracking mainline with linux-5.7.0)
Fix build errors in k5.9 branch after merge of linux-5.8-rc3
bug 200617764
Change-Id: I3a358fef6e8b7c5926fd0de05a03cee539547e8f
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Commit 209e5c7b4144 ("drivers: fix k5.9 build errors") fixes few build
errors, associated with audio, which are required for initial kernel-5.9
setup. However there are functional issues on TOT, where APE sound card
registration fails. The root cause of this problem is because of below
listed changes in ASoC core:
- 'snd_soc_ops' member is removed from 'component_driver' structure.
The PCM callbacks now have to be directly populated in the component
driver structure. ADMAIF and ADSP drivers are updated and Tegra PCM
driver is cleaned up accordingly.
- 'of_node' and 'dev_name' members are removed from 'snd_soc_codec_conf'
structure now and instead wrapper for these is provided under 'dlc'.
- Signature of 'snd_soc_get_pcm_runtime()' has changed now and it no
more accepts DAI link name as argument. But since we require specific
'rtd' based on DAI link names, the older version is duplicated in
machine driver.
- There are changes in trigger() order for start and stop now.
*_trigger_start()
|
|--> rtd trigger()
|--> component trigger()
|--> dai trigger()
*_trigger_stop()
|
|--> dai trigger()
|--> component trigger()
|--> rtd trigger()
Above is resulting in following:
|-> start ADMA
|-> start ADMAIF
|-> ...
|-> stop ADMAIF
|-> stop ADMA (unable to stop DMA channel print is seen here)
Current order in downstream for previous kernel versions is:
|-> start ADMA
|-> start ADMAIF
|-> ...
|-> stop ADMA
|-> stop ADMAIF
This issue is addressed by invoking DMA trigger() call from ADMAIF dai
trigger() itself to avoid the error during stop.
Bug 2845498
Change-Id: I1011555f51f5e0b0a448125a46b47df50e366d6f
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2353304
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This patch registers ADSP device as a component with ASoC core. Necessary
changes are made to work with 5.4 kernel and driver need not register a
separate platform and codec device.
Along with this following cleanup is done:
- Move driver to 'tegra' directory.
- Wherever possible, fix ACV issues in the driver. Not all of them can be
fixed at the moment.
Bug 200593718
Change-Id: Ic60c7f59095bbe9f84d25077e4d4469544ca7783
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.4/+/2342897
(cherry picked from commit d927c5daa951a58924e25d32b8002eb682e43aa0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2353303
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit