platform/kernel/linux-starfive.git
21 months agoALSA: hda/realtek: Add quirk for ASUS GV601R laptop
Luke D. Jones [Mon, 10 Oct 2022 07:03:47 +0000 (20:03 +1300)]
ALSA: hda/realtek: Add quirk for ASUS GV601R laptop

The ASUS ROG X16 (GV601R) series laptop has the same node-to-DAC pairs
as early models and the G14, this includes bass speakers which are by
default mapped incorrectly to the 0x06 node.

Add a quirk to use the same DAC pairs as the G14.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221010070347.36883-1-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: hda/realtek: Correct pin configs for ASUS G533Z
Luke D. Jones [Mon, 10 Oct 2022 06:57:02 +0000 (19:57 +1300)]
ALSA: hda/realtek: Correct pin configs for ASUS G533Z

The initial fix for ASUS G533Z was based on faulty information. This
fixes the pincfg to values that have been verified with no existing
module options or other hacks enabled.

Enables headphone jack, and 5.1 surround.

[ corrected the indent level by tiwai ]

Fixes: bc2c23549ccd ("ALSA: hda/realtek: Add pincfg for ASUS G533Z HP jack")
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221010065702.35190-1-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: usb-audio: Avoid superfluous endpoint setup
Takashi Iwai [Sun, 9 Oct 2022 10:42:12 +0000 (12:42 +0200)]
ALSA: usb-audio: Avoid superfluous endpoint setup

After splitting to snd_usb_endpoint_set_params() and *_prepare(), the
skip of each function should be checked with different flags, while we
still use ep->need_setup as the single one.  Introduce
ep->need_prepare for indicating the need of prepare, and also add the
missing check of ep->need_setup at the set_params.

Fixes: 2be79d586454 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2)")
Link: https://lore.kernel.org/r/20221009104212.18877-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: usb-audio: Correct the return code from snd_usb_endpoint_set_params()
Takashi Iwai [Sun, 9 Oct 2022 10:42:11 +0000 (12:42 +0200)]
ALSA: usb-audio: Correct the return code from snd_usb_endpoint_set_params()

snd_usb_endpoint_set_params() should return zero for a success, but
currently it returns the sample rate.  Correct it.

Fixes: 2be79d586454 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2)")
Link: https://lore.kernel.org/r/20221009104212.18877-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params()
Takashi Iwai [Sun, 9 Oct 2022 10:42:10 +0000 (12:42 +0200)]
ALSA: usb-audio: Apply mutex around snd_usb_endpoint_set_params()

The protection with chip->mutex was lost after splitting
snd_usb_endpoint_set_params() and snd_usb_endpoint_prepare().
Apply the same mutex again to the former function.

Fixes: 2be79d586454 ("ALSA: usb-audio: Split endpoint setups for hw_params and prepare (take#2)")
Link: https://lore.kernel.org/r/20221009104212.18877-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: usb-audio: Avoid unnecessary interface change at EP close
Takashi Iwai [Sun, 9 Oct 2022 10:42:09 +0000 (12:42 +0200)]
ALSA: usb-audio: Avoid unnecessary interface change at EP close

We toggle USB interface at PCM prepare and reset at close.  When the
PCM isn't prepared, resetting again makes little sense.
Check the current altset and avoid unnecessary interface reset at EP
close.

Link: https://lore.kernel.org/r/20221009104212.18877-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: hda: Update register polling macros
Amadeusz Sławiński [Fri, 7 Oct 2022 08:48:56 +0000 (10:48 +0200)]
ALSA: hda: Update register polling macros

Recent commit d91857059def ("ALSA: hda: Rework snd_hdac_stream_reset() to use macros")
missed that on some devices register access needs to be done with
unaligned access helper. Change polling macros to use
read_poll_timeout_atomic() in order to specify register read function.

Fixes: d91857059def ("ALSA: hda: Rework snd_hdac_stream_reset() to use macros")
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/alsa-devel/20220818141517.109280-1-amadeuszx.slawinski@linux.intel.com/T/#m1270737db52b5ef163eff73cb5f862d16a07a428
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20221007084856.1638302-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530
Callum Osmotherly [Wed, 5 Oct 2022 07:14:16 +0000 (17:44 +1030)]
ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530

After some feedback from users with Dell Precision 5530 machines, this
patch reverts the previous change to add ALC289_FIXUP_DUAL_SPK.
While it improved the speaker output quality, it caused the headphone
jack to have an audible "pop" sound when power saving was toggled.

Fixes: 1885ff13d4c4 ("ALSA: hda/realtek: Enable 4-speaker output Dell Precision 5530 laptop")
Signed-off-by: Callum Osmotherly <callum.osmotherly@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/Yz0uyN1zwZhnyRD6@piranha
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoMerge tag 'asoc-v6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Mon, 3 Oct 2022 14:30:42 +0000 (16:30 +0200)]
Merge tag 'asoc-v6.1' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v6.1

This has been a very quiet release for the core but quite a busy one for
drivers with a big crop of new drivers and lots of feature additions and
fixes to existing ones:

 - A new string helper parse_int_array_user().
 - Improvements to the SOF IPC4 code, especially around trace.
 - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silcon
   systems, Everest ES8326, Intel Sky Lake and Kaby Lake, MediaTek
   MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450
   and Texas Instruments SRC4392

There is a conflict with the conversion of I2C remove functions to void
in the cs42l42 driver which is fairly straightforward to resolve but
should be highlighted to Linus.

21 months agoMerge branch 'for-next' into for-linus
Takashi Iwai [Mon, 3 Oct 2022 06:48:26 +0000 (08:48 +0200)]
Merge branch 'for-next' into for-linus

21 months agoALSA: hda: Fix position reporting on Poulsbo
Takashi Iwai [Sat, 1 Oct 2022 14:21:24 +0000 (16:21 +0200)]
ALSA: hda: Fix position reporting on Poulsbo

Hans reported that his Sony VAIO VPX11S1E showed the broken sound
behavior at the start of the stream for a couple of seconds, and it
turned out that the position_fix=1 option fixes the issue.  It implies
that the position reporting is inaccurate, and very likely hitting on
all Poulsbo devices.

The patch applies the workaround for Poulsbo generically to switch to
LPIB mode instead of the default position buffer.

Reported-and-tested-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/3e8697e1-87c6-7a7b-d2e8-b21f1d2f181b@redhat.com
Link: https://lore.kernel.org/r/20221001142124.7241-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: hda/hdmi: Don't skip notification handling during PM operation
Takashi Iwai [Sat, 1 Oct 2022 07:48:10 +0000 (09:48 +0200)]
ALSA: hda/hdmi: Don't skip notification handling during PM operation

The HDMI driver skips the notification handling from the graphics
driver when the codec driver is being in the PM operation.  This
behavior was introduced by the commit eb399d3c99d8 ("ALSA: hda - Skip
ELD notification during PM process").  This skip may cause a problem,
as we may miss the ELD update when the connection/disconnection
happens right at the runtime-PM operation of the audio codec.

Although this workaround was valid at that time, it's no longer true;
the fix was required just because the ELD update procedure needed to
wake up the audio codec, which had lead to a runtime-resume during a
runtime-suspend.  Meanwhile, the ELD update procedure doesn't need a
codec wake up any longer since the commit 788d441a164c ("ALSA: hda -
Use component ops for i915 HDMI/DP audio jack handling"); i.e. there
is no much reason for skipping the notification.

Let's drop those checks for addressing the missing notification.

Fixes: 788d441a164c ("ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling")
Reported-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20220927135807.4097052-1-brent.lu@intel.com
Link: https://lore.kernel.org/r/20221001074809.7461-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoMerge tag 'asoc-fix-v6.0-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Fri, 30 Sep 2022 16:18:20 +0000 (18:18 +0200)]
Merge tag 'asoc-fix-v6.0-rc7' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Last fixes for v6.0

In the even that there's another pull request here's some more driver
specific fixes.

21 months agoASoC: rockchip: i2s: use regmap_read_poll_timeout_atomic to poll I2S_CLR
Judy Hsiao [Fri, 30 Sep 2022 15:15:46 +0000 (15:15 +0000)]
ASoC: rockchip: i2s: use regmap_read_poll_timeout_atomic to poll I2S_CLR

1. Uses regmap_read_poll_timeout_atomic to poll I2S_CLR as it is called
   within a spin lock.

2. Fixes the typo of break condition in regmap_read_poll_timeout_atomic.

Fixes: fbb0ec656ee5 ("ASoC: rockchip: i2s: use regmap_read_poll_timeout to poll I2S_CLR")
Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Link: https://lore.kernel.org/r/20220930151546.2017667-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: Document audio OF graph dai-tdm-slot-num dai-tdm-slot-width props
Marek Vasut [Tue, 27 Sep 2022 18:53:59 +0000 (20:53 +0200)]
ASoC: dt-bindings: Document audio OF graph dai-tdm-slot-num dai-tdm-slot-width props

Document dai-tdm-slot-num and dai-tdm-slot-width props as those are
parsed by simple graph card and may therefore appear in audio OF graph
node.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220927185359.294322-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: qcom: fix unmet direct dependencies for SND_SOC_QDSP6
Srinivas Kandagatla [Fri, 30 Sep 2022 10:53:47 +0000 (11:53 +0100)]
ASoC: qcom: fix unmet direct dependencies for SND_SOC_QDSP6

SND_SOC_QDSP6 already has COMPILE_TEST so remove that from
SND_SOC_SC8280XP and also add QCOM_APR dependencies to
SND_SOC_SC8280XP like other Qualcomm machine drivers.

This should also fix below warning:
on x86_64, when QCOM_APR is not set and COMPILE_TEST=y:

WARNING: unmet direct dependencies detected for SND_SOC_QDSP6
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y]
&& SND_SOC_QCOM [=y] && QCOM_APR [=n] && COMMON_CLK [=y]
  Selected by [y]:
  - SND_SOC_SC8280XP [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y]
&& SND_SOC_QCOM [=y] && (QCOM_APR [=n] || COMPILE_TEST [=y]) &&
 SOUNDWIRE [=y] && COMMON_CLK [=y]

Fixes: 295aeea6646a ("ASoC: qcom: add machine driver for sc8280xp")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220930105347.41127-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoALSA: usb-audio: Fix potential memory leaks
Takashi Iwai [Fri, 30 Sep 2022 10:01:51 +0000 (12:01 +0200)]
ALSA: usb-audio: Fix potential memory leaks

When the driver hits -ENOMEM at allocating a URB or a buffer, it
aborts and goes to the error path that releases the all previously
allocated resources.  However, when -ENOMEM hits at the middle of the
sync EP URB allocation loop, the partially allocated URBs might be
left without released, because ep->nurbs is still zero at that point.

Fix it by setting ep->nurbs at first, so that the error handler loops
over the full URB list.

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220930100151.19461-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: usb-audio: Fix NULL dererence at error path
Takashi Iwai [Fri, 30 Sep 2022 10:01:29 +0000 (12:01 +0200)]
ALSA: usb-audio: Fix NULL dererence at error path

At an error path to release URB buffers and contexts, the driver might
hit a NULL dererence for u->urb pointer, when u->buffer_size has been
already set but the actual URB allocation failed.

Fix it by adding the NULL check of urb.  Also, make sure that
buffer_size is cleared after the error path or the close.

Cc: <stable@vger.kernel.org>
Reported-by: Sabri N. Ferreiro <snferreiro1@gmail.com>
Link: https://lore.kernel.org/r/CAKG+3NRjTey+fFfUEGwuxL-pi_=T4cUskYG9OzpzHytF+tzYng@mail.gmail.com
Link: https://lore.kernel.org/r/20220930100129.19445-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoASoC: mediatek: mt8192-mt6359: Set the driver name for the card
Nícolas F. R. A. Prado [Thu, 29 Sep 2022 20:54:53 +0000 (16:54 -0400)]
ASoC: mediatek: mt8192-mt6359: Set the driver name for the card

The ASoC core automatically populates the driver name field in the card
from the card name if left unset. However, since the driver name can be
at most 16 characters long, wrapping will happen if the card name is
longer, which is the case for the mt8192-mt6359 driver.

Explicitly set the driver name for the card in order to avoid said
wrapping and have a readable driver name exposed to userspace.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220929205453.1144142-1-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoALSA: hda/realtek: More robust component matching for CS35L41
Takashi Iwai [Fri, 30 Sep 2022 08:48:10 +0000 (10:48 +0200)]
ALSA: hda/realtek: More robust component matching for CS35L41

As the previous commit implies, a system may have a different SPI bus
number that is embedded in the device string.  And, assuming the fixed
bus number is rather fragile; it may be assigned differently depending
on the configuration or on the boot environment.  Once when a bus
number change happens, the binding fails, resulting in the silence.

This patch tries to make the matching a bit more relaxed, allowing to
bind with a different bus number (or without it).  So the previous
fix, the introduction of ALC245_FIXUP_CS35L41_SPI1_2 fixup became
superfluous, and this is unified to ALC245_FIXUP_CS35L41_SPI_2.

Fixes: 225f6e1bc151 ("ALSA: hda/realtek: Add quirk for HP Zbook Firefly 14 G9 model")
Link: https://lore.kernel.org/r/20220930084810.10435-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoASoC: Intel: sof_rt5682: remove SOF_RT1015_SPEAKER_AMP_100FS flag
Brent Lu [Tue, 13 Sep 2022 07:49:06 +0000 (15:49 +0800)]
ASoC: Intel: sof_rt5682: remove SOF_RT1015_SPEAKER_AMP_100FS flag

This flag could be removed since we now have API to query bclk
fequency setting in the topology. The dai link structure itself also
provides DAI format information instead of figuring it out with fs
number.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220913074906.926774-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: nau8825: Add TDM support
David Lin [Fri, 30 Sep 2022 07:28:05 +0000 (15:28 +0800)]
ASoC: nau8825: Add TDM support

Support TDM format for NAU88L25.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20220930072804.2524352-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoFix PM disable depth imbalance in probe
Mark Brown [Fri, 30 Sep 2022 08:15:58 +0000 (09:15 +0100)]
Fix PM disable depth imbalance in probe

Merge series from Zhang Qilong <zhangqilong3@huawei.com>:

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of probe.

Zhang Qilong (4):
  ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe
  ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe
  ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe
  ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe

 sound/soc/codecs/mt6660.c | 8 ++++++--
 sound/soc/codecs/wm5102.c | 6 +++---
 sound/soc/codecs/wm5110.c | 6 +++---
 sound/soc/codecs/wm8997.c | 6 +++---
 4 files changed, 15 insertions(+), 11 deletions(-)

--
2.25.1

21 months agoASoC: core: clarify the driver name initialization
Jaroslav Kysela [Thu, 29 Sep 2022 14:37:54 +0000 (16:37 +0200)]
ASoC: core: clarify the driver name initialization

The driver field in the struct snd_ctl_card_info is a valid
user space identifier. Actually, many ASoC drivers do not care
and let to initialize this field using a standard wrapping method.
Unfortunately, in this way, this field becomes unusable and
unreadable for the drivers with longer card names. Also,
there is a possibility to have clashes (driver field has
only limit of 15 characters).

This change will print an error when the wrapping is used.
The developers of the affected drivers should fix the problem.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe
Zhang Qilong [Wed, 28 Sep 2022 16:01:16 +0000 (00:01 +0800)]
ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of mt6660_i2c_probe.

Fixes:f289e55c6eeb4 ("ASoC: Add MediaTek MT6660 Speaker Amp Driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160116.125020-5-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe
Zhang Qilong [Wed, 28 Sep 2022 16:01:15 +0000 (00:01 +0800)]
ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of wm5102_probe.

Fixes:93e8791dd34ca ("ASoC: wm5102: Initial driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160116.125020-4-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe
Zhang Qilong [Wed, 28 Sep 2022 16:01:14 +0000 (00:01 +0800)]
ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of wm5110_probe.

Fixes:5c6af635fd772 ("ASoC: wm5110: Add audio CODEC driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160116.125020-3-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe
Zhang Qilong [Wed, 28 Sep 2022 16:01:13 +0000 (00:01 +0800)]
ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of wm8997_probe

Fixes:40843aea5a9bd ("ASoC: wm8997: Initial CODEC driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160116.125020-2-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
Krzysztof Kozlowski [Thu, 29 Sep 2022 13:15:28 +0000 (15:15 +0200)]
ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"

This reverts commit ddea4bbf287b6028eaa15a185d0693856956ecf2 ("ASoC:
wcd-mbhc-v2: use pm_runtime_resume_and_get()"), because it introduced
double runtime PM put if pm_runtime_get_sync() returns -EACCES:

  wcd934x-codec wcd934x-codec.3.auto: WCD934X Minor:0x1 Version:0x401
  wcd934x-codec wcd934x-codec.3.auto: Runtime PM usage count underflow!

The commit claimed no changes in functionality except dropping the
reference on -EACCESS.  This is exactly the change introducing bug
because function calls unconditionally pm_runtime_put_autosuspend() at
the end.

Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220929131528.217502-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8186: Fix spelling mistake "slect" -> "select"
Colin Ian King [Wed, 28 Sep 2022 22:04:17 +0000 (23:04 +0100)]
ASoC: mediatek: mt8186: Fix spelling mistake "slect" -> "select"

There are some spelling mistakes in dev_err messages. Fix them.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220928220417.66799-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoALSA: hda/realtek: Add quirk for HP Zbook Firefly 14 G9 model
Takashi Iwai [Thu, 29 Sep 2022 06:14:55 +0000 (08:14 +0200)]
ALSA: hda/realtek: Add quirk for HP Zbook Firefly 14 G9 model

HP Zbook Firefly 14 G9 model (103c:8abb) requires yet another binding
with CS35L41 codec, but with a slightly different configuration.  It's
over spi1 instead of spi0.  Create a new fixup entry for that.

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220929061455.13355-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: asihpi - Remove unused struct hpi_subsys_response
Yuan Can [Wed, 28 Sep 2022 08:48:33 +0000 (08:48 +0000)]
ALSA: asihpi - Remove unused struct hpi_subsys_response

After commit 3285ea10e9b0("ALSA: asihpi - Interrelated HPI tidy up."),
struct hpi_subsys_response is not used any more and can be removed as well.

Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20220928084833.61131-1-yuancan@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: sb: Use DIV_ROUND_UP() instead of open-coding it
Shang XiaoJing [Tue, 27 Sep 2022 14:11:10 +0000 (22:11 +0800)]
ALSA: sb: Use DIV_ROUND_UP() instead of open-coding it

Use DIV_ROUND_UP() instead of open-coding it, which intents and makes
it more clear what is going on for the casual reviewer.

The Coccinelle references Commit e4d8aef21403 ("ALSA: usb: Use
DIV_ROUND_UP() instead of open-coding it").

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20220927141110.18033-1-shangxiaojing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoASoC: mediatek: mt8195: update audio tuner settings
Trevor Wu [Tue, 27 Sep 2022 15:11:41 +0000 (23:11 +0800)]
ASoC: mediatek: mt8195: update audio tuner settings

Audio tuner is used to handle clock drift between 26M and APLL domain.

It's expected when abs(chg_cnt) equals to upper bound, tuner updates pcw
setting automatically, and then abs(chg_cnt) decreases.
In the stress test, we found abs(chg_cnt) possibly equals to 2 at the
unexpected timing. This results in wrong pcw updating.
Finally, abs(chg_cnt) will always be larger than upper bound,

As a result, we update the upper bound to 3 to handle the corner case.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220927151141.11846-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoFix PM disable depth imbalance in stm32 probe
Mark Brown [Tue, 27 Sep 2022 18:58:57 +0000 (19:58 +0100)]
Fix PM disable depth imbalance in stm32 probe

Merge series from Zhang Qilong <zhangqilong3@huawei.com>:

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced. We fix it by moving pm_runtime_enable to the
endding of probe.

21 months agoASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe
Zhang Qilong [Tue, 27 Sep 2022 14:26:40 +0000 (22:26 +0800)]
ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of stm32_i2s_probe.

Fixes:32a956a1fadf ("ASoC: stm32: i2s: add pm_runtime support")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20220927142640.64647-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe
Zhang Qilong [Tue, 27 Sep 2022 14:26:01 +0000 (22:26 +0800)]
ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of stm32_spdifrx_probe.

Fixes:ac5e3efd55868 ("ASoC: stm32: spdifrx: add pm_runtime support")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20220927142601.64266-3-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe
Zhang Qilong [Tue, 27 Sep 2022 14:26:00 +0000 (22:26 +0800)]
ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of stm32_adfsdm_probe.

Fixes:98e500a12f934 ("ASoC: stm32: dfsdm: add pm_runtime support for audio")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20220927142601.64266-2-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: cs42l42: Fallback to headphones for type detect
Stefan Binding [Tue, 27 Sep 2022 12:14:40 +0000 (13:14 +0100)]
ASoC: cs42l42: Fallback to headphones for type detect

After tip sense detects a jack insertion, if automatic
type detection, and manual type detection fails, then
fall back to assume the jack connected belongs to
headphones.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220927121440.2506632-1-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: apple: mca: Adjust timing of component unregister
Martin Povišer [Tue, 27 Sep 2022 11:34:26 +0000 (13:34 +0200)]
ASoC: apple: mca: Adjust timing of component unregister

On removal of the driver, the ASoC component should be unregistered
first, before we start releasing any of the other resources.

Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220927113426.49724-3-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: apple: mca: Remove stale release of DMA channels
Martin Povišer [Tue, 27 Sep 2022 11:34:25 +0000 (13:34 +0200)]
ASoC: apple: mca: Remove stale release of DMA channels

The commit 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA
channels") shuffled around with the requesting and releasing of DMA
channels. It left behind stale release calls from within
apple_mca_release, remove those now.

Fixes: 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220927113426.49724-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: apple: mca: Trigger, not deassert, the peripheral reset
Martin Povišer [Tue, 27 Sep 2022 11:34:24 +0000 (13:34 +0200)]
ASoC: apple: mca: Trigger, not deassert, the peripheral reset

Replace the deassertion of the peripheral's shared reset with the
triggering of a pulse on it. This is what we should have been using all
along as the platform's custom is not leaving the reset asserted on
unused peripherals.

Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220927113426.49724-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: Skylake: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
Gustavo A. R. Silva [Mon, 26 Sep 2022 22:58:17 +0000 (17:58 -0500)]
ASoC: Intel: Skylake: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper

Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations in anonymous union with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for flexible-array members in unions.

Link: https://github.com/KSPP/linux/issues/193
Link: https://github.com/KSPP/linux/issues/226
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/YzIuiUul2CwPlkKh@work
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: st,stm32-sai: Document audio OF graph port
Marek Vasut [Tue, 27 Sep 2022 00:20:04 +0000 (02:20 +0200)]
ASoC: st,stm32-sai: Document audio OF graph port

It is expected that the SAI subnodes would contain audio OF graph port
with endpoint to link it with the other side of audio link. Document
the port: property.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20220927002004.685108-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: control.h: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Gustavo A. R. Silva [Mon, 26 Sep 2022 21:40:55 +0000 (16:40 -0500)]
ASoC: SOF: control.h: Replace zero-length array with DECLARE_FLEX_ARRAY() helper

Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations in anonymous union with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for flexible-array members in unions.

Link: https://github.com/KSPP/linux/issues/193
Link: https://github.com/KSPP/linux/issues/211
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/YzIcZ11k8RiQtS2T@work
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: mediatek: mt8195: Add dsp_ops callback
Mark Brown [Tue, 27 Sep 2022 11:07:27 +0000 (12:07 +0100)]
ASoC: SOF: mediatek: mt8195: Add dsp_ops callback

Merge series from Chunxu Li <chunxu.li@mediatek.com>:

Support more operations for MediaTek DSPs using SOF.

21 months agoALSA: dmaengine: increment buffer pointer atomically
Andreas Pape [Mon, 26 Sep 2022 16:58:13 +0000 (18:58 +0200)]
ALSA: dmaengine: increment buffer pointer atomically

Setting pointer and afterwards checking for wraparound leads
to the possibility of returning the inconsistent pointer position.

This patch increments buffer pointer atomically to avoid this issue.

Fixes: e7f73a1613567a ("ASoC: Add dmaengine PCM helper functions")
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Link: https://lore.kernel.org/r/1664211493-11789-1-git-send-email-erosca@de.adit-jv.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agousb: gadget: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:58 +0000 (15:55 +0200)]
usb: gadget: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220926135558.26580-12-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoASoC: sh: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:57 +0000 (15:55 +0200)]
ASoC: sh: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220926135558.26580-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoASoC: intel: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:56 +0000 (15:55 +0200)]
ASoC: intel: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220926135558.26580-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: usx2y: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:55 +0000 (15:55 +0200)]
ALSA: usx2y: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: usb-audio: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:54 +0000 (15:55 +0200)]
ALSA: usb-audio: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: asihpi: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:53 +0000 (15:55 +0200)]
ALSA: asihpi: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: hda: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:52 +0000 (15:55 +0200)]
ALSA: hda: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: firewire: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:51 +0000 (15:55 +0200)]
ALSA: firewire: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: aloop: Replace runtime->status->state reference to runtime->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:50 +0000 (15:55 +0200)]
ALSA: aloop: Replace runtime->status->state reference to runtime->state

The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: pcm: Make mmap status read-only
Takashi Iwai [Mon, 26 Sep 2022 13:55:49 +0000 (15:55 +0200)]
ALSA: pcm: Make mmap status read-only

The mmap status record should be read-only.  Modifying it from
user-space may screw up things unexpectedly, so let's clear the write
bits at exposing it.

Note that alsa-lib and other known user-space apps access the mmapped
status only as read-only, hence this change shouldn't break the
existing applications.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: pcm: Avoid reference to status->state
Takashi Iwai [Mon, 26 Sep 2022 13:55:48 +0000 (15:55 +0200)]
ALSA: pcm: Avoid reference to status->state

In the PCM core and driver code, there are lots place referring to the
current PCM state via runtime->status->state.  This patch introduced a
local PCM state in runtime itself and replaces those references with
runtime->state.  It has improvements in two aspects:

- The reduction of a indirect access leads to more code optimization

- It avoids a possible (unexpected) modification of the state via mmap
  of the status record

The status->state is updated together with runtime->state, so that
user-space can still read the current state via mmap like before,
too.

This patch touches only the ALSA core code.  The changes in each
driver will follow in later patches.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: Remove some left-over license text in include/uapi/sound/
Christophe JAILLET [Sun, 25 Sep 2022 13:20:46 +0000 (15:20 +0200)]
ALSA: Remove some left-over license text in include/uapi/sound/

There is already a SPDX-License-Identifier tag, so the corresponding
license text can be removed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/203c1db92c470925f31e361f6e7d180812501f2e.1664112023.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: firewire: Remove some left-over license text in sound/firewire
Christophe JAILLET [Sun, 25 Sep 2022 12:57:51 +0000 (14:57 +0200)]
ALSA: firewire: Remove some left-over license text in sound/firewire

There is already a SPDX-License-Identifier tag, so the corresponding license
text can be removed.

While at it, be more consistent and:
  - add a missing .c (ff-protocol-latter)
  - remove an empty line (motu-protocol-v1)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/2bfe76c7eeb0f5205a1427e280bf8d9da0354a62.1664110649.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoASoC: MAINTAINERS: add bindings and APR to Qualcomm Audio entry
Krzysztof Kozlowski [Fri, 23 Sep 2022 20:31:40 +0000 (22:31 +0200)]
ASoC: MAINTAINERS: add bindings and APR to Qualcomm Audio entry

Extend the Qualcomm Audio maintainer entry to include sound related
bindings and the Qualcomm APR/GPR (Asynchronous/Generic Packet Router)
IPC driver, which is tightly related to the Audio DSP.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220923203140.514730-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wcd934x: Fix Kconfig dependency
Ren Zhijie [Mon, 26 Sep 2022 07:40:42 +0000 (07:40 +0000)]
ASoC: codecs: wcd934x: Fix Kconfig dependency

If CONFIG_REGMAP_SLIMBUS is not set,
make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-,
will be failed, like this:

sound/soc/codecs/wcd934x.o: In function `wcd934x_codec_probe':
wcd934x.c:(.text+0x3310): undefined reference to `__regmap_init_slimbus'
make: *** [vmlinux] Error 1

Add select REGMAP_SLIMBUS to config SND_SOC_WCD934X.

Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220926074042.13297-1-renzhijie2@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: mediatek: mt8195: Add pcm_pointer callback
Chunxu Li [Sat, 24 Sep 2022 03:35:59 +0000 (11:35 +0800)]
ASoC: SOF: mediatek: mt8195: Add pcm_pointer callback

Add pcm_pointer callback for mt8195 to support read
host position from DSP

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220924033559.26599-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: mediatek: mt8195: Add pcm_hw_params callback
Chunxu Li [Sat, 24 Sep 2022 03:35:58 +0000 (11:35 +0800)]
ASoC: SOF: mediatek: mt8195: Add pcm_hw_params callback

Add pcm_hw_params callback for mt8195 to support continue
update dma host position

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220924033559.26599-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoALSA: memalloc: use __GFP_RETRY_MAYFAIL for DMA mem allocs
Kai Vehmanen [Fri, 23 Sep 2022 15:35:01 +0000 (18:35 +0300)]
ALSA: memalloc: use __GFP_RETRY_MAYFAIL for DMA mem allocs

Use __GFP_RETRY_MAYFAIL instead of __GFP__NORETRY in
snd_dma_dev_alloc(), snd_dma_wc_alloc() and friends, to allocate pages
for device memory. The MAYFAIL flag retains the semantics of not
triggering the OOM killer, but lowers the risk of alloc failure.

MAYFAIL flag was added in commit dcda9b04713c3 ("mm, tree wide: replace
__GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic").

This change addresses recurring failures with SOF audio driver in test
cases where a system suspend-resume stress test is run, combined with an
active high memory-load use-case. The failure typically shows up as:

[ 379.480229] sof-audio-pci-intel-tgl 0000:00:1f.3: booting DSP firmware
[ 379.484803] sof-audio-pci-intel-tgl 0000:00:1f.3: error: memory alloc failed: -12
[ 379.484810] sof-audio-pci-intel-tgl 0000:00:1f.3: error: dma prepare for ICCMAX stream failed

Multiple fixes to reduce the memory usage of DSP boot have been
identified in SOF driver, but even with those fixes, debug on affected
systems has shown that even a single page alloc may fail with
__GFP_NORETRY. When this occurs, system is under significant load on
physical memory, but a lot of reclaimable pages are available, so the
system has not run out of memory. With __GFP_RETRY_MAYFAIL, the errors
are not hit in these stress tests.

The alloc failure is severe as audio capability is completely lost if
alloc failure is hit at system resume.

An alternative solution was considered where the resources for DSP boot
would be kept allocated until driver is unbound. This would avoid the
allocation failure, but consume memory that is only needed temporarily
at probe and resume time. It seems better to not hang on to the memory,
but rather work a bit harder for allocating the pages at resume.

BugLink: https://github.com/thesofproject/linux/issues/3844
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220923153501.3326041-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoALSA: hda/hdmi: Limit the maximal count of PCM devices to 8
Jaroslav Kysela [Fri, 23 Sep 2022 08:22:36 +0000 (10:22 +0200)]
ALSA: hda/hdmi: Limit the maximal count of PCM devices to 8

The current hardware has up to 4 converters. Save little space.
The limit 8 is enough even for a more improved hardware.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220923082236.61024-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agoASoC: SOF: ipc4/Intel: Improve and enable IPC error dump
Mark Brown [Fri, 23 Sep 2022 19:46:25 +0000 (20:46 +0100)]
ASoC: SOF: ipc4/Intel: Improve and enable IPC error dump

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

On Intel platforms the registers for DSP communications are used differently,
the IPC dump information is not correct since important registers are not
printed and existing ones are used a bit differently for IPC4.

As a last step, enable the IPC timeout 'handling' and allow the printout of
the now usefull IPC dump.

21 months agoASoC: codecs: qcom add support for SM8450 and SC8280XP
Mark Brown [Fri, 23 Sep 2022 19:46:18 +0000 (20:46 +0100)]
ASoC: codecs: qcom add support for SM8450 and SC8280XP

Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support for SM8450 and SC8280XP SoC and also some of
the fixes requried to get stable audio on X13s.

Tested SmartSpeakers and Headset on SM8450 MTP and
Lenovo Thinkpad X13s.

21 months agoASoC: ssm2518: switch to using gpiod API
Dmitry Torokhov [Tue, 20 Sep 2022 02:58:04 +0000 (19:58 -0700)]
ASoC: ssm2518: switch to using gpiod API

This patch converts the driver to newer gpiod API, so that we can stop
exporting OF-specific legacy gpio API.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20220920025804.1788667-2-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: ssm2518: drop support for platform data
Dmitry Torokhov [Tue, 20 Sep 2022 02:58:03 +0000 (19:58 -0700)]
ASoC: ssm2518: drop support for platform data

There are currently no users of this driver's platform data in the
mainline kernel, so let's drop it.

Newer devices should use DT, ACPI, or static software properties to
describe the hardware.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20220920025804.1788667-1-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: skylake: remove unnecessary dev_set_drvdata()
Yang Yingliang [Fri, 16 Sep 2022 14:07:57 +0000 (22:07 +0800)]
ASoC: Intel: skylake: remove unnecessary dev_set_drvdata()

Remove unnecessary dev_set_drvdata() in skl_remove(), the driver_data
will be set to NULL in device_unbind_cleanup() after calling ->remove().

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220916140757.681414-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: da7219: Fix an error handling path in da7219_register_dai_clks()
Christophe JAILLET [Thu, 22 Sep 2022 19:44:57 +0000 (21:44 +0200)]
ASoC: da7219: Fix an error handling path in da7219_register_dai_clks()

If clk_hw_register() fails, the corresponding clk should not be
unregistered.

To handle errors from loops, clean up partial iterations before doing the
goto.  So add a clk_hw_unregister().
Then use a while (--i >= 0) loop in the unwind section.

Fixes: 78013a1cf297 ("ASoC: da7219: Fix clock handling around codec level probe")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/e4acceab57a0d9e477a8d5890a45c5309e553e7c.1663875789.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: fsl_asrc_dma: fully initialize structs
Sascha Hauer [Fri, 23 Sep 2022 10:15:47 +0000 (18:15 +0800)]
ASoC: fsl_asrc_dma: fully initialize structs

The driver uses two statically ininitialized struct dma_slave_config,
but only one of them is initialized to zero. Initialize config_be to
zero as well to make sure that no fields are filled with random values.
Let the compiler do this instead of explicitly calling memset() which
makes it easier to read.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1663928147-10106-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Zhang Qilong [Thu, 22 Sep 2022 14:58:46 +0000 (22:58 +0800)]
ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using the newest pm_runtime_resume_and_get is more appropriate
for simplifing code here.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220922145846.114312-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: fsl_audmux: Fix amixer write errors
Shengjiu Wang [Tue, 6 Sep 2022 06:49:21 +0000 (14:49 +0800)]
ASoC: fsl_audmux: Fix amixer write errors

This reverts commit 944c517b8c8388 ("ASoC: fsl_audmix: make clock and
output src write only").

There is error after making clock and output src write only

$amixer -c imxaudmix cset numid=1 1
amixer: Cannot read the given element from control sysdefault:3

Which is worse than before, so let's revert the change.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1662446961-20799-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: MTL: Fixes for suspend/resume
Mark Brown [Fri, 23 Sep 2022 16:53:13 +0000 (17:53 +0100)]
ASoC: SOF: Intel: MTL: Fixes for suspend/resume

Merge series from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

This series includes fixes for suspend/resume and module
loading/unloading for the MTL platform.

21 months agoASoC: mediatek: Allow separate handling of headphone and headset mic jack
Mark Brown [Fri, 23 Sep 2022 16:53:06 +0000 (17:53 +0100)]
ASoC: mediatek: Allow separate handling of headphone and headset mic jack

Merge series from Nícolas F. R. A. Prado <nfraprado@collabora.com>:

This series allows the headphone and headset mic jack status to be
handled separately by userspace on MT8192, MT8195 and MT8186.

Changes based on commit d0508b4f1604 ("ASoC: rk3399_gru_sound: Add DAPM
pins, kcontrols for jack detection"). Found while searching for an
alternative for JackSwitch [1].

[1] https://lore.kernel.org/all/b98a8a77-7652-1995-27ba-eb7b6d30202a@gmail.com/

Nícolas F. R. A. Prado (6):
  ASoC: mediatek: mt8192-mt6359: Expose individual headset jack pins
  ASoC: mediatek: mt8195: Expose individual headset jack pins
  ASoC: mediatek: mt8186-da7219: Add headset widgets with switches
  ASoC: mediatek: mt8186-da7219: Expose individual headset jack pins
  ASoC: mediatek: mt8186-rt5682: Add headset widgets with switches
  ASoC: mediatek: mt8186-rt5682: Expose individual headset jack pins

 .../mt8186/mt8186-mt6366-da7219-max98357.c    | 25 +++++++++++++++++--
 .../mt8186/mt8186-mt6366-rt1019-rt5682s.c     | 25 +++++++++++++++++--
 .../mt8192/mt8192-mt6359-rt1015-rt5682.c      | 17 +++++++++++--
 sound/soc/mediatek/mt8195/mt8195-mt6359.c     | 17 +++++++++++--
 4 files changed, 76 insertions(+), 8 deletions(-)

--
2.37.3

21 months agoASoC: SOF: ipc4: Call snd_sof_handle_fw_exception() in case of timeout
Peter Ujfalusi [Fri, 23 Sep 2022 13:36:16 +0000 (16:36 +0300)]
ASoC: SOF: ipc4: Call snd_sof_handle_fw_exception() in case of timeout

It can help debugging IPC timeout issues (like we do with IPC3) if we
dump the IPC and DSP information.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20220923133616.26267-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: hda: Only dump firmware registers for IPC3
Peter Ujfalusi [Fri, 23 Sep 2022 13:36:15 +0000 (16:36 +0300)]
ASoC: SOF: Intel: hda: Only dump firmware registers for IPC3

The firmware register dump is IPC3 specific, it is not available for other
IPC versions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20220923133616.26267-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: mtl: Print relevant register in ipc_dump
Peter Ujfalusi [Fri, 23 Sep 2022 13:36:14 +0000 (16:36 +0300)]
ASoC: SOF: Intel: mtl: Print relevant register in ipc_dump

The use of the IPC registers are different between IPC3 and IPC4.
The ipc_dump needs to use different prints depending on the used IPC
protocol.

The existing code was printing registers relevant for IPC3, which is not
even supported on MTL.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20220923133616.26267-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: skl: Use the ipc4 version of the ipc_dump
Peter Ujfalusi [Fri, 23 Sep 2022 13:36:13 +0000 (16:36 +0300)]
ASoC: SOF: Intel: skl: Use the ipc4 version of the ipc_dump

The use of the IPC registers are different between IPC3 and IPC4.
The ipc_dump needs to use different prints depending on the used IPC
protocol.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20220923133616.26267-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: hda: Add separate ops for ipc_dump for IPC4
Peter Ujfalusi [Fri, 23 Sep 2022 13:36:12 +0000 (16:36 +0300)]
ASoC: SOF: Intel: hda: Add separate ops for ipc_dump for IPC4

The use of the IPC registers are different between IPC3 and IPC4.
The ipc_dump needs to use different prints depending on the used IPC
protocol.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20220923133616.26267-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: cnl: Add separate ops for ipc_dump for IPC4
Peter Ujfalusi [Fri, 23 Sep 2022 13:36:11 +0000 (16:36 +0300)]
ASoC: SOF: Intel: cnl: Add separate ops for ipc_dump for IPC4

The use of the IPC registers are different between IPC3 and IPC4.
The ipc_dump needs to use different prints depending on the used IPC
protocol.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20220923133616.26267-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: va-macro: add support for sm8450 and sc8280xp
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:12 +0000 (18:01 +0100)]
ASoC: codecs: va-macro: add support for sm8450 and sc8280xp

LPASS VA Macro now has soundwire master to deal with access to
analog mic in low power island use cases.

This is added after sc8280xp, add support for this.
Along with this also add compatibles for sm8450 and sc8280xp.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-13-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: va-macro: clear the frame sync counter before enabling
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:11 +0000 (18:01 +0100)]
ASoC: codecs: va-macro: clear the frame sync counter before enabling

Clear the frame sync counter before enabling it.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-12-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: rx-macro: add support for sm8450 and sc8280xp
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:10 +0000 (18:01 +0100)]
ASoC: codecs: rx-macro: add support for sm8450 and sc8280xp

Add compatible for sm8450 and sc8280xp.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-11-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: tx-macro: add support for sm8450 and sc8280xp
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:09 +0000 (18:01 +0100)]
ASoC: codecs: tx-macro: add support for sm8450 and sc8280xp

Add compatible for sm8450 and sc8280xp.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa-macro: add support for sm8450 and sc8280xp
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:08 +0000 (18:01 +0100)]
ASoC: codecs: wsa-macro: add support for sm8450 and sc8280xp

Add compatible for sm8450 and sc8280xp.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: qcom: dt-bindings: add sm8450 and sc8280xp compatibles
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:07 +0000 (18:01 +0100)]
ASoC: qcom: dt-bindings: add sm8450 and sc8280xp compatibles

This patch adds SM8450 and SC8280XP compatible entry for LPASS TX, RX, WSA
and VA codec macros.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220906170112.1984-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa883x: add clock stop support
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:06 +0000 (18:01 +0100)]
ASoC: codecs: wsa883x: add clock stop support

WSA883x does support clock stop, so remove code that reset
the Codec during runtime pm suspend and add flag to mark
clock stop support.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: tx-macro: fix kcontrol put
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:05 +0000 (18:01 +0100)]
ASoC: codecs: tx-macro: fix kcontrol put

tx_macro_tx_mixer_put() and tx_macro_dec_mode_put() currently returns zero
eventhough it changes the value.
Fix this, so that change notifications are sent correctly.

Fixes: d207bdea0ca9 ("ASoC: codecs: lpass-tx-macro: add dapm widgets and route")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: tx-macro: fix active_decimator array
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:04 +0000 (18:01 +0100)]
ASoC: codecs: tx-macro: fix active_decimator array

currently active_decimator[] is unsigned long however we store negative
values when there is no decimator setup -1.

This is first bug, and the second bug is that we do not check if the decimator
is valid before writing to register using decimator as offset in
CDC_TXn_TX_PATH_CTL()

Fix these both by making active_decimator as integer array and adding check
in tx_macro_digital_mute() before accessing CDC_TXn_TX_PATH_CTL() register.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: tx-macro: handle swr_reset correctly
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:03 +0000 (18:01 +0100)]
ASoC: codecs: tx-macro: handle swr_reset correctly

Reset soundwire block on frame sync generation clock reset.
Without this we are hitting read/write timeouts randomly during
runtime pm. Along with this remove a swr_reset redundant flag.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: rx-macro: handle swr_reset correctly
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:02 +0000 (18:01 +0100)]
ASoC: codecs: rx-macro: handle swr_reset correctly

Reset soundwire block on frame sync generation clock reset.
Without this we are hitting read/write timeouts randomly during
runtime pm. Along with this remove a swr_reset redundant flag.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa-macro: handle swr_reset correctly
Srinivas Kandagatla [Tue, 6 Sep 2022 17:01:01 +0000 (18:01 +0100)]
ASoC: codecs: wsa-macro: handle swr_reset correctly

Reset soundwire block on frame sync generation clock reset.
Without this we are hitting read/write timeouts randomly during
runtime pm.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: sof_da7219_mx98360a: Access num_codecs through dai_link
Nathan Chancellor [Thu, 22 Sep 2022 15:37:52 +0000 (08:37 -0700)]
ASoC: Intel: sof_da7219_mx98360a: Access num_codecs through dai_link

After commit 3989ade2d1e7 ("ASoC: soc.h: remove num_cpus/codecs"), the
following build error occurs:

  sound/soc/intel/boards/sof_da7219_max98373.c:198:27: error: no member named 'num_codecs' in 'struct snd_soc_pcm_runtime'
          for (j = 0; j < runtime->num_codecs; j++) {
                          ~~~~~~~  ^
  1 error generated.

This conversion was missed by the aforementioned change. Do it now to
fix the build error.

Fixes: 3989ade2d1e7 ("ASoC: soc.h: remove num_cpus/codecs")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220922153752.336193-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: fsl: Remove unused inline function imx_pcm_dma_params_init_data()
Gaosheng Cui [Fri, 23 Sep 2022 09:03:55 +0000 (17:03 +0800)]
ASoC: fsl: Remove unused inline function imx_pcm_dma_params_init_data()

The imx_pcm_dma_params_init_data() are no longer used since
commit c31da0b196f9 ("ASoC: imx-ssi: Remove unused driver"),
and the function is used to initialize some members of
"struct imx_dma_data", it's more readable to assign the value
directly, imx_pcm_dma_params_init_data is useless, so remove it.

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20220923090355.507648-1-cuigaosheng1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8195-mt6359: Use snd_soc_pm_ops instead of custom ops
AngeloGioacchino Del Regno [Thu, 22 Sep 2022 10:35:02 +0000 (12:35 +0200)]
ASoC: mediatek: mt8195-mt6359: Use snd_soc_pm_ops instead of custom ops

It is possible to use the standard snd_soc_pm_ops for this card:
remove the custom mt8195_mt6359_pm_ops.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220922103502.49981-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: MTL: remove the unnecessary snd_sof_dsp_read()
Yong Zhi [Thu, 22 Sep 2022 21:36:44 +0000 (14:36 -0700)]
ASoC: SOF: Intel: MTL: remove the unnecessary snd_sof_dsp_read()

The return val of snd_sof_dsp_read() right before polling the same
register is not used, so remove the redundant call.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220922213644.666315-11-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Intel: MTL: reuse the common ops for PM
Ranjani Sridharan [Thu, 22 Sep 2022 21:36:43 +0000 (14:36 -0700)]
ASoC: SOF: Intel: MTL: reuse the common ops for PM

Now that the disabling of interrupts and powering down the DSP has been
abstracted, re-use the common ops for PM for MTL as well.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220922213644.666315-10-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>