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>
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>
Build errors seen in following contexts with kstable:
- The 'non_legacy_dai_naming' flag is not available in struct
'snd_soc_component_driver' in v6.0. Instead it is replaced
with flag 'legacy_dai_naming' and default value works fine.
To fix build error on kstable exclude the removed flag for
kernel v6.0 onward.
- Signature of snd_soc_card_jack_new() has changed in v5.19
which drops struct 'snd_soc_jack_pins' related members. These
were unused for Tegra and is safe to just update the funcion
call. Fix this by using correct function signature based on
kernel version checks.
With above fixed now, remove workaround from Makefile and enable
Audio OOT driver builds again with kstable.
Bug 3831575
Change-Id: I7b65c89e8140f6e085528fb827d47c3909233db1
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2793430
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Following drivers are upstreamed (and present in v5.15) but not yet
feature complete:
tegra186_dspk.c
tegra210_admaif.c
tegra210_ahub.c
tegra210_dmic.c
tegra210_i2s.c
To use these drivers, device nodes in DT can use OOT specific
compatibles. Update compatibles in drivers to facilitate this.
Bug 3583581
Change-Id: I1a9e31fc5f1b2d2539f644a413ba0c06c6da2110
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2774435
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
OOT drivers cannot directly access private headers of core kernel.
This is a standard policy adopted by kernel distributors and to
workaround this problem copy headers to OOT path. Update the usage
references as well.
Bug 3583581
Change-Id: I1b99e17c60294a1cb257eb5b80837faa896d3f8d
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2774429
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
commit d6202a57e79d102271d38c34481fedc9d4c79694 upstream.
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the DSPK driver accordingly.
Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-11-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The simple-card or audio-graph-card mark the DAI links as codec2codec
if all the components in a link have "non_legacy_dai_naming" flag set.
Thus populate this flag for all codec components.
Bug 200692799
Change-Id: Iaf7a030a0603034a1c594b9952bd8dbcf0551ef8
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Some of the audio drivers have been upstreamed recently as part of
following series, https://lkml.org/lkml/2020/7/21/1357.
In upstream, DPCM solution is proposed which is different from what
is currently used in downstream. Hence there are conflicts related
to audio routing. To resolve the differences use 'CONFIG_TEGRA_DPCM'
checks. Once the DPCM proposal gets accepted and all remaining
drivers are updated to work with DPCM, the config and legacy routing
can be dropped.
K5.9 removes snd_soc_component_read and uses prototype
of snd_soc_component_read32. Hence update the call in tegra210_ahub.c
Bug 200597174
Change-Id: I9e563e3d8a62f335ba8c22397c0750bf29810d3d
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
sound/soc/tegra/tegra186_dspk.c:74:12: warning: 'tegra186_dspk_runtime_suspend' defined but not used [-Wunused-function]
sound/soc/tegra/tegra186_dspk.c:86:12: warning: 'tegra186_dspk_runtime_resume' defined but not used [-Wunused-function]
Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
The Digital Speaker Controller (DSPK) converts the multi-bit Pulse Code
Modulation (PCM) audio input to oversampled 1-bit Pulse Density Modulation
(PDM) output. From the signal flow perpsective, the DSPK can be viewed as
a PDM transmitter that up-samples the input to the desired sampling rate
by interpolation then converts the oversampled PCM input to the desired
1-bit output via Delta Sigma Modulation (DSM).
This patch registers DSPK component with ASoC framework. The component
driver exposes DAPM widgets, routes and kcontrols for the device. The DAI
driver exposes DSPK interfaces, which can be used to connect different
components in the ASoC layer. Makefile and Kconfig support is added to
allow to build the driver. The DSPK devices can be enabled in the DT via
"nvidia,tegra186-dspk" compatible binding. This driver can be used
on Tegra194 chip as well.
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1595134890-16470-7-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Following changes are pushed as part of this commit:
- Update copyright signature as per new format.
- Remove references to "_ALT_" in header macros.
- Fix copyright year for I2S, DMIC, DSPK, ADMAIF and XBAR drivers.
- Fix file name in source header for Machine Utility driver.
Bug 2845498
Change-Id: I18b040a9d48a86a33f3ac6b6932d55e81d6414ac
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2354014
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
For upstream initially ADMAIF and I/O modules are considered. And the
these drivers are rebased in previous commit. This patch tracks the
addition of DAIs in AHUB driver which are needed for other AHUB modules.
Bug 2845498
Change-Id: I16e04a3bcf1118d66a57da2db07c3155ec9fe1a3
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
AHUB and few components have been pushed for upstream review. Though the
changes are still under review, we can leverage the work done on upstream
5.x and use the same here on 5.4 kernel. This helps to align the downstream
code. Any changes that happen because of upstream review can be cherry
picked here. If we plan for any downstream changes, upstream patch needs to
be pushed to keep the code in sync.
As of today current snapshot is pulled from v3 of AHUB series,
http://patchwork.ozlabs.org/project/linux-tegra/list/?series=159664
Above series was worked on later versions of linux-next and hence following
are the changes required for porting back on 5.4
* tegra_pcm_new() and tegra_pcm_free() are exposed from tegra_pcm.c and
component driver callbacks use these.
* Callback functions required for snd_pcm_ops in component driver are
implemented by tegra_pcm.c
* With this ADMAIF driver need not register platform device with ASoC
core.
For components (AHUB, ADMAIF, I2S, DMIC and DSPK) the downsream code
differs in few aspects from the code that was pushed for v3. Some of them
are listed below.
* I2S driver in downstream implements startup()/shutdown() calls for DAI,
which does some setup related to pinconfig and regulators. The same is
true for DMIC and DSPK drivers as well.
* Downstream ADMAIF drivers makes bandwidth requests in startup/shutdown()
calls and has helper function for dumping registers. It also has
additional DAI interfaces which are used for ADSP audio.
* Downstream AHUB driver has DAI interfaces for connecting to all other
modules.
These differences will be cherry-picked as and when it is necessary.
Bug 2845498
Change-Id: Id374967ecae26f6b7334a959fb23308d383c15f2
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Tegra210 and later audio drivers have been using 'tegra-alt' directory
from the beginning. As per the upstream roadmap, we plan to use the
same 'tegra' directory and place all the drivers under it. This patch
thus moves all the drivers to 'tegra' and renames the files accordingly.
The '_alt' suffix is removed from header and source files.
For some files still the '_alt' suffix is retained because 'tegra'
already has the corresponding files. Manual merge of following files is
needed and will be done in separate commits.
* tegra_asoc_utils_alt.c and tegra_asoc_utils.c
* tegra_asoc_utils_alt.h and tegra_asoc_utils.h
* tegra_pcm_alt.c and tegra_pcm.c
* tegra_pcm_alt.h and tegra_pcm.h
* Corresponding Makefile and Kconfig files.
* Source files related to ADSP audio, FPGA, bandwidth manager are not
considered at the moment and will be tracked separately.
Bug 2845498
Change-Id: I51dae3971c72b58d921dc19f0553a83422fd3f9e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>