Trivial clean-up to the tegra_alt_asoc_utils_init() function to improve
readability and simplify by ...
1. Removing 'goto' statements because we only return the error code on
error and there is no clean-up that needs to be done in the error
path.
2. Move the code to request the clk_cdev1_rst reset from under the
"data->soc > TEGRA_ASOC_UTILS_SOC_TEGRA210" check because we only
use this reset for Tegra186 and there is an additional check for this
device.
Bug 1665446
Change-Id: I23aa8978721f677204a929c8fdebea1f9081793f
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016370
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The function tegra_alt_asoc_utils_set_parent() is only used by the Orca
Viper machine driver. Update the Orca Viper machine driver to use the
tegra_alt_asoc_utils_set_extern_parent() instead which also sets the
extern parent clock and remove the redundant
tegra_alt_asoc_utils_set_parent() function.
Please note that the Orca Viper platform is no longer supported and in
future will be removed.
Bug 1665446
Change-Id: I51ac355e92a1c3dbb65f94bff081edd1837f7bc6
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016369
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Remove unused variables for the various Tegra sound driver files. Note
that these variables are not flagged by the compiler because they are
initialised but they are not actually used anywhere.
Bug 1665446
Change-Id: Id10bb316780813565847492b19025ba369188c09
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016368
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
enable dma_set_mask_and_coherent call even
if CONFIG_SND_SOC_TEGRA210_ADSP_ALT
is not enabled, This will allow pcm
driver to start allocations start from the
specified address and downwards.
Bug 200423087
Change-Id: Ib1a2f2361f15d1191258fbb0ca4a620d1b2a7c8b
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1809568
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Not all platforms have to support modules such as AMX, ADX, MVC, and
etc, so selecting all the audio modules by default is wasting memory
for them.
This patch drops DMIC, AMX, ADX, AFC, MVC, OPE and ADSP from CONFIG
SND_SOC_TEGRA_T210REF_MOBILE_ALT, and keeps only essential ones. In
order not to break any exisiting use case, these CONFIGs will be set
to "def_tristate" so all platforms build them as usual. This means
anyone who does not need them will need to specifically disable them
in the defconfig.
Meanwhile, this patch adds IS_ENABLED() check at corresponding files.
Bug 2284925
Change-Id: I2e3853b5499046fc8de7256899c30d764160aebe
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1803446
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Suspending all the DAI links for Tegra on entering suspend is taking
between 1-2 seconds which is far too long. To ensure that any active
audio playback and/or capture resumes following suspend, it is only
necessary to suspend the DAI links for ADMAIF and it is safe to set
the '.ignore_suspend' flag for all the other DAI links.
With this change the min/ave/max time for executing the 'snd_soc_suspend()'
function is reduced from 419ms/1056ms/2021ms to 49ms/287ms/766ms. This is
measured using the ftrace function graph feature to measure the total time
for 'snd_soc_suspend()' to execute.
Bug 200390943
Change-Id: I498643eb069a1bc72d72b86930ab5b6e54e44b76
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1799943
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
For debug/testing purposes the Tegra audio machine driver creates a
'Jack-state' mixer control to allow the user to query/set the jack
state. Currently, the machine driver assumes that there is only one
jack, but on Galen there can be two jacks if the supermodule is used.
Therefore, add a helper function to create the 'Jack-state' mixer
control dynamically and append the codec prefix-name to the mixer
control name so that it has a unique name.
Bug 2187533
Change-Id: Iac4351c319944e3d2c01d053fce9ea390c3f8db1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1748232
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Initialise snd_soc_dapm_update struct with NULL
to avoid kernel panic
Commit e411b0b5eb9b ("ASoC: dapm: Support second
register for DAPM control updates") introduced a
2nd register set into the snd_soc_dapm_update struct
and if the 'has_second_set' is not initialised
then it tries to access bogus register.
bug 200406253
Change-Id: Ic18ba2bb990c1c13f595305a05e4fc60a4b0baee
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1697229
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
To validate I2S TDM modes (such as dsp-a and dsp-b) on the Jetson TX2
we can jumper wire the I2S1 interface to the I2S2 interface and use
one I2S interface as the master and one as the slave. However, to test
TDM modes we need to re-configure both the I2S framing mode (dsp-a,
dsp-b, etc) as well as the I2S bit-clock and frame-sync master/slave
settings from userspace. Add kcontrols for re-configuring the frame
mode and master mode settings for I2S1 and I2S2 on the Jetson TX2.
Bug 2046053
Bug 1993721
Bug 200356303
Change-Id: Ifab626e9c92bf8e80a1797ea8f0f56d2232e8073
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1676733
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The functions tegra_machine_get_bclk_ratio() and
tegra_machine_get_bclk_ratio_t18x() have a return type of unsigned int
but can return a negative error code on failure. This may cause users
of this function to get a very large bit clock ratio. Although it is
improbable that the bit clock ratio will ever be large enough to
overflow a signed integer, it is best to avoid changing the type of
the bit clock ratio variable. Therefore, return the bit clock ratio
via a pointer passed to the functions tegra_machine_get_bclk_ratio()
and tegra_machine_get_bclk_ratio_t18x().
Bug 2025176
Change-Id: Ia6e9a1ef68f53ebb594746f812de65a18269925f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1655982
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
If audio capture/playback is active when the device enters system
suspend then the sound core does not correctly suspend capture/playback
and so when the system is resumed, audio capture/playback does not
continue. The problem is that the various DAI links have the property
'ignore_suspend' set and this causes the sound core to skip suspending
any active PCM streams and hence, the DMA controller is not
stopped/paused as it should be on entering suspend or started/resumed
as it should be on exiting suspend. Fix this by removing the
'ignore_suspend' properties for the various DAI links.
Bug 200363507
Change-Id: I80cd74e3bc86532c8920bd25326a31aec7396560
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636471
Reviewed-on: https://git-master.nvidia.com/r/1636473
(cherry picked from commits 22a85acf56e34c369abed6f274a566594def78df
and 4de9dbcf256cad12387fb5307a855632543d3f66)
Reviewed-on: https://git-master.nvidia.com/r/1648638
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This adds arad as part of xbar dai link, which acts as dummy link.
This is required for dapm path completion and cif configuration.
Since there will be conflicts, similar arad link code is removed
from auto machine drivers.
Bug 200364103
Change-Id: I55245c3d6f9efac0d3ea8ef9d485080e106adbac
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1609942
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Clock resource is associated with a device and when the device
is unbound, the resource is freed. Drivers get the clock handle
by using devm_clk_get(). No need for an explicit devm_clk_put()
to release the clock, this is handled automatically when the
device lifetime ends.
Bug 200346429
Change-Id: I0885723e3a9a3fb41e54524ddacc3415f571576c
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574311
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Because of the way in which Makefile is defined for the drivers,
each driver file is getting compliled as separate *.ko module.
This results in loading of all the *.ko modules for maintaining
the functionality.
Current patch re-organises makefile and thus terga-alt structure,
- utils/ : will provide all the helper functions,
- machine_drivers/ : lists all the machine specific drivers we have,
- tegra-alt/*.c : ahub module drivers, each would have a separate
driver module,
- include/ : all the local header files needed for driver modules
Bug 200346429
Change-Id: Ic659879a0d6e8ef48b0d79b81059fba4c069591e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1559745
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>