summaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: tegra: Add Tegra210 based Mixer driverSameer Pujar2021-09-204-0/+786
| | | | | | | | | | | | | | | | | The Mixer supports mixing of up to ten 7.1 audio input streams and generate five outputs (each of which can be any combination of the ten input streams) This patch registers Mixer driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes Mixer interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-amixer" compatible binding. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1631551342-25469-11-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tegra: Add Tegra210 based ADX driverSameer Pujar2021-09-204-0/+616
| | | | | | | | | | | | | | | | | | | The Audio Demultiplexer (ADX) block takes an input stream with up to 16 channels and demultiplexes it into four output streams of up to 16 channels each. A byte RAM helps to form output frames by any combination of bytes from the input frame. Its design is identical to that of byte RAM in the AMX except that the data flow direction is reversed. This patch registers ADX driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes ADX interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-adx" compatible binding. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1631551342-25469-10-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tegra: Add Tegra210 based AMX driverSameer Pujar2021-09-204-0/+704
| | | | | | | | | | | | | | | | | | | The Audio Multiplexer (AMX) block can multiplex up to four input streams each of which can have maximum 16 channels and generate an output stream with maximum 16 channels. A byte RAM helps to form an output frame by any combination of bytes from the input frames. This patch registers AMX driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes AMX interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-amx" for Tegra210 and Tegra186. For Tegra194 and later, "nvidia,tegra194-amx" can be used. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1631551342-25469-9-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tegra: Add Tegra210 based SFC driverSameer Pujar2021-09-204-0/+3638
| | | | | | | | | | | | | | | | | The Sampling Frequency Converter (SFC) converts the sampling frequency of the input signal from one frequency to another. It supports sampling frequency conversions of streams of up to two channels (stereo). This patch registers SFC driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes SFC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-sfc" compatible binding. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1631551342-25469-8-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tegra: Add Tegra210 based MVC driverSameer Pujar2021-09-204-0/+773
| | | | | | | | | | | | | | | | | | | | The Master Volume Control (MVC) provides gain or attenuation to a digital signal path. It can be used in input or output signal path for per-stream volume control or it can be used as master volume control. The MVC block has one input and one output. The input digital stream can be mono or multi-channel (up to 7.1 channels) stream. An independent mute control is also included in the MVC block. This patch registers MVC driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes MVC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-mvc" compatible binding. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1631551342-25469-7-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tegra: Add routes for few AHUB modulesSameer Pujar2021-09-201-2/+509
| | | | | | | | | | | | | | | | | Add routing support for following modules of AHUB: * SFC (Sampling Frequency Converter) * MVC (Master Volume Control) * AMX (Audio Multiplexer) * ADX (Audio Demultiplexer) * Mixer These modules can be plugged into audio path as per the need using routing controls similar to the already existing routes to I/O modules such as I2S, DMIC and DSPK. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1631551342-25469-6-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'asoc-v5.15' of ↵Takashi Iwai2021-08-302-8/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.15 Quite a quiet release this time, mostly a combination of cleanups and a good set of new drivers. - Lots of cleanups and improvements to the Intel drivers, including some new systems support. - New support for AMD Vangoh, CUI CMM-4030D-261, Mediatek Mt8195, Renesas RZ/G2L Mediatek Mt8195, RealTek RT101P, Renesas RZ/G2L,, Rockchip RK3568 S/PDIF.
| * ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_dataAakash Hemadri2021-08-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | const struct of_device_id incorrectly assigned "match->data" using of_device_get_match_data() Instead assign `const struct tegra30_i2s_soc_data *soc_data` with const void *of_device_get_match_data(...) Fixes: 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data") Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Link: https://lore.kernel.org/r/4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_dataAakash Hemadri2021-08-171-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | const struct of_device_id incorrectly assigned "match->data" using of_device_get_match_data() Instead assign `const struct tegra30_ahub_soc_data *soc_data` with const void *of_device_get_match_data(...) Fixes: 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data") Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Link: https://lore.kernel.org/r/bb61c41f2ee0cf0d85fecdfea05f23a7205992e6.1629148177.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: tegra30: i2s: Use of_device_get_match_dataAakash Hemadri2021-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Prefer `of_device_get_match_data` over `of_match_device` Retrieve OF match data using `of_device_get_match_data`, this is cleaner and better expresses intent. Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/f4e632e0023d90c43b2b927e752585142a9d9c26.1628971397.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: tegra30: ahub: Use of_device_get_match_dataAakash Hemadri2021-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Prefer `of_device_get_match_data` over `of_match_device` Retrieve OF match data using `of_device_get_match_data`, this is cleaner and better expresses intent. Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/e568d621c9c05ee23732a6a6f9e3606a780b1707.1628971397.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: tegra: Use managed buffer allocationTakashi Iwai2021-08-043-105/+1
|/ | | | | | | | | | As the standard buffer allocation helper supports WC pages now, we can convert imx-pcm-rpmsg driver to use that. This allows us to remove lots of superfluous code. Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210802072815.13551-10-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: tegra: Use ADMAIF component for DMA allocationsThierry Reding2021-07-111-12/+18
| | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: tegra30: ahub: Use devm_platform_get_and_ioremap_resource()Yang Yingliang2021-06-231-2/+1
| | | | | | | | | 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>
* ASoC: tegra: tegra210_admaif: Use devm_platform_get_and_ioremap_resource()Yang Yingliang2021-06-231-3/+1
| | | | | | | | | 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>
* ASoC: tegra20: spdif: Use devm_platform_get_and_ioremap_resource()Yang Yingliang2021-06-231-2/+1
| | | | | | | | | 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>
* ASoC: tegra20: i2s: Use devm_platform_get_and_ioremap_resource()Yang Yingliang2021-06-231-2/+1
| | | | | | | | | 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>
* ASoC: tegra: Fix a NULL vs IS_ERR() checkDan Carpenter2021-06-211-1/+1
| | | | | | | | | | | 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>
* ASoC: tegra: Squash utils into common machine driverDmitry Osipenko2021-06-155-276/+150
| | | | | | | | | 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>
* ASoC: tegra: Specify components string for each cardDmitry Osipenko2021-06-152-0/+8
| | | | | | | | | | | | | 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>
* ASoC: tegra: Unify ASoC machine driversDmitry Osipenko2021-06-1513-2112/+850
| | | | | | | | | | | | | | | 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>
* ASoC: tegra: Set driver_name=tegra for all machine driversDmitry Osipenko2021-06-159-0/+9
| | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: tegra: mark runtime-pm functions as __maybe_unusedArnd Bergmann2021-04-224-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.cKuninori Morimoto2021-04-201-1/+1
| | | | | | | | | 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>
* ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.cKuninori Morimoto2021-04-201-1/+1
| | | | | | | | | 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>
* ASoC: tegra: tegra20_das: align function prototypesPierre-Louis Bossart2021-03-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: tegra: tegra20_das: clarify expressionPierre-Louis Bossart2021-03-311-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: tegra: Set driver name explicitlyThierry Reding2021-03-311-0/+1
| | | | | | | | | | | | | 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>
* ASoC: tegra30: ahub: Remove handing of disabled runtime PMDmitry Osipenko2021-03-181-9/+0
| | | | | | | | | | | 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>
* ASoC: tegra30: ahub: Correct suspend-resume callbacksDmitry Osipenko2021-03-181-27/+2
| | | | | | | | | | | 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>
* ASoC: tegra30: ahub: Reset global variableDmitry Osipenko2021-03-181-14/+16
| | | | | | | | | | 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>
* ASoC: tegra30: i2s: Remove handing of disabled runtime PMDmitry Osipenko2021-03-181-11/+1
| | | | | | | | | | | 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>
* ASoC: tegra30: i2s: Use devm_clk_get()Dmitry Osipenko2021-03-181-7/+3
| | | | | | | | 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>
* ASoC: tegra30: i2s: Correct driver removal orderDmitry Osipenko2021-03-181-4/+4
| | | | | | | | | | 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>
* ASoC: tegra20: i2s: Remove handing of disabled runtime PMDmitry Osipenko2021-03-181-12/+1
| | | | | | | | | | | 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>
* ASoC: tegra20: i2s: Use devm_clk_get()Dmitry Osipenko2021-03-181-9/+3
| | | | | | | | 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>
* ASoC: tegra20: i2s: Correct driver removal orderDmitry Osipenko2021-03-181-3/+3
| | | | | | | | | | 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>
* ASoC: tegra20: i2s: Add system level suspend-resume callbacksDmitry Osipenko2021-03-181-0/+2
| | | | | | | | | | 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>
* ASoC: tegra20: spdif: Remove handing of disabled runtime PMDmitry Osipenko2021-03-181-11/+1
| | | | | | | | | | | 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>
* ASoC: tegra20: spdif: Correct driver removal orderDmitry Osipenko2021-03-181-3/+3
| | | | | | | | | | 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>
* ASoC: tegra30: ahub: Switch to use reset-bulk APIDmitry Osipenko2021-03-183-70/+40
| | | | | | | | 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>
* ASoC: tegra30: i2s: Restore hardware state on runtime PM resumeDmitry Osipenko2021-03-181-28/+12
| | | | | | | | | | | | | | 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>
* ASoC: tegra20: i2s: Add reset controlDmitry Osipenko2021-03-182-0/+32
| | | | | | | | | | | | | | | | | | | 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>
* ASoC: tegra20: ac97: Add reset controlDmitry Osipenko2021-03-182-0/+22
| | | | | | | | | | | | | | 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>
* ASoC: tegra: Add driver remove() callbackSameer Pujar2021-02-081-1/+2
| | | | | | | | | | | | 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>
* ASoC: audio-graph: Rename functions needed for exportSameer Pujar2021-02-081-3/+3
| | | | | | | | | | | | | | | | 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>
* ASoC: tegra: SND_SOC_TEGRA_AUDIO_GRAPH_CARD should depend on SND_SOC_TEGRAGeert Uytterhoeven2021-02-011-20/+13
| | | | | | | | | | | | | | | | 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>
* ASoC: tegra: ahub: Reset hardware properlyDmitry Osipenko2021-01-252-4/+33
| | | | | | | | | | | | | 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>
* ASoC: tegra: ahub: Use clk_bulk helpersDmitry Osipenko2021-01-252-25/+9
| | | | | | | | | | | | | 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>
* ASoC: tegra: ahub: Add missing resetsDmitry Osipenko2021-01-251-0/+2
| | | | | | | | | | | | | | | | | 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>