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>
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>
There was a plan to deprecate master volume control since it was thought
that per channel control will be sufficient and master volume application
can be emulated in user space by programming same volume to all channels.
But this means we would not really use a HW feature which has a provision
to automatically apply CH0 volume settings to all remaining channels.
HW has a per channel control bit, based on which it decides to apply a
channel specific setting or a common setting across all channels. Driver
has both master volume and per channel volume mixer controls. Based on
the control user updates, enable or disable the per channel control.
Use below scheme for volume updates:
* If master volume mixer control is updated, disable per channel control
and only CH0 volume register is programmed. SW can store same volume
across all channels.
* If a channel specific control is updated, enable per channel control
and program specific channel volume register.
Above applies to mute/unmute functions as well and thus corresponding
control blocks are similarly updated.
The volume settings are stored in SW and the same is used for the user
space queries via mixer controls. But mute settings are not stored in
SW and are always directly read from HW since it belongs to a volatile
register. The mute control read function is modified to return proper
settings when queried from user space.
Bug 200766084
Change-Id: Iad8b5c09c424731e841863bfd5ce32d07ff9e684
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2599601
Reviewed-by: Sheetal . <sheetal@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
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>
Similar to upstreamed AHUB drivers, follow standard naming convention
for MVC mixer controls. Right now there is no requirement to have
separate channel or bit format controls on input/output and AHUB/client
side. Single channel or bit format control is used for all. Hence rename
bit format control to look consistent with channel control.
Bug 200698314
Change-Id: I76976823d03ef3e3a47346aa928c11f9b26052c6
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Remove unused macros in MVC driver and use shorter names for remaining
macros wherever possible. This makes code look relatively compact and
cleaner. Also provide separate callbacks for readable/writable_reg()
and use register ranges for case statments.
Bug 200698314
Change-Id: Ia61a824fce5531b74b67b6ebf8e5216c7a982c17
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Some of the upstream comments on intitial driver upstream phase were
generic and are equally applicable to remianing set of drivers. Thus
following changes are made based on this:
- Remove explicit of_match_device() from drivers which don't have to
maintain chip specific data.
- Replace both platform_get_resource() and devm_ioremap_resource() with
a single API devm_platform_ioremap_resource().
- Use devm_snd_soc_register_component() and re-order pm_runtime_enable()
in probe() function. The remove() path need not explicitly unregister
the component.
- Use 'err' variable instead of 'ret' for function returns and error
checking.
- Remove explicit runtime_suspend() call from remove() path.
- Use consistent error print patterns across drivers
- Some cosmetic changes
Bug 200698314
Change-Id: Id53420aab863062d7a5cf4aa5171b1af038ce83f
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
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>
This reverts commit 9ac3457ed88631ef035fe9aa6baa4ce0cf2d5d5d
There are some conficts mainly because the revert is being done
on 5.4 kernel drivers and these are resolved manually.
Tegra can support S24_LE and the way it works is as follows.
* S24_LE is a 32-bit container with 24-bit data in LSBs and the
DMA is configured for 32-bit.
* When ADMAIF client channel is configured for 24-bits, it picks
up 24-bit(starting from LSB) from the ADMAIF FIFO. Higher 8-bits
are sign extended.
Earlier the confusion was primarily because of the way data gets
picked up from FIFO and the way data conversion happens at CIF.
Bug 200590182
Bug 2845498
Change-Id: Icd0d9fb8fdd0a08d39cb45d23b3f441eaba5a98c
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.4/+/2308468
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@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>
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>