Commit graph

421 commits

Author SHA1 Message Date
Dmitry Osipenko
6084a6c1ca ASoC: tegra: Restore headphones jack name on Nyan Big
commit db635ba4fa upstream.

UCM of Acer Chromebook (Nyan) uses a different name for the headphones
jack. The name was changed during unification of the machine drivers and
UCM fails now to load because of that. Restore the old jack name.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f ("ASoC: tegra: Unify ASoC machine drivers")
Reported-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Tested-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211211231146.6137-2-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-29 12:28:52 +01:00
Dmitry Osipenko
f7fe9d3034 ASoC: tegra: Add DAPM switches for headphones and mic jack
commit d341b427c3 upstream.

UCM of Acer Chromebook (Nyan) uses DAPM switches of headphones and mic
jack. These switches were lost by accident during unification of the
machine drivers, restore them.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f ("ASoC: tegra: Unify ASoC machine drivers")
Reported-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Tested-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211211231146.6137-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-29 12:28:52 +01:00
Sameer Pujar
f50dcc9d14 ASoC: tegra: Fix kcontrol put callback in AHUB
commit a4e37950c9 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the AHUB driver accordingly.

Fixes: 16e1bcc2ca ("ASoC: tegra: Add Tegra210 based AHUB driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-12-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
e13772cfb2 ASoC: tegra: Fix kcontrol put callback in DSPK
commit d6202a57e7 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the DSPK driver accordingly.

Fixes: 327ef64702 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-11-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
1686d2e9ed ASoC: tegra: Fix kcontrol put callback in DMIC
commit a347dfa102 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the DMIC driver accordingly.

Fixes: 8c8ff982e9 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-10-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
e6186c7735 ASoC: tegra: Fix kcontrol put callback in I2S
commit f21a9df3f7 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the I2S driver accordingly.

Fixes: c0bfa98349 ("ASoC: tegra: Add Tegra210 based I2S driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-9-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
7b77bdff45 ASoC: tegra: Fix kcontrol put callback in ADMAIF
commit e2b87a18a6 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the ADMAIF driver accordingly.

Fixes: f74028e159 ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-8-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
a0730b6051 ASoC: tegra: Fix wrong value type in DSPK
commit 3aa0d5c8bb upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: 327ef64702 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-5-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
7e83ca5d78 ASoC: tegra: Fix wrong value type in DMIC
commit 559d234569 upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: 8c8ff982e9 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
36358b208c ASoC: tegra: Fix wrong value type in I2S
commit 8a2c2fa0c5 upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: c0bfa98349 ("ASoC: tegra: Add Tegra210 based I2S driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Sameer Pujar
f3f65b7688 ASoC: tegra: Fix wrong value type in ADMAIF
commit 884c6cb3b7 upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: f74028e159 ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:04:48 +01:00
Dmitry Osipenko
b6a38dd58e ASoC: tegra: Restore AC97 support
commit de8fc2b0a3 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-18 19:16:01 +01:00
Dmitry Osipenko
0ed4b15a50 ASoC: tegra: Set default card name for Trimslice
commit 824edd866a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-18 19:16:01 +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