Commit graph

418 commits

Author SHA1 Message Date
Dmitry Osipenko 824edd866a
ASoC: tegra: Set default card name for Trimslice
The default card name for Trimslice device should be "tegra-trimslice".
It got lost by accident during unification of machine sound drivers,
fix it.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f560 ("ASoC: tegra: Unify ASoC machine drivers")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211024192853.21957-2-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-25 12:36:17 +01:00
Dmitry Osipenko de8fc2b0a3
ASoC: tegra: Restore AC97 support
The device-tree of AC97 codecs need to be parsed differently from I2S
codecs, plus codec device may need to be created. This was missed by the
patch that unified machine drivers into a single driver, fix it. It should
restore audio on Toradex Colibri board.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f560 ("ASoC: tegra: Unify ASoC machine drivers")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211024192853.21957-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-25 12:36:16 +01:00
Rikard Falkeborn 620868b2a0
ASoC: tegra: Constify static snd_soc_ops
The struct tegra_machine_snd_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211001114517.6752-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 19:34:59 +01:00
Rikard Falkeborn 313fab4820
ASoC: tegra: Constify static snd_soc_dai_ops structs
The only usage of these is to assign their address to the ops field in
the snd_soc_dai_driver struct, which is a pointer to const. Make them
const to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210922205438.34519-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:03 +01:00
Sameer Pujar 05bb3d5ec6
ASoC: tegra: Add Tegra210 based Mixer driver
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>
2021-09-20 13:31:36 +01:00
Sameer Pujar a99ab6f395
ASoC: tegra: Add Tegra210 based ADX driver
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>
2021-09-20 13:31:35 +01:00
Sameer Pujar 77f7df346c
ASoC: tegra: Add Tegra210 based AMX driver
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>
2021-09-20 13:31:34 +01:00
Sameer Pujar b2f74ec53a
ASoC: tegra: Add Tegra210 based SFC driver
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>
2021-09-20 13:31:33 +01:00
Sameer Pujar e539891f96
ASoC: tegra: Add Tegra210 based MVC driver
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>
2021-09-20 13:31:32 +01:00
Sameer Pujar 94d486c2e5
ASoC: tegra: Add routes for few AHUB modules
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>
2021-09-20 13:31:31 +01:00
Takashi Iwai a8729efbbb 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.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmEsxhYTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0Py1B/0dVvB5iLx7t7Vp3EbxIbAQ/4URpmfV
 A/yIWY6fii6vhVsdsqU+8FN7D5m5ZpVUx+3kH//oCsPL7VLem3sjh64lge1lQz4A
 9G9FU63nSCY8X0dL4cfZTNEd+FYrCHZDqU8y7oJg+v3U7D42MVLhTwySaCuP6W56
 KZhxOUIuyfIrhmkfBEAUCA6jyPSbVAy7Aw9B5WhJhX07yw0vToxnycbTnjwMzMYn
 3Bvfycyg9pqpxAdCuJVPVs3S8+CM5/+QjKb0J6vy1Zuw49jNSUdkvuyRWXZsAoAF
 zepXWEKXvclKNZDR0N1AO4H+9fUeSvkc/IX7XEHZ0Zk8w2eMico0ceAz
 =BHW1
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v5.15' of 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.
2021-08-30 14:57:03 +02:00
Aakash Hemadri 240fdf3f42
ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data
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: 356b94a32a ("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>
2021-08-17 13:35:00 +01:00
Aakash Hemadri ea2efedefb
ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
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: 80165bb804 ("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>
2021-08-17 13:34:59 +01:00
Aakash Hemadri 356b94a32a
ASoC: tegra30: i2s: Use of_device_get_match_data
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>
2021-08-16 13:30:38 +01:00
Aakash Hemadri 80165bb804
ASoC: tegra30: ahub: Use of_device_get_match_data
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>
2021-08-16 13:30:37 +01:00
Takashi Iwai 189364872f ASoC: tegra: Use managed buffer allocation
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>
2021-08-04 08:08:55 +02:00
Thierry Reding 0dfc21c1a4
ASoC: tegra: Use ADMAIF component for DMA allocations
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-07-11 23:44:30 +01:00
Yang Yingliang fc8344e63e
ASoC: tegra30: ahub: Use devm_platform_get_and_ioremap_resource()
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-23 11:49:32 +01:00
Yang Yingliang c29b6382d2
ASoC: tegra: tegra210_admaif: Use devm_platform_get_and_ioremap_resource()
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-23 11:49:31 +01:00
Yang Yingliang 8d81f0da47
ASoC: tegra20: spdif: Use devm_platform_get_and_ioremap_resource()
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-23 11:49:30 +01:00
Yang Yingliang 8ad9e5baa9
ASoC: tegra20: i2s: Use devm_platform_get_and_ioremap_resource()
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-23 11:49:29 +01:00
Dan Carpenter 3aed3ddf96
ASoC: tegra: Fix a NULL vs IS_ERR() check
The tegra_machine_parse_phandle() function doesn't return NULL, it returns
error pointers.

Fixes: cc8f70f560 ("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-21 13:06:27 +01:00
Dmitry Osipenko 8c1b3b1593
ASoC: tegra: Squash utils into common machine driver
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-15 11:43:12 +01:00
Dmitry Osipenko c16aab8ddc
ASoC: tegra: Specify components string for each card
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-15 11:43:11 +01:00
Dmitry Osipenko cc8f70f560
ASoC: tegra: Unify ASoC machine drivers
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-15 11:43:10 +01:00
Dmitry Osipenko f6eb84fa59
ASoC: tegra: Set driver_name=tegra for all machine drivers
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-06-15 11:43:09 +01:00
Arnd Bergmann ccd4cc3ed0
ASoC: tegra: mark runtime-pm functions as __maybe_unused
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: b5571449e6 ("ASoC: tegra30: ahub: Remove handing of disabled runtime PM")
Fixes: c53b396f0d ("ASoC: tegra20: spdif: Remove handing of disabled runtime PM")
Fixes: 80ec4a4cb3 ("ASoC: tegra20: i2s: Remove handing of disabled runtime PM")
Fixes: b5f6f781fc ("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-22 16:27:37 +01:00
Kuninori Morimoto f6fcc820e0
ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c
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-20 17:25:45 +01:00
Kuninori Morimoto 1a456b1c6b
ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c
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-04-20 17:25:44 +01:00
Pierre-Louis Bossart 53567ebce4
ASoC: tegra: tegra20_das: align function prototypes
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-31 18:03:25 +01:00
Pierre-Louis Bossart 1bc6d7a90b
ASoC: tegra: tegra20_das: clarify expression
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-31 18:03:24 +01:00
Thierry Reding 868d5c6340
ASoC: tegra: Set driver name explicitly
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-31 13:52:48 +01:00
Dmitry Osipenko b5571449e6
ASoC: tegra30: ahub: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("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-18 13:49:45 +00:00
Dmitry Osipenko e2965c2ca1
ASoC: tegra30: ahub: Correct suspend-resume callbacks
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-18 13:49:44 +00:00
Dmitry Osipenko 5d956e3cb8
ASoC: tegra30: ahub: Reset global variable
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-18 13:49:43 +00:00
Dmitry Osipenko b5f6f781fc
ASoC: tegra30: i2s: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("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-18 13:49:42 +00:00
Dmitry Osipenko 52674aef9e
ASoC: tegra30: i2s: Use devm_clk_get()
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-18 13:49:41 +00:00
Dmitry Osipenko f852e1e4ac
ASoC: tegra30: i2s: Correct driver removal order
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-18 13:49:40 +00:00
Dmitry Osipenko 80ec4a4cb3
ASoC: tegra20: i2s: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("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-18 13:49:39 +00:00
Dmitry Osipenko d3c6ef98da
ASoC: tegra20: i2s: Use devm_clk_get()
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-18 13:49:38 +00:00
Dmitry Osipenko ca6e960ed6
ASoC: tegra20: i2s: Correct driver removal order
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-18 13:49:37 +00:00
Dmitry Osipenko e33fdd9bee
ASoC: tegra20: i2s: Add system level suspend-resume callbacks
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-18 13:49:36 +00:00
Dmitry Osipenko c53b396f0d
ASoC: tegra20: spdif: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("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-18 13:49:35 +00:00
Dmitry Osipenko 0911f154a2
ASoC: tegra20: spdif: Correct driver removal order
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-18 13:49:35 +00:00
Dmitry Osipenko 050086eb6d
ASoC: tegra30: ahub: Switch to use reset-bulk API
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-18 13:49:34 +00:00
Dmitry Osipenko 0bbcecaaab
ASoC: tegra30: i2s: Restore hardware state on runtime PM resume
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: ed9ce1ed22 ("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-18 13:49:32 +00:00
Dmitry Osipenko 9c648ef82d
ASoC: tegra20: i2s: Add reset control
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-18 13:49:31 +00:00
Dmitry Osipenko a46b78247b
ASoC: tegra20: ac97: Add reset control
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-03-18 13:49:30 +00:00
Sameer Pujar 0d7475d2a5
ASoC: tegra: Add driver remove() callback
There is cleanup required, related to release of phandles, during driver
removal and hence point remove callback to audio_graph_remove().

Fixes: 202e2f7745 ("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-08 11:39:51 +00:00
Sameer Pujar 6e4ea8aace
ASoC: audio-graph: Rename functions needed for export
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-08 11:39:50 +00:00