Remove unused macros in AMX/ADX driver and use shorter names for
remaining macros wherever possible. This makes code look relatively
compact and cleaner.
Currently in AMX driver, Tegra210 regmap readable/writeable_reg()
callbacks use Tegra194 specific register range. As this looks
incorrect, maintain separate callbacks for readable/writeable_reg()
for Tegra210 and Tegra194. Use register range in these callbacks
to make it compact.
Bug 200698314
Change-Id: Iae466da9aaef722736ccaf49a490a3b24b6d683a
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>
SFC driver performs runtime PM operations on the parent device of SFC.
This is not necessary as runtime get/put() calls on the SFC device itself
would be sufficient. Because SFC device is child of AHUB device and
resuming child would resume parent device as well. This does not fix any
functional issue, but just makes code more easy to read.
Bug 200698314
Change-Id: Ia4ce4b45b8681d2db15af96f61433643dd4f3916
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Remove unused macros in SFC driver and use short names for remaining
macros by dropping 'AXBAR' characters from the name. This is similar
to what is done for other upstreamed AHUB drivers. This makes code to
look relatively compact and cleaner.
Bug 200698314
Change-Id: Ib30a482105f3b4864e14647b253f670a10f9030d
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Similar to upstreamed AHUB drivers, follow standard naming convention
styles for SFC mixer control names. Also put all get() operations under
a single function for a better readability. Do the same for put()
operations as well.
Bug 200698314
Change-Id: I4d0b1ad569b8845f137117caf75afb36c625cdd4
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>
Currently AUD_MCLK is controlled by kernel driver and it remains active
as long as an audio use case is running. This is the case most platforms
or audio codecs require. But some external codecs, depending on specific
platform, may want AUD_MCLK clock to be running always and do not require
a runtime control. Since kernel is common, we need a provision in DT to
differentiate both of the above requirements.
This can be achieved by making AUD_MCLK clock an optional property.
Platforms which don't require kernel control can simply exclude AUD_MCLK
clock entry. Respective call in kernel will not have any effect.
Note: We are using upstream utils driver now and update the references
wherever applicable. The changes need not be considered for upstream
because there is plan to use audio-graph-card based driver for Tegra210
and later, which already treats AUD_MCLK clock as optional. Thus no
explicit AUD_MCLK management is necessary. Also it is recommended that
codec driver should take the control of AUD_MCLK. Hence current change
is needed till mentioned transition happens.
Bug 200694208
Change-Id: I87e496515e02db4ded6209a336f6cfbaec034fa1
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2474868
(manually cherry picked from commit 8b2965341c1611b5984ff412f1d5001673396476)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2518783
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@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>
GVS: Gerrit_Virtual_Submit
On later kernels 'snd_pcm_ops' structure is removed from the
'snd_soc_component_driver' and instead explicit callbacks were
provided in the component driver structure. In doing so ack()
callback was left out for PCM interface. This was probably
intentional because there are currently no users for this
callback in upstream.
But in downstream we have ADSP audio driver which relies on
this callback to communicate buffer positions with ADSP and
currently DMA transfer is not happening due to missing ack()
callback. Issue is fixed by exposing ack() callback from the
core.
Bug 200568556
Change-Id: I76e9fcf21e087bb2c470868a2bd1eb668345e382
Reported-by: Asha Talambedu <atalambedu@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2414392
Tested-by: Asha Talambedu <atalambedu@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Following build warnings have popped up after 'is_isomgr_client' flag
is cleaned up from the ADMAIF driver.
tegra210_admaif.c: In function ‘tegra_admaif_prepare’:
tegra210_admaif.c:271:23: warning: unused variable ‘admaif'
struct tegra_admaif *admaif = snd_soc_dai_get_drvdata(dai);
^~~~~~
tegra210_admaif.c: In function ‘tegra_admaif_shutdown’:
tegra210_admaif.c:281:23: warning: unused variable ‘admaif’
struct tegra_admaif *admaif = snd_soc_dai_get_drvdata(dai);
^~~~~~
tegra210_admaif.c: In function ‘tegra_admaif_remove’:
tegra210_admaif.c:1141:23: warning: unused variable ‘admaif’
struct tegra_admaif *admaif = dev_get_drvdata(&pdev->dev);
^~~~~~
Fix these by removing unused variable ‘admaif' from above functions.
Jira TAS-1059
Change-Id: I323df87415727b3deae0e5ba2aa05ef735c047da
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2414632
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Add Interconnect API support for ADMA Memory bandwidth requirement
handling.
From Kernel 4.14 and beyond
- On T23X and newer platforms, the interconnects driver will be initialized
and calls to BWMGR will be stubbed out.
- On T194 and earlier platforms, BWMGR driver will be initialized and calls
to interconnect framework will be stubbed out.
Jira TAS-1059
Change-Id: I7a26f61517937ac3103222a43f08ee7c4e4ad484
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2408552
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@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>
Commit cd6917c3e602 ("ASoC: tegra: Add admaif routes relevant to adsp")
added missing routes required for ADSP. This causes card registration
failure on Tegra210 platforms and probe() fails with following errors.
ASoC: no source widget found for ADMAIF11 FIFO Transmit
ASoC: Failed to add route ADMAIF11 FIFO Transmit -> direct -> ADMAIF11 FIFO RX
ASoC: no sink widget found for ADMAIF11 CIF Receive
ASoC: Failed to add route ADMAIF11 CIF TX -> direct -> ADMAIF11 CIF Receive
ASoC: no source widget found for ADMAIF11 CIF Transmit
ASoC: Failed to add route ADMAIF11 CIF Transmit -> direct -> ADMAIF11 CIF RX
ASoC: no sink widget found for ADMAIF11 FIFO Receive
ASoC: Failed to add route ADMAIF11 FIFO TX -> direct -> ADMAIF11 FIFO Receive
...
(Similarly errors are seen for ADMAIF12, ADMAIF13 ... ADMAIF20)
This happens because a common structure is used for routes between Tegra210 and
Tegra186. Fix this problem by using appropriate size for routes which takes into
account of maximum available ADMAIF channels for a given SoC. This is inline
with what we have for previous kernels.
Bug 200628802
Change-Id: I18305e99781a0f91dc7886d3e06f2acaa5b69d9b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2407491
Reviewed-by: automaticguardword <automaticguardword@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
MODS build has 'CONFIG_TEGRA_ISOMGR' enabled and it is resulting in
following build errors.
ERROR: modpost: "tegra_isomgr_register"
[sound/soc/tegra/snd-soc-tegra-utils.ko] undefined!
ERROR: modpost: "tegra_set_latency_allowance"
[sound/soc/tegra/snd-soc-tegra-utils.ko] undefined!
ERROR: modpost: "tegra_isomgr_realize"
[sound/soc/tegra/snd-soc-tegra-utils.ko] undefined!
ERROR: modpost: "tegra_isomgr_reserve"
[sound/soc/tegra/snd-soc-tegra-utils.ko] undefined!
ERROR: modpost: "tegra_isomgr_unregister"
[sound/soc/tegra/snd-soc-tegra-utils.ko] undefined!
This happens because TEGRA_ISOMGR is not functionally up on v5.9.
Actually it has dependency over 'CONFIG_NV_TEGRA_MC' and thus build
issue is fixed by adding an explicit check for it. On L4T this issue
is not seen because 'CONFIG_TEGRA_ISOMGR' is not enabled.
Bug 200622929
Change-Id: Iceebf0df6e33386a5df06c5263a4a46b5bcd5d42
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2404198
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rajesh Gumasta <rgumasta@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Rajesh Gumasta <rgumasta@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
sound/soc/tegra/tegra210_i2s.c:167:12: warning: 'tegra210_i2s_runtime_suspend' defined but not used [-Wunused-function]
sound/soc/tegra/tegra210_i2s.c:179:12: warning: 'tegra210_i2s_runtime_resume' defined but not used [-Wunused-function]
Fixes: c0bfa98349d1 ("ASoC: tegra: Add Tegra210 based I2S driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-6-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
sound/soc/tegra/tegra210_dmic.c:43:12: warning: 'tegra210_dmic_runtime_suspend' defined but not used [-Wunused-function]
sound/soc/tegra/tegra210_dmic.c:55:12: warning: 'tegra210_dmic_runtime_resume' defined but not used [-Wunused-function]
Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-5-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
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>
Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
sound/soc/tegra/tegra210_admaif.c:232:12: warning: 'tegra_admaif_runtime_resume' defined but not used [-Wunused-function]
sound/soc/tegra/tegra210_ahub.c:567:12: warning: 'tegra_ahub_runtime_suspend' defined but not used [-Wunused-function]
Fixes: f74028e159bb ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
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>
Build errors are seen on 32-bit platforms because of a plain 64-by-32
division. For example, following build erros were reported.
"ERROR: modpost: "__udivdi3" [sound/soc/tegra/snd-soc-tegra210-dmic.ko]
undefined!"
"ERROR: modpost: "__divdi3" [sound/soc/tegra/snd-soc-tegra210-dmic.ko]
undefined!"
This can be fixed by using div_u64() helper from 'math64.h' header.
Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1595492011-2411-1-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
ADMAIF is the interface between ADMA and AHUB. Each ADMA channel that
sends/receives data to/from AHUB must intreface through an ADMAIF channel.
ADMA channel sending data to AHUB pairs with an ADMAIF Tx channel and
similarly ADMA channel receiving data from AHUB pairs with an ADMAIF Rx
channel. Buffer size is configurable for each ADMAIF channel, but currently
SW uses default values.
This patch registers ADMAIF driver with ASoC framework. The component
driver exposes DAPM widgets, routes and kcontrols for the device. The DAI
driver exposes ADMAIF 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 ADMAIF device can be enabled in the DT via
"nvidia,tegra210-admaif" compatible binding.
Tegra PCM driver is updated to expose required PCM interfaces and
snd_pcm_ops callbacks.
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1595134890-16470-8-git-send-email-spujar@nvidia.com
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>
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>
The Inter-IC Sound (I2S) controller implements full-duplex, bi-directional
and single direction point to point serial interface. It can interface
with I2S compatible devices. Tegra I2S controller can operate as both
master and slave.
This patch registers I2S controller with ASoC framework. The component
driver exposes DAPM widgets, routes and kcontrols for the device. The DAI
driver exposes I2S 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 I2S devices can be enabled in the DT via
"nvidia,tegra210-i2s" compatible binding.
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1595134890-16470-5-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The Digital MIC (DMIC) Controller is used to interface with Pulse Density
Modulation (PDM) input devices. The DMIC controller implements a converter
to convert PDM signals to Pulse Code Modulation (PCM) signals. From signal
flow perspective, the DMIC can be viewed as a PDM receiver.
This patch registers DMIC component with ASoC framework. The component
driver exposes DAPM widgets, routes and kcontrols for the device. The DAI
driver exposes DMIC 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 DMIC devices can be enabled in the DT via
"nvidia,tegra210-dmic" compatible string. This driver can be used for
Tegra186 and Tegra194 chips as well.
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1595134890-16470-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Resolve linux-5.8-rc3 merge conflicts in k5.9 branch
(currently tracking mainline with linux-5.7.0)
Fix build errors in k5.9 branch after merge of linux-5.8-rc3
bug 200617764
Change-Id: I3a358fef6e8b7c5926fd0de05a03cee539547e8f
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
As part of upstream alignment all audio drivers have been moved to
'tegra' path and are upgraded to work with 5.9 kernel. References
to older versions can be removed now. Earlier these were moved to
retain the commit history.
Summary on files that are being removed:
* Legacy FPGA code is dropped
* PCM driver changes already integrated
* ASoC Utils changes already integrated
* Makefile/Kconfig changes are aligned as per upstream plan
Bug 2845498
Change-Id: I645f94852d7137915ff4045be31e5a943a3fa6b3
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2364087
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
ADMAIF default channel FIFO size is different depending on Tegra210 and
Tegra186 (and later). There is a guideline from HW that FIFO size of
ADMAIF channel should be same as the corrpsonding mapped DMA channel.
Commit 8c0d5ea47d21 ("dmaengine: tegra210-adma: override ADMA FIFO size")
updates FIFO size based on 'slave_id' info. Current patch passes the
'slave_id' information to DMA engine.
Following are the original commits from where the changes have been
manually cherry picked.
- commit 34aa1f405069 ("ASoC: tegra-alt: T210 AHUB drivers")
- commit 938afdfeea42 ("ASoC: tegra-alt: Alternative DAPM-based driver")
Also updated copyright info for Tegra PCM driver.
Bug 2845498
Change-Id: I6c748b94544bc22c21a43b731e43862592047c09
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2356716
Reviewed-by: automaticguardword <automaticguardword@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>
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 is based on the following original commit for 'tegra-alt' version.
Commit fd0548f8eb8f ("ASoC: tegra-alt: Dump APE register for debugging")
Following minor changes are done:
- The device reference is available in component structure and the same
is used to get 'tegra_admaif' structure in *_dump() function. Hence no
need to separately save device reference.
- The pm_runtime_get_*() call on child device will first resume parent
device and hence it would be sufficient to have RPM calls on ADMAIF
device alone.
- Since device reference is available in *_dump() function now, pr_info()
calls are replaced by dev_info().
Bug 2845498
Change-Id: Ib8d8ff7af543a79c34bfa476ddbace1826167a8e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2354012
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Commit 209e5c7b4144 ("drivers: fix k5.9 build errors") fixes few build
errors, associated with audio, which are required for initial kernel-5.9
setup. However there are functional issues on TOT, where APE sound card
registration fails. The root cause of this problem is because of below
listed changes in ASoC core:
- 'snd_soc_ops' member is removed from 'component_driver' structure.
The PCM callbacks now have to be directly populated in the component
driver structure. ADMAIF and ADSP drivers are updated and Tegra PCM
driver is cleaned up accordingly.
- 'of_node' and 'dev_name' members are removed from 'snd_soc_codec_conf'
structure now and instead wrapper for these is provided under 'dlc'.
- Signature of 'snd_soc_get_pcm_runtime()' has changed now and it no
more accepts DAI link name as argument. But since we require specific
'rtd' based on DAI link names, the older version is duplicated in
machine driver.
- There are changes in trigger() order for start and stop now.
*_trigger_start()
|
|--> rtd trigger()
|--> component trigger()
|--> dai trigger()
*_trigger_stop()
|
|--> dai trigger()
|--> component trigger()
|--> rtd trigger()
Above is resulting in following:
|-> start ADMA
|-> start ADMAIF
|-> ...
|-> stop ADMAIF
|-> stop ADMA (unable to stop DMA channel print is seen here)
Current order in downstream for previous kernel versions is:
|-> start ADMA
|-> start ADMAIF
|-> ...
|-> stop ADMA
|-> stop ADMAIF
This issue is addressed by invoking DMA trigger() call from ADMAIF dai
trigger() itself to avoid the error during stop.
Bug 2845498
Change-Id: I1011555f51f5e0b0a448125a46b47df50e366d6f
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2353304
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This patch registers ADSP device as a component with ASoC core. Necessary
changes are made to work with 5.4 kernel and driver need not register a
separate platform and codec device.
Along with this following cleanup is done:
- Move driver to 'tegra' directory.
- Wherever possible, fix ACV issues in the driver. Not all of them can be
fixed at the moment.
Bug 200593718
Change-Id: Ic60c7f59095bbe9f84d25077e4d4469544ca7783
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.4/+/2342897
(cherry picked from commit d927c5daa951a58924e25d32b8002eb682e43aa0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2353303
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tegra PMC clock clk_out_1 is dedicated for audio mclk from Tegra30
through Tegra210 and currently Tegra clock driver keeps the audio mclk
enabled.
With the move of PMC clocks from clock driver into pmc driver, audio
mclk enable from clock driver is removed and this should be taken care
of by the audio driver.
tegra_asoc_utils_init() calls tegra_asoc_utils_set_rate() and audio mclk
rate configuration is not needed during init and the rate is actually
set during the ->hw_params() callback.
So, this patch removes tegra_asoc_utils_set_rate() call and just leaves
the audio mclk enabled.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Tegra PMC clock clk_out_1 is dedicated for audio mclk from Tegra30
through Tegra210 and currently Tegra clock driver does the initial
parent configuration for audio mclk and keeps it enabled by default.
With the move of PMC clocks from clock driver into PMC driver, audio
clocks parent configuration can be specified through the device tree
using assigned-clock-parents property and audio mclk control should be
taken care of by the audio driver.
This patch has implementation for parent configuration when default
parent configuration through assigned-clock-parents property is not
specified in the device tree.
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
tegra_asoc_utils uses clk_get() to get the clock and clk_put() to free
them explicitly.
This patch updates it to use device managed resource API devm_clk_get()
so the clock will be automatically released and freed when the device is
unbound and removes tegra_asoc_utils_fini() as its no longer needed.
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
I2S bit clock is derived from PLLA_OUT0 and sample size of 24 bits
results in fractional value. Clock is not accurate because of this
and noisy playback is observed. To avoid this sample size of 32 bits
can be used to derive I2S bit clock. This means there are additional
bit clocks (8 cycles) per channel which are ignored. Codec picks up
data for the other channel when LRCK toggles. The same is true for
capture as well.
For I2S Tegra-Slave mode this problem is not seen because the clock
signals are driven from the codec and above fix is not necessary for
it.
Bug 200594265
Bug 2845498
Change-Id: Ifa17e65a814fab060ab4762d19edfe34420524ce
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2303591
(cherry picked from commit 1bc9e1904454b359361da6682517952fd0108b46)
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.4/+/2312716
Reviewed-by: automaticguardword <automaticguardword@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>
GVS: Gerrit_Virtual_Submit
Tested-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>