summaryrefslogtreecommitdiff
path: root/sound/soc/tegra
AgeCommit message (Collapse)Author
2021-07-11ASoC: tegra: Use ADMAIF component for DMA allocationsThierry Reding
DMA memory is currently allocated for the soundcard device, which is a virtual device added for the sole purpose of "stitching" together the audio device. It is not a real device and therefore doesn't have a DMA mask or a description of the path to and from memory of accesses. Memory accesses really originate from the ADMA controller that provides the DMA channels used by the PCM component. However, since the DMA memory is allocated up-front and the DMA channels aren't known at that point, there is no way of knowing the DMA channel provider at allocation time. The next best physical device in the memory path is the ADMAIF. Use it as the device to allocate DMA memory to. iommus and interconnects device tree properties can thus be added to the ADMAIF device tree node to describe the memory access path for audio. Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20210708103432.1690385-2-thierry.reding@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23ASoC: tegra30: ahub: Use devm_platform_get_and_ioremap_resource()Yang Yingliang
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210618024722.2618842-5-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23ASoC: tegra: tegra210_admaif: Use devm_platform_get_and_ioremap_resource()Yang Yingliang
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210618024722.2618842-4-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23ASoC: tegra20: spdif: Use devm_platform_get_and_ioremap_resource()Yang Yingliang
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210618024722.2618842-3-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23ASoC: tegra20: i2s: Use devm_platform_get_and_ioremap_resource()Yang Yingliang
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210618024722.2618842-2-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-21ASoC: tegra: Fix a NULL vs IS_ERR() checkDan Carpenter
The tegra_machine_parse_phandle() function doesn't return NULL, it returns error pointers. Fixes: cc8f70f56039 ("ASoC: tegra: Unify ASoC machine drivers") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/YMyjOKFsPe9SietU@mwanda Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15ASoC: tegra: Squash utils into common machine driverDmitry Osipenko
There no users left of the utils other than the new common machine driver. Squash the utils into the common machine driver in order to simplify code. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210529154649.25936-5-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15ASoC: tegra: Specify components string for each cardDmitry Osipenko
Specify components string for each card of each supported device. It's a free form string that describes audio hardware configuration. This information is useful for ALSA UCM rules. It allows to generalize UCM rules, potentially removing a need to add new UCM rule for each device. Acked-by: Jaroslav Kysela <perex@perex.cz> Suggested-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210529154649.25936-4-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15ASoC: tegra: Unify ASoC machine driversDmitry Osipenko
Squash all machine drivers into a single-universal one. This reduces code duplication, eases addition of a new drivers and upgrades older code to a modern Linux kernel APIs. Suggested-by: Jonathan Hunter <jonathanh@nvidia.com> Co-developed-by: Ion Agorria <ion@agorria.com> Signed-off-by: Ion Agorria <ion@agorria.com> Co-developed-by: Svyatoslav Ryhel <clamor95@gmail.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210529154649.25936-3-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15ASoC: tegra: Set driver_name=tegra for all machine driversDmitry Osipenko
The driver_name="tegra" is now required by the newer ALSA UCMs, otherwise Tegra UCMs don't match by the path/name. All Tegra machine drivers are specifying the card's name, but it has no effect if model name is specified in the device-tree since it overrides the card's name. We need to set the driver_name to "tegra" in order to get a usable lookup path for the updated ALSA UCMs. The new UCM lookup path has a form of driver_name/card_name. The old lookup paths that are based on driver module name continue to work as before. Note that UCM matching never worked for Tegra ASoC drivers if they were compiled as built-in, this is fixed by supporting the new naming scheme. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210529154649.25936-2-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-22ASoC: tegra: mark runtime-pm functions as __maybe_unusedArnd Bergmann
A reorganization of the driver source led to two of them causing a compile time warning in some configurations: tegra/tegra20_spdif.c:36:12: error: 'tegra20_spdif_runtime_resume' defined but not used [-Werror=unused-function] 36 | static int tegra20_spdif_runtime_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ tegra/tegra20_spdif.c:27:12: error: 'tegra20_spdif_runtime_suspend' defined but not used [-Werror=unused-function] 27 | static int tegra20_spdif_runtime_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tegra/tegra30_ahub.c:64:12: error: 'tegra30_ahub_runtime_resume' defined but not used [-Werror=unused-function] 64 | static int tegra30_ahub_runtime_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ tegra/tegra30_ahub.c:43:12: error: 'tegra30_ahub_runtime_suspend' defined but not used [-Werror=unused-function] 43 | static int tegra30_ahub_runtime_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark these functions as __maybe_unused to avoid this kind of warning. Fixes: b5571449e618 ("ASoC: tegra30: ahub: Remove handing of disabled runtime PM") Fixes: c53b396f0dd4 ("ASoC: tegra20: spdif: Remove handing of disabled runtime PM") Fixes: 80ec4a4cb36d ("ASoC: tegra20: i2s: Remove handing of disabled runtime PM") Fixes: b5f6f781fcb2 ("ASoC: tegra30: i2s: Remove handing of disabled runtime PM") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210422133418.1757893-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-20ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.cKuninori Morimoto
audio-graph-card2 can reuse audio_graph_remove() / asoc_simple_remove(). This patch moves it to simple-card-utils.c. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y2df3uby.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-20ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.cKuninori Morimoto
audio-graph-card2 can reuse audio_graph_card_probe(). This patch moves it to simple-card-utils.c. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zgxv3uc4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: tegra: tegra20_das: align function prototypesPierre-Louis Bossart
cppcheck warnings: sound/soc/tegra/tegra20_das.c:35:40: style:inconclusive: Function 'tegra20_das_connect_dap_to_dac' argument 1 names different: declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent] int tegra20_das_connect_dap_to_dac(int dap, int dac) ^ sound/soc/tegra/tegra20_das.h:98:47: note: Function 'tegra20_das_connect_dap_to_dac' argument 1 names different: declaration 'dap_id' definition 'dap'. extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel); ^ sound/soc/tegra/tegra20_das.c:35:40: note: Function 'tegra20_das_connect_dap_to_dac' argument 1 names different: declaration 'dap_id' definition 'dap'. int tegra20_das_connect_dap_to_dac(int dap, int dac) ^ sound/soc/tegra/tegra20_das.c:35:49: style:inconclusive: Function 'tegra20_das_connect_dap_to_dac' argument 2 names different: declaration 'dac_sel' definition 'dac'. [funcArgNamesDifferent] int tegra20_das_connect_dap_to_dac(int dap, int dac) ^ sound/soc/tegra/tegra20_das.h:98:59: note: Function 'tegra20_das_connect_dap_to_dac' argument 2 names different: declaration 'dac_sel' definition 'dac'. extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel); ^ sound/soc/tegra/tegra20_das.c:35:49: note: Function 'tegra20_das_connect_dap_to_dac' argument 2 names different: declaration 'dac_sel' definition 'dac'. int tegra20_das_connect_dap_to_dac(int dap, int dac) ^ sound/soc/tegra/tegra20_das.c:53:40: style:inconclusive: Function 'tegra20_das_connect_dap_to_dap' argument 1 names different: declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent] int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master, ^ sound/soc/tegra/tegra20_das.h:108:47: note: Function 'tegra20_das_connect_dap_to_dap' argument 1 names different: declaration 'dap_id' definition 'dap'. extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel, ^ sound/soc/tegra/tegra20_das.c:53:40: note: Function 'tegra20_das_connect_dap_to_dap' argument 1 names different: declaration 'dap_id' definition 'dap'. int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master, ^ sound/soc/tegra/tegra20_das.c:53:49: style:inconclusive: Function 'tegra20_das_connect_dap_to_dap' argument 2 names different: declaration 'other_dap_sel' definition 'otherdap'. [funcArgNamesDifferent] int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master, ^ sound/soc/tegra/tegra20_das.h:108:59: note: Function 'tegra20_das_connect_dap_to_dap' argument 2 names different: declaration 'other_dap_sel' definition 'otherdap'. extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel, ^ sound/soc/tegra/tegra20_das.c:53:49: note: Function 'tegra20_das_connect_dap_to_dap' argument 2 names different: declaration 'other_dap_sel' definition 'otherdap'. int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master, ^ sound/soc/tegra/tegra20_das.c:75:40: style:inconclusive: Function 'tegra20_das_connect_dac_to_dap' argument 1 names different: declaration 'dac_id' definition 'dac'. [funcArgNamesDifferent] int tegra20_das_connect_dac_to_dap(int dac, int dap) ^ sound/soc/tegra/tegra20_das.h:118:47: note: Function 'tegra20_das_connect_dac_to_dap' argument 1 names different: declaration 'dac_id' definition 'dac'. extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel); ^ sound/soc/tegra/tegra20_das.c:75:40: note: Function 'tegra20_das_connect_dac_to_dap' argument 1 names different: declaration 'dac_id' definition 'dac'. int tegra20_das_connect_dac_to_dap(int dac, int dap) ^ sound/soc/tegra/tegra20_das.c:75:49: style:inconclusive: Function 'tegra20_das_connect_dac_to_dap' argument 2 names different: declaration 'dap_sel' definition 'dap'. [funcArgNamesDifferent] int tegra20_das_connect_dac_to_dap(int dac, int dap) ^ sound/soc/tegra/tegra20_das.h:118:59: note: Function 'tegra20_das_connect_dac_to_dap' argument 2 names different: declaration 'dap_sel' definition 'dap'. extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel); ^ sound/soc/tegra/tegra20_das.c:75:49: note: Function 'tegra20_das_connect_dac_to_dap' argument 2 names different: declaration 'dap_sel' definition 'dap'. int tegra20_das_connect_dac_to_dap(int dac, int dap) ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20210326215927.936377-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: tegra: tegra20_das: clarify expressionPierre-Louis Bossart
cppcheck warning: sound/soc/tegra/tegra20_das.c:64:60: style: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] reg = otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P | ^ sound/soc/tegra/tegra20_das.c:65:61: style: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] !!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P | ^ sound/soc/tegra/tegra20_das.c:66:61: style: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] !!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P | ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20210326215927.936377-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: tegra: Set driver name explicitlyThierry Reding
The SoC sound core will generate a driver name by normalizing the card name. However, most of the time that name does not tell anything about the driver and is therefore useless for this purpose. Make the driver name more useful by setting it explicitly during card initialization. Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20210330180657.1867971-1-thierry.reding@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: ahub: Remove handing of disabled runtime PMDmitry Osipenko
Runtime PM is always available on Tegra since commit 40b2bb1b132a ("ARM: tegra: enforce PM requirement"), hence there is no need to handle the case of a disabled RPM by Tegra drivers. Remove handing of a disabled runtime PM from Tegra30 AHUB driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-18-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: ahub: Correct suspend-resume callbacksDmitry Osipenko
Tegra30 AHUB driver always syncs hardware state on a runtime PM resume, hence there is no needed to re-sync the state on system resume. Replace the suspend-resume callbacks with a generic helpers which ensure that AHUB is suspended using RPM callbacks across system suspend-resume. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-17-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: ahub: Reset global variableDmitry Osipenko
Tegra30 AHUB uses global variable that is never reset by the driver on a probe failure and on driver removal, meaning that driver will never try to re-probe and can't be unbound. Make driver to reset the variable. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-16-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: i2s: Remove handing of disabled runtime PMDmitry Osipenko
Runtime PM is always available on Tegra since commit 40b2bb1b132a ("ARM: tegra: enforce PM requirement"), hence there is no need to handle the case of a disabled RPM by Tegra drivers. Remove handing of a disabled runtime PM from Tegra30 I2S driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-15-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: i2s: Use devm_clk_get()Dmitry Osipenko
Use resource-managed variant of clk_get() to simplify code. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-14-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: i2s: Correct driver removal orderDmitry Osipenko
Tegra30 I2S driver has a wrong driver removal order, which should be opposite to the registration order, but it's not. In particular the runtime PM is disabled in a wrong order. Fix the order. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-13-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: i2s: Remove handing of disabled runtime PMDmitry Osipenko
Runtime PM is always available on Tegra since commit 40b2bb1b132a ("ARM: tegra: enforce PM requirement"), hence there is no need to handle the case of a disabled RPM by Tegra drivers. Remove handing of a disabled runtime PM from Tegra20 I2S driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-12-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: i2s: Use devm_clk_get()Dmitry Osipenko
Use resource-managed variant of clk_get() to simplify code. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-11-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: i2s: Correct driver removal orderDmitry Osipenko
Tegra20 I2S driver has a wrong driver removal order, which should be opposite to the registration order, but it's not. In particular the runtime PM is disabled in a wrong order. Fix the order. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-10-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: i2s: Add system level suspend-resume callbacksDmitry Osipenko
Add system level suspend-resume callbacks in order to ensure that I2S is gated before system is suspended. This puts Tegra20 I2S driver on par with the Tegra30 I2S driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-9-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: spdif: Remove handing of disabled runtime PMDmitry Osipenko
Runtime PM is always available on Tegra since commit 40b2bb1b132a ("ARM: tegra: enforce PM requirement"), hence there is no need to handle the case of a disabled RPM by Tegra drivers. Remove handing of a disabled runtime PM from Tegra20 SPDIF driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-8-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: spdif: Correct driver removal orderDmitry Osipenko
Tegra20 SPDIF driver has a wrong driver removal order, which should be opposite to the registration order, but it's not. In particular the runtime PM is disabled in a wrong order. Fix the order. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-7-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: ahub: Switch to use reset-bulk APIDmitry Osipenko
Switch to use reset-bulk API in order to make code cleaner. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-6-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra30: i2s: Restore hardware state on runtime PM resumeDmitry Osipenko
Tegra30 I2S driver syncs regmap cache only on resume from system suspend, but hardware is reset across the runtime suspend because RPM of the parent AHUB driver resets the I2S hardware, hence h/w state is lost after each RPM resume. The problem isn't visible because hardware happens to be fully reprogrammed after each RPM resume. Move hardware syncing to RPM resume in order to restore h/w state properly. Fixes: ed9ce1ed2239 ("ASoC: tegra: ahub: Reset hardware properly") Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-4-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: i2s: Add reset controlDmitry Osipenko
The I2S reset may be asserted at a boot time, in particular this is the case on Tegra20 AC100 netbook. Tegra20 I2S driver doesn't manage the reset control and currently it happens to work because reset is implicitly deasserted by the tegra-clk driver when I2S clock is enabled. The I2S permanently stays in a reset once tegra-clk is fixed to not touch the resets, which it shouldn't be doing. Add reset control to the Tegra20 I2S driver. Note that I2S reset was always specified in Tegra20 device-tree, hence DTB ABI changes aren't required. Tested-by: Paul Fertser <fercerpav@gmail.com> # T20 AC100 Reported-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-3-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: tegra20: ac97: Add reset controlDmitry Osipenko
Tegra20 AC97 driver doesn't manage the AC97 controller reset, relying on implicit deassertion of the reset by tegra-clk driver, which needs to be fixed since this behaviour is unacceptable by other Tegra drivers. Add explicit reset control to the Tegra20 AC97 driver. Note that AC97 reset was always specified in Tegra20 device-tree, hence DTB ABI changes aren't required. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210314154459.15375-2-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-08ASoC: tegra: Add driver remove() callbackSameer Pujar
There is cleanup required, related to release of phandles, during driver removal and hence point remove callback to audio_graph_remove(). Fixes: 202e2f774543 ("ASoC: tegra: Add audio graph based card driver") Depends-on: "ASoC: audio-graph: Rename functions needed for export" Signed-off-by: Sameer Pujar <spujar@nvidia.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/1612719418-5858-3-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-08ASoC: audio-graph: Rename functions needed for exportSameer Pujar
Following functions are renamed for a better global visibility. graph_card_probe() --> audio_graph_card_probe() graph_parse_of() --> audio_graph_parse_of() graph_remove() --> audio_graph_remove() [exported as well] The references of these are updated in audio graph and Tegra audio graph card drivers. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/1612719418-5858-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01ASoC: tegra: SND_SOC_TEGRA_AUDIO_GRAPH_CARD should depend on SND_SOC_TEGRAGeert Uytterhoeven
Audio Graph Card based Tegra driver is only useful on NVIDIA Tegra SoCs. Hence add a dependency on SND_SOC_TEGRA, to prevent asking the user about this driver when configuring a kernel without Tegra sound support. Wrap all Tegra sound config options inside a big if/endif block, instead of just adding the dependency to the single config option that does not have it yet, to preventing similar future mistakes. Fixes: 202e2f7745437aa5 ("ASoC: tegra: Add audio graph based card driver") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/20210129125915.2652952-1-geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-25ASoC: tegra: ahub: Reset hardware properlyDmitry Osipenko
Assert hardware resets before clocks are enabled and then de-assert them after clocks are enabled. This brings hardware into a predictable state. Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30 audio works Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30 boot-tested Tested-by: Dmitry Osipenko <digetx@gmail.com> # Nexus7 T30 audio works Tested-by: Nicolas Chauvet <kwizart@gmail.com> # TK1 boot-tested Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210120003154.26749-7-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-25ASoC: tegra: ahub: Use clk_bulk helpersDmitry Osipenko
Use clk_bulk helpers to make code cleaner. Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30 audio works Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30 boot-tested Tested-by: Dmitry Osipenko <digetx@gmail.com> # Nexus7 T30 audio works Tested-by: Nicolas Chauvet <kwizart@gmail.com> # TK1 boot-tested Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210120003154.26749-6-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-25ASoC: tegra: ahub: Add missing resetsDmitry Osipenko
AHUB driver misses D_AUDIO and APBIF resets. CPU hangs on trying to access hardware if resets aren't de-asserted. This problem is currently masked by the tegra-clk driver which implicitly de-asserts the resets when the corresponding clocks are enabled. Soon the implicit de-assertion will be gone from the tegra-clk driver, thus we need to fix the AHUB driver. Add the missing resets to the driver. Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30 audio works Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30 boot-tested Tested-by: Dmitry Osipenko <digetx@gmail.com> # Nexus7 T30 audio works Tested-by: Nicolas Chauvet <kwizart@gmail.com> # TK1 boot-tested Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210120003154.26749-5-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21ASoC: tegra: sync parameter naming (rate/sample_bits)Kuninori Morimoto
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87o8hqoli4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19Merge series "Tegra210 audio graph card" from Sameer Pujar <spujar@nvidia.com>:Mark Brown
This series adds audio graph based sound card support for Tegra210 platforms like Jetson-TX1 an Jetson-Nano. The following preparatory audio graph enhancement series is already merged. * https://patchwork.kernel.org/project/alsa-devel/list/?series=375629&state=* Following are the summary of changes: * Add graph/audio-graph based schemas or schema updates for Tegra210 component and machine drivers. * Add Tegra audio graph machine driver. * Add required DT support for Jetson-TX1/Nano. This work is based on earlier discussion of DPCM usage for Tegra and simple card driver updates. * https://lkml.org/lkml/2020/4/30/519 * https://lkml.org/lkml/2020/6/27/4 Original v6 series was sent about 6-7 weeks back. The dependency commit, https://lore.kernel.org/alsa-devel/1610948585-16286-1-git-send-email-spujar@nvidia.com/ is now merged. Resending this now to appear in the top of the mail list. Changelog ========= v5 -> v6 -------- * Added ports or port description in YAML docs for Tegra AHUB devices and graph card in patch 1/6 and 2/6. Reference of audio-graph-port.yaml is used for AHUB devices. * Dropped redundant NULL check return for of_device_get_match_data() in patch 3/6. * Added 'Reviewed-by' tag from Jon Hunter. * No changes in remaining patches. v4 -> v5 -------- * Audio graph related changes were sent in separate v5 series as mentioned above and are dropped from current series. * Graph and audio graph doc patches are dropped from this series and are sent separately as mentioned above. * Minor change with phandle label for TX1 and Nano platform DT files. * No changes in other patches. v3 -> v4 -------- * Added new patches to convert graph.txt and audio-graph-card.txt to corresponding json-schema files. Later these references are used in Tegra audio graph schema. * AHUB component binding docs are updated to reflect the usage of ports/port/endpoint * More common stuff is moved into graph_parse_of() and this is used by both generic and Tegra audio graph. * DT binding for Tegra audio graph is updated to included "ports { }" * As per the suggestion 'void *data' member is dropped from 'asoc_simple_priv' and instead container method is used to maintain required custom data internal to Tegra audio graph. v2 -> v3 -------- * Dropped new compatible addition in generic graph driver after reviewing it with Morimoto-san. Instead added Tegra audio graph driver and new compatibles are added in the same. * Added new patches to expose new members for customization in audio graph driver. * Added new patch for Tegra audio graph driver and related documentation. * Minor change in below commit where mutex version of helper is used "ASoC: audio-graph: Identify 'no_pcm' DAI links for DPCM" * DT binding is updated to use the newly exposed compatibles * No changes in other patches v1 -> v2 -------- * Re-organized ports/endpoints description for ADMAIF and XBAR. Updated DT patches accordingly. * After above change, multiple Codec endpoint support is not required and hence dropped for now. This will be considered separately if at all required in future. * Re-ordered patches in the series. Sameer Pujar (6): ASoC: dt-bindings: tegra: Add graph bindings ASoC: dt-bindings: tegra: Add json-schema for Tegra audio graph card ASoC: tegra: Add audio graph based card driver arm64: defconfig: Enable Tegra audio graph card driver arm64: tegra: Audio graph header for Tegra210 arm64: tegra: Audio graph sound card for Jetson Nano and TX1 .../sound/nvidia,tegra-audio-graph-card.yaml | 187 +++++++++++++++ .../bindings/sound/nvidia,tegra186-dspk.yaml | 18 +- .../bindings/sound/nvidia,tegra210-admaif.yaml | 13 +- .../bindings/sound/nvidia,tegra210-ahub.yaml | 13 +- .../bindings/sound/nvidia,tegra210-dmic.yaml | 18 +- .../bindings/sound/nvidia,tegra210-i2s.yaml | 18 +- .../boot/dts/nvidia/tegra210-audio-graph.dtsi | 153 ++++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 262 +++++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 146 ++++++++++++ arch/arm64/configs/defconfig | 1 + sound/soc/tegra/Kconfig | 9 + sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra_audio_graph_card.c | 251 ++++++++++++++++++++ 13 files changed, 1085 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi create mode 100644 sound/soc/tegra/tegra_audio_graph_card.c -- 2.7.4
2021-01-19ASoC: tegra: Add audio graph based card driverSameer Pujar
Add Tegra audio machine driver which is based on generic audio graph card driver. It re-uses most of the common stuff from audio graph driver and uses the same DT binding. Required Tegra specific customizations are done in the driver and additional DT bindings are required for clock handling. Details on the customizations done: - Update PLL rates at runtime: Tegra HW supports multiple sample rates (multiples of 8x and 11.025x) and both of these groups require different PLL rates. Hence there is a requirement to update this at runtime. This is achieved by providing a custom 'snd_soc_ops' and in hw_param() callback PLL rate is updated as per the sample rate. - Internal structure 'tegra_audio_graph_data' is used to maintain clock handles of PLL. - The 'force_dpcm' flag is set to use DPCM for all DAI links. - The 'component_chaining' flag is set to use DPCM with component model. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/1611048496-24650-4-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19ASoC: tegra: Simplify with dma_set_mask_and_coherent()Takashi Iwai
ASoC tegra PCM code still has explicit calls of dma_set_mask() and dma_set_coherent_mask(). Let's simplify with dma_set_mask_and_coherent(). Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210114133337.1039-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-11ASoC: tegra: Don't warn on probe deferralJon Hunter
Deferred probe is an expected return value for snd_soc_register_card(). Given that the driver deals with it properly, there's no need to output a warning that may potentially confuse users. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20201111103245.152189-1-jonathanh@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-03ASoC: tegra: remove unneeded semicolonTom Rix
A semicolon is not needed after a switch statement. Signed-off-by: Tom Rix <trix@redhat.com> Acked-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/20201101172412.2306144-1-trix@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-30ASoC: tegra20-spdif: remove "default m"Michał Mirosław
Make tegra20-spdif default to N as all other drivers do. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Fixes: 774fec338bfc ("ASoC: Tegra: Implement SPDIF CPU DAI") Link: https://lore.kernel.org/r/8756eb5aac561173aa222c9cb64dd314ab1b1f9b.1603925200.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-01ASoC: tegra: trimslice.c: use devm_snd_soc_register_card()Qinglang Miao
Using devm_snd_soc_register_card() can make the code shorter and cleaner. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Link: https://lore.kernel.org/r/20200929112939.47661-1-miaoqinglang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-01ASoC: tegra: tegra_rt5640: use devm_snd_soc_register_card()Qinglang Miao
Using devm_snd_soc_register_card() can make the code shorter and cleaner. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Link: https://lore.kernel.org/r/20200929112936.47441-1-miaoqinglang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-01ASoC: tegra: tegra_wm8753: use devm_snd_soc_register_card()Qinglang Miao
Using devm_snd_soc_register_card() can make the code shorter and cleaner. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Link: https://lore.kernel.org/r/20200929112938.47599-1-miaoqinglang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-01ASoC: tegra: tegra_max98090: use devm_snd_soc_register_card()Qinglang Miao
Using devm_snd_soc_register_card() can make the code shorter and cleaner. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Link: https://lore.kernel.org/r/20200929112935.47035-1-miaoqinglang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-03ASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=nTakashi Iwai
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>