Commit Graph

11 Commits

Author SHA1 Message Date
Jon Hunter
52a4903b87 ASoC: tegra: Fix build for Linux v6.13
In Linux v6.13, commit 1bd775da9ba9 ("ASoC: add symmetric_ prefix for
dai->rate/channels/sample_bits") added a 'symmetric_' prefix to some
member of the 'snd_soc_dai' structure. Use conftest to determine if
these structure members have the 'symmetric_' prefix and update the
Tegra Mixer Control driver accordingly.

Bug 4991705

Change-Id: I366595f31932caaa447033c0d0e3b1d2b8dba6e3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261697
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:11 +00:00
Sheetal
1dfa6285d3 ASoC: tegra: T264 in tegra mixer control driver
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>
2025-07-24 10:19:09 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
951b2423a8 drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update all the impacted drivers
as necessary to fix this.

Bug 4749580

Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-11 17:20:34 -07:00
Sameer Pujar
33a45472ab ASoC: tegra: Add I2S controls for format/mode
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>
2024-04-19 00:18:59 -07:00
Sameer Pujar
0332fd555e ASoC: tegra: fix sound card dependency
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>
2024-03-07 21:47:19 -08:00
Sameer Pujar
b0b6f09a6d Revert "Revert "ASoC: tegra: use upstreamed AHUB drivers""
This reverts commit 1d0f4c4ffc.
This is done to restore original commit of using upstreamed AHUB
drivers as the GVS intermittency issue is now root caused.

Bug 4508166

Change-Id: Iae064f8dae4cf79c639f060c3e24bda43a82b201
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3083109
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-03-07 21:47:09 -08:00
Sameer Pujar
1d0f4c4ffc Revert "ASoC: tegra: use upstreamed AHUB drivers"
This reverts commit 363a679975.
This is done to unblock gvs intermittency of audio test and
kernel warning test failure.

Bug 4508166

Change-Id: I99e2b879c7ba1c7987d859b4ae9fce0ea317e41e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3082636
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Shubham Chandra <shubhamc@nvidia.com>
2024-02-23 08:27:14 -08:00
Sameer Pujar
363a679975 ASoC: tegra: use upstreamed AHUB drivers
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>
2024-02-20 18:40:04 -08:00
Jon Hunter
ab65399274 drivers: Fix missing headers for Linux v6.8
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>
2024-01-25 09:11:21 -08:00
Sameer Pujar
2a68fff8b8 ASoC: tegra: Add driver for DAI PCM overrides
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>
2024-01-15 09:01:45 -08:00