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>
- Change the Mixer, AMX, ADX, ASRC, OPE, MVC and SFC dai names
as per upstream.
- Split Mixer, ASRC, OPE, MVC and SFC input and output names to
RX and TX
Note -
As per downstream kernel code there will be routing issue
if DAI names are updated for SFC, MVC and OPE input and
output. Due to that added those modules output DAIs just to keep
similar to upstream kernel. Single DAI is used for input and
output for SFC, MVC and OPE.
Bug 3592105
Bug 3896761
Signed-off-by: Sheetal <sheetal@nvidia.com>
Change-Id: I1bcc141627b9123c4c3921c87c279dbd41f757bc
(cherry picked from commit ae0f5a2b7cfc56b5c53f05aca50fb5f32bac7eca)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2835313
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2856573
Tested-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@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>
Make sure to call pm_runtime_enable() before the
of_platform_populate() which will ensure ahub runtime
resume would be called to enable ahub clock before accessing
any ahub modules registers in modules probe. Calling
of_platform_populate() in parent driver probe results in all
of its child device probe to be completed before it exits the
parent probe call.
The issue caught during MVC child device probe tries to access a
register in probe call which depends on the ahub clock that gets
enabled during AHUB RPM resume. But ahub RPM resume not called as
pm_runtime_enable() in ahub parent driver happens after the
of_platform_populate(). This was observed when drivers were built
as part of kernel image.
Bug 3752938
Change-Id: Ifeb4085961d89877f79ff521adb6dfdf4e51907c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2762027
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
commit a4e37950c9e9b126f9cbee79b8ab94a94646dcf1 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 AHUB driver accordingly.
Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-12-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- The issue was happening because dapm core was not deallocating
the hw contraints rules memory.
Memory leak backtrace from cat /sys/kernel/debug/kmemleak:
[<0000000046fdaf4f>] slab_post_alloc_hook+0x6c/0x3e0
[<00000000989dfc0e>] __kmalloc_track_caller+0x1b8/0x400
[<00000000505e39ec>] krealloc+0xe8/0x160
[<000000009cc82a21>] snd_pcm_hw_rule_add+0x164/0x1a0
[<00000000aa77851e>] snd_pcm_hw_constraint_list+0x28/0x30
[<000000009b2cd5c6>] tegra210_ahub_write_ram+0xa8/0xb60
[<00000000a61d7069>] snd_soc_dai_startup+0x40/0xa0
[<00000000a7452879>] snd_soc_dai_link_event+0x334/0x600
[<000000008c5771de>] dapm_seq_check_event+0x120/0x330
[<00000000be740a3d>] dapm_seq_run_coalesced+0xb0/0x250
[<0000000003732007>] dapm_seq_run+0xf0/0x510
[<00000000cbb85eb0>] dapm_power_widgets+0x58c/0xac0
[<00000000b96c5548>] snd_soc_dapm_stream_event+0x128/0x170
[<0000000027bb14bc>] soc_pcm_prepare+0x70/0x110
[<00000000d44b9075>] snd_pcm_do_prepare+0x34/0x50
[<000000005664d4d5>] snd_pcm_action_single+0x4c/0xa0
- For BE dais HW constraints won't take any impact and only for FE
dais it is required. So added it in component driver open callback.
Bug 200773796
Signed-off-by: Sheetal <sheetal@nvidia.com>
Change-Id: Ic4c1bf881b914bda03bda8e97816cf1c6dee4052
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2596443
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@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
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
- Fix the issues with 24KHz and 64KHz sample rate.
- In machine driver, 24KHz and 64KHz were not supported, add
the rates into the list.
- 24KHz is not supported by ALSA, to support it mentioned dai rates
as SNDRV_PCM_RATE_KNOT. Using KNOT chip can support unconventional rates,
defined in hw constraints list.
- The change is added for FE links only, for BE links its not required as
it will be taken care by FE links.
Bug 200757915
Change-Id: I348368420316ba78b303cd27a413048b6cab2dd7
Signed-off-by: sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2571687
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
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/tegra210_ahub.c:567:12: warning: 'tegra_ahub_runtime_suspend' defined but not used [-Wunused-function]
sound/soc/tegra/tegra210_ahub.c:579:12: warning: 'tegra_ahub_runtime_resume' defined but not used [-Wunused-function]
Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
The Audio Hub (AHUB) comprises a collection of hardware accelerators for
audio pre/post-processing and a programmable full crossbar (XBAR) for
routing audio data across these accelerators in time and in parallel.
AHUB supports multiple interfaces to I2S, DSPK, DMIC etc., XBAR is a
switch used to configure or modify audio routing between HW accelerators
present inside AHUB.
This patch registers AHUB component with ASoC framework. The component
driver exposes DAPM widgets, routes and kcontrols for the device. The DAI
driver exposes AHUB interfaces, which can be used to connect different
components in the ASoC layer. Currently the driver takes care of XBAR
programming to allow audio data flow through various clients of the AHUB.
Makefile and Kconfig support is added to allow to build the driver. The
AHUB component can be enabled in the DT via below compatible bindings.
- "nvidia,tegra210-ahub" for Tegra210
- "nvidia,tegra186-ahub" for Tegra186 and Tegra194
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1595134890-16470-6-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>
Following AHUB modules are considered as part of this series. This updates
all drivers to use component structure. Initially AHUB, I2S, DMIC, DSPK
and ADMAIF drivers were updated.
FPGA code is removed from the related drivers. This can be cherry-picked
if it is really required.
Bug 2845498
Change-Id: Ia3f60257c225d281d86ad83325fb517969259cb4
Signed-off-by: Sameer Pujar <spujar@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>