platform/kernel/linux-rpi.git
2 years agoMerge tag 'asoc-fix-v5.15-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Wed, 8 Sep 2021 15:52:23 +0000 (17:52 +0200)]
Merge tag 'asoc-fix-v5.15-rc1' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.15

A collection of fixes that came in during the merge window, nothing too
remarkable but a reasonably large number of fixes.

2 years agoALSA: gus: Fix repeated probe for ISA interwave card
Takashi Iwai [Tue, 7 Sep 2021 09:39:30 +0000 (11:39 +0200)]
ALSA: gus: Fix repeated probe for ISA interwave card

The legacy ISA probe tries to probe the card repeatedly, and this
would conflict with the refactoring using devres.  Put the card
creation out of the loop and only probe GUS object repeatedly.

Fixes: 5b88da3c800f ("ALSA: gus: Allocate resources with device-managed APIs")
Link: https://lore.kernel.org/r/20210907093930.29009-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: gus: Fix repeated probes of snd_gus_create()
Takashi Iwai [Tue, 7 Sep 2021 09:39:29 +0000 (11:39 +0200)]
ALSA: gus: Fix repeated probes of snd_gus_create()

GUS card object may be repeatedly probed for the legacy ISA devices,
and the behavior doesn't fit with the devres resource management.

Revert partially back to the classical way for the snd_gus_card
object, so that the repeated calls of snd_gus_create() are allowed.

Fixes: 5b88da3c800f ("ALSA: gus: Allocate resources with device-managed APIs")
Reported-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/r/20210907093930.29009-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: vx222: fix null-ptr-deref
Tong Zhang [Tue, 7 Sep 2021 01:47:45 +0000 (18:47 -0700)]
ALSA: vx222: fix null-ptr-deref

a recent refactor created a null pointer vx in snd_vx222_probe().
The vx pointer should have been populated in snd_vx222_create() as
suggested in earlier version, otherwise vx->core.ibl.size will throw an
error.

[    1.298398] BUG: kernel NULL pointer dereference, address: 00000000000001d8
[    1.316799] RIP: 0010:snd_vx222_probe+0x155/0x290 [snd_vx222]

Fixes: 3bde3359aa16 ("ALSA: vx222: Allocate resources with device-managed APIs")
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Link: https://lore.kernel.org/r/20210907014746.1445278-1-ztong0001@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoASoC: rockchip: i2s: Fix concurrency between tx/rx
Sugar Zhang [Fri, 3 Sep 2021 13:07:14 +0000 (21:07 +0800)]
ASoC: rockchip: i2s: Fix concurrency between tx/rx

This patch adds lock to fix comcurrency between tx/rx
to fix 'rockchip-i2s ff070000.i2s; fail to clear'

Considering the situation;

       tx stream              rx stream
           |                      |
           |                   disable
         enable                   |
           |                    reset

After this patch:

         lock
           |
       tx stream
           |
         enable
           |
        unlock
       --------               ---------
                                lock
                                  |
                              rx stream
                                  |
                               disable
                                  |
                                reset
                                  |
                               unlock

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1630674434-650-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX
Trevor Wu [Fri, 3 Sep 2021 06:00:49 +0000 (14:00 +0800)]
ASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX

According to the description in dt-bindings, phandle assignment of
HDMI TX and DP TX are not required properties, but driver regards them
as required properties.
In real use case, it's expected that DP TX and HDMI TX are optional
features, so correct the behavior in driver.

Fixes: 40d605df0a7b ("ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210903060049.20764-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select
Nathan Chancellor [Thu, 2 Sep 2021 18:12:18 +0000 (11:12 -0700)]
ASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select

When CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH is enabled without
CONFIG_EXPERT, there is a Kconfig warning about unmet dependencies:

WARNING: unmet direct dependencies detected for SND_SOC_SDW_MOCKUP
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] &&
EXPERT [=n] && SOUNDWIRE [=y]
  Selected by [y]:
  - SND_SOC_INTEL_SOUNDWIRE_SOF_MACH [=y] && ...

Selecting a symbol does not account for dependencies. There are three
ways to resolve this:

1. Make CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select
   CONFIG_SND_SOC_SDW_MOCKUP only if CONFIG_EXPERT is set.

2. Make CONFIG_SND_SOC_SDW_MOCKUP's prompt depend on CONFIG_EXPERT so
   that it can be selected by options that only depend on
   CONFIG_SOUNDWIRE but still appear as a prompt to the user when
   CONFIG_EXPERT is set.

3. Make CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH imply
   CONFIG_SND_SOC_SDW_MOCKUP, which will select
   CONFIG_SND_SOC_SDW_MOCKUP when its dependencies are enabled but still
   allow the user to disable it.

Go with the third option as it gives the most flexibility while
retaining the original intent of the select.

Fixes: 0ccac3bcf356 ("ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests")
Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210902181217.2958966-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: fsl_rpmsg: Add compatible string for i.MX8ULP
Shengjiu Wang [Thu, 2 Sep 2021 03:32:05 +0000 (11:32 +0800)]
ASoC: dt-bindings: fsl_rpmsg: Add compatible string for i.MX8ULP

Add compatible string for i.MX8ULP platform which support audio
function through rpmsg audio channel on M core.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1630553525-25655-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoALSA: usb-audio: Add registration quirk for JBL Quantum 800
Alexander Tsoy [Tue, 31 Aug 2021 00:25:31 +0000 (03:25 +0300)]
ALSA: usb-audio: Add registration quirk for JBL Quantum 800

Add another device ID for JBL Quantum 800. It requires the same quirk as
other JBL Quantum devices.

Signed-off-by: Alexander Tsoy <alexander@tsoy.me>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210831002531.116957-1-alexander@tsoy.me
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoASoC: rt5682: fix headset background noise when S3 state
Shuming Fan [Wed, 1 Sep 2021 10:07:54 +0000 (18:07 +0800)]
ASoC: rt5682: fix headset background noise when S3 state

Remove CBJ power off setting to avoid floating state.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210901100754.21045-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge tag 'asoc-v5.15' into asoc-5.15
Mark Brown [Wed, 1 Sep 2021 16:30:37 +0000 (17:30 +0100)]
Merge tag 'asoc-v5.15' into asoc-5.15

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.

2 years agoASoC: dt-bindings: mt8195: remove dependent headers in the example
Trevor Wu [Tue, 31 Aug 2021 08:39:56 +0000 (16:39 +0800)]
ASoC: dt-bindings: mt8195: remove dependent headers in the example

Drop the use of the defines including clock and power id, so that
we can remove the headers which are not applied in the example.

Fixes: b5bac34fcfb4 ("dt-bindings: mediatek: mt8195: add audio afe document")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210831083956.9804-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK
Geert Uytterhoeven [Tue, 31 Aug 2021 13:18:54 +0000 (15:18 +0200)]
ASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK

The Mediatek MT8195 sound hardware is only present on Mediatek MT8195
SoCs.  Hence add a dependency on ARCH_MEDIATEK, to prevent asking the
user about this driver when configuring a kernel without Mediatek SoC
support.

Fixes: 6746cc858259985a ("ASoC: mediatek: mt8195: add platform driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/7e628e359bde04ceb9ddd74a45931059b4a4623c.1630415860.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device"
Colin Ian King [Fri, 27 Aug 2021 18:50:03 +0000 (19:50 +0100)]
ASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device"

There is a spelling mistake in a dev_err error message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210827185003.507006-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: audio-graph: respawn Platform Support
Kuninori Morimoto [Mon, 30 Aug 2021 00:44:44 +0000 (09:44 +0900)]
ASoC: audio-graph: respawn Platform Support

commit 63f2f9cceb09f8 ("ASoC: audio-graph: remove Platform support")
removed Platform support from audio-graph, because it doesn't have
"plat" support on DT (simple-card has).
But, Platform support is needed if user is using
snd_dmaengine_pcm_register() which adds generic DMA as Platform.
And this Platform dev is using CPU dev.

Without this patch, at least STM32MP15 audio sound card is no more
functional (v5.13 or later). This patch respawn Platform Support on
audio-graph again.

Reported-by: Olivier MOYSAN <olivier.moysan@foss.st.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Olivier MOYSAN <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/878s0jzrpf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency
Trevor Wu [Tue, 31 Aug 2021 02:13:03 +0000 (10:13 +0800)]
ASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency

randconfig builds show the warning below,

WARNING: unmet direct dependencies detected for SND_SOC_MT6359
   Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && MTK_PMIC_WRAP [=n]
   Selected by [y]:
   - SND_SOC_MT8195_MT6359_RT1019_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8195 [=y]

Add a dependency to avoid it.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Link: https://lore.kernel.org/r/20210831021303.5230-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge tag 'asoc-v5.15' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Mon, 30 Aug 2021 12:57:03 +0000 (14:57 +0200)]
Merge tag 'asoc-v5.15' of https://git./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.

2 years agoMerge remote-tracking branch 'asoc/for-5.15' into asoc-linus
Mark Brown [Mon, 30 Aug 2021 11:30:33 +0000 (12:30 +0100)]
Merge remote-tracking branch 'asoc/for-5.15' into asoc-linus

2 years agoMerge remote-tracking branch 'asoc/for-5.14' into asoc-linus
Mark Brown [Mon, 30 Aug 2021 11:30:31 +0000 (12:30 +0100)]
Merge remote-tracking branch 'asoc/for-5.14' into asoc-linus

2 years agoASoC: Revert PCM trigger changes
Mark Brown [Mon, 30 Aug 2021 11:13:46 +0000 (12:13 +0100)]
ASoC: Revert PCM trigger changes

These have turned up some issues in further testing.

Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Mon, 30 Aug 2021 06:04:04 +0000 (08:04 +0200)]
Merge branch 'for-linus' into for-next

2 years agoALSA: usb-audio: Add lowlatency module option
Takashi Iwai [Sun, 29 Aug 2021 07:38:30 +0000 (09:38 +0200)]
ALSA: usb-audio: Add lowlatency module option

For making user to switch back to the old playback mode, this patch
adds a new module option 'lowlatency' to snd-usb-audio driver.
When user face a regression due to the recent low-latency playback
support, they can test easily by passing lowlatency=0 option without
rebuilding the kernel.

Fixes: 307cc9baac5c ("ALSA: usb-audio: Reduce latency at playback start, take#2")
Link: https://lore.kernel.org/r/20210829073830.22686-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: hda/cs8409: Initialize Codec only in init fixup.
Stefan Binding [Fri, 27 Aug 2021 11:02:52 +0000 (12:02 +0100)]
ALSA: hda/cs8409: Initialize Codec only in init fixup.

It is not necessary to initialize the codec during both probe and inside
the init fixup.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210827110252.5361-2-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: hda/cs8409: Ensure Type Detection is only run on startup when necessary
Stefan Binding [Fri, 27 Aug 2021 11:02:51 +0000 (12:02 +0100)]
ALSA: hda/cs8409: Ensure Type Detection is only run on startup when necessary

Type Detection should only be run after init and when the controls have been
built. There is no need to run it multiple times.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210827110252.5361-1-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: usb-audio: Work around for XRUN with low latency playback
Takashi Iwai [Fri, 27 Aug 2021 20:33:11 +0000 (22:33 +0200)]
ALSA: usb-audio: Work around for XRUN with low latency playback

The recent change for low latency playback works in most of test cases
but it turned out still to hit errors on some use cases, most notably
with JACK with small buffer sizes.  This is because USB-audio driver
fills up and submits full URBs at the beginning, while the URBs would
return immediately and try to fill more -- that can easily trigger
XRUN.  It was more or less expected, but in the small buffer size, the
problem became pretty obvious.

Fixing this behavior properly would require the change of the
fundamental driver design, so it's no trivial task, unfortunately.
Instead, here we work around the problem just by switching back to the
old method when the given configuration is too fragile with the low
latency stream handling.  As a threshold, we calculate the total
buffer bytes in all plus one URBs, and check whether it's beyond the
PCM buffer bytes.  The one extra URB is needed because XRUN happens at
the next submission after the first round.

Fixes: 307cc9baac5c ("ALSA: usb-audio: Reduce latency at playback start, take#2")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210827203311.5987-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: pcm: fix divide error in snd_pcm_lib_ioctl
Zubin Mithra [Fri, 27 Aug 2021 15:37:35 +0000 (08:37 -0700)]
ALSA: pcm: fix divide error in snd_pcm_lib_ioctl

Syzkaller reported a divide error in snd_pcm_lib_ioctl. fifo_size
is of type snd_pcm_uframes_t(unsigned long). If frame_size
is 0x100000000, the error occurs.

Fixes: a9960e6a293e ("ALSA: pcm: fix fifo_size frame calculation")
Signed-off-by: Zubin Mithra <zsm@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210827153735.789452-1-zsm@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoMerge series "ASoC: wcd9335: Firx some resources leak in the probe and remove functio...
Mark Brown [Thu, 26 Aug 2021 18:15:14 +0000 (19:15 +0100)]
Merge series "ASoC: wcd9335: Firx some resources leak in the probe and remove function" from Christophe JAILLET <christophe.jaillet@wanadoo.fr>:

The first 2 patches are sraightforward and look logical to me.

However, the 3rd one in purely speculative. It is based on the fact that a
comment states that we enable some irqs on some slave ports. That said, it writes
0xFF in some registers.

So, I guess that we should disable these irqs when the driver is removed. That
said, writing 0x00 at the same place looks logical to me.

This cis untested and NOT based on any documentation. Just a blind fix.
Review with care.
You'll be warned :)

Christophe JAILLET (3):
  ASoC: wcd9335: Fix a double irq free in the remove function
  ASoC: wcd9335: Fix a memory leak in the error handling path of the
    probe function
  ASoC: wcd9335: Disable irq on slave ports in the remove function

 sound/soc/codecs/wcd9335.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

--
2.30.2

2 years agoASoC: soc-pcm: test refcount before triggering
Pierre-Louis Bossart [Tue, 17 Aug 2021 16:40:54 +0000 (11:40 -0500)]
ASoC: soc-pcm: test refcount before triggering

On start/pause_release/resume, when more than one FE is connected to
the same BE, it's possible that the trigger is sent more than
once. This is not desirable, we only want to trigger a BE once, which
is straightforward to implement with a refcount.

For stop/pause/suspend, the problem is more complicated: the check
implemented in snd_soc_dpcm_can_be_free_stop() may fail due to a
conceptual deadlock when we trigger the BE before the FE. In this
case, the FE states have not yet changed, so there are corner cases
where the TRIGGER_STOP is never sent - the dual case of start where
multiple triggers might be sent.

This patch suggests an unconditional trigger in all cases, without
checking the FE states, using a refcount protected by a spinlock.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210817164054.250028-3-pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: soc-pcm: protect BE dailink state changes in trigger
Pierre-Louis Bossart [Tue, 17 Aug 2021 16:40:53 +0000 (11:40 -0500)]
ASoC: soc-pcm: protect BE dailink state changes in trigger

When more than one FE is connected to a BE, e.g. in a mixing use case,
the BE can be triggered multiple times when the FE are opened/started
concurrently. This race condition is problematic in the case of
SoundWire BE dailinks, and this is not desirable in a general
case. The code carefully checks when the BE can be stopped or
hw_free'ed, but the trigger code does not use any mutual exclusion.

Fix by using the same spinlock already used to check FE states, and
set the state before the trigger. In case of errors,  the initial
state will be restored.

This patch does not change how the triggers are handled, it only makes
sure the states are handled in critical sections.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210817164054.250028-2-pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: wcd9335: Disable irq on slave ports in the remove function
Christophe JAILLET [Mon, 16 Aug 2021 05:25:28 +0000 (07:25 +0200)]
ASoC: wcd9335: Disable irq on slave ports in the remove function

The probe calls 'wcd9335_setup_irqs()' to enable interrupts on all slave
ports.
This must be undone in the remove function.

Add a 'wcd9335_teardown_irqs()' function that undoes 'wcd9335_setup_irqs()'
function, and call it from the remove function.

Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <8f761244d79bd4c098af8a482be9121d3a486d1b.1629091028.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: wcd9335: Fix a memory leak in the error handling path of the probe function
Christophe JAILLET [Mon, 16 Aug 2021 05:25:20 +0000 (07:25 +0200)]
ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function

If 'wcd9335_setup_irqs()' fails, me must release the memory allocated in
'wcd_clsh_ctrl_alloc()', as already done in the remove function.

Add an error handling path and the missing 'wcd_clsh_ctrl_free()' call.

Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <6dc12372f09fabb70bf05941dbe6a1382dc93e43.1629091028.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: wcd9335: Fix a double irq free in the remove function
Christophe JAILLET [Mon, 16 Aug 2021 05:25:10 +0000 (07:25 +0200)]
ASoC: wcd9335: Fix a double irq free in the remove function

There is no point in calling 'free_irq()' explicitly for
'WCD9335_IRQ_SLIMBUS' in the remove function.

The irqs are requested in 'wcd9335_setup_irqs()' using a resource managed
function (i.e. 'devm_request_threaded_irq()').
'wcd9335_setup_irqs()' requests all what is defined in the 'wcd9335_irqs'
structure.
This structure has only one entry for 'WCD9335_IRQ_SLIMBUS'.

So 'devm_request...irq()' + explicit 'free_irq()' would lead to a double
free.

Remove the unneeded 'free_irq()' from the remove function.

Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <0614d63bc00edd7e81dd367504128f3d84f72efa.1629091028.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoALSA: hda: Disable runtime resume at shutdown
Takashi Iwai [Thu, 26 Aug 2021 15:47:52 +0000 (17:47 +0200)]
ALSA: hda: Disable runtime resume at shutdown

Although we modified the codec shutdown callback to perform
runtime-suspend, it's still not fully effective, as this may be
resumed again at any time later.

For fixing such an unwanted resume, this patch replaces
pm_runtime_suspend() with pm_runtime_force_suspend(), and call
pm_runtime_disable() afterward.  It assures to keep the device
suspended.

Also for code simplification, we apply the code unconditionally; when
it's been already suspended, nothing would happen by calls of
snd_pcm_suspend_all() and pm_runtime_force_suspend(), just proceed to
pm_runtime_disable().

Fixes: b98444ed597d ("ALSA: hda: Suspend codec at shutdown")
Reported-and-tested-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210826154752.25674-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoMerge series "Patches to update for rockchip i2s" from Sugar Zhang <sugar.zhang@rock...
Mark Brown [Thu, 26 Aug 2021 14:08:30 +0000 (15:08 +0100)]
Merge series "Patches to update for rockchip i2s" from Sugar Zhang <sugar.zhang@rock-chips.com>:

These patches fixup or update for rockchip i2s.

Changes in v3:
- Drop property 'rockchip,playback-only', 'rockchip,capture-only'.
  Implement it by 'dma-names' of DT instead.

Changes in v2:
- split property trcm into single 'trcm-sync-tx-only' and
  'trcm-sync-rx-only' suggested by Nicolas.
- split property trcm into single 'trcm-sync-tx-only' and
  'trcm-sync-rx-only' suggested by Nicolas.
- drop change-id

Sugar Zhang (12):
  ASoC: rockchip: i2s: Add support for set bclk ratio
  ASoC: rockchip: i2s: Fixup clk div error
  ASoC: rockchip: i2s: Improve dma data transfer efficiency
  ASoC: rockchip: i2s: Fix regmap_ops hang
  ASoC: rockchip: i2s: Fix concurrency between tx/rx
  ASoC: rockchip: i2s: Reset the controller if soft reset failed
  ASoC: dt-bindings: rockchip: Document reset property for i2s
  ASoC: rockchip: i2s: Make playback/capture optional
  ASoC: rockchip: i2s: Add compatible for more SoCs
  ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs
  ASoC: rockchip: i2s: Add support for frame inversion
  ASoC: dt-bindings: rockchip: i2s: Document property TRCM

Xiaotan Luo (1):
  ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B

Xing Zheng (1):
  ASoC: rockchip: i2s: Add support for TRCM property

 .../devicetree/bindings/sound/rockchip-i2s.yaml    |  19 ++
 sound/soc/rockchip/rockchip_i2s.c                  | 278 +++++++++++++++------
 sound/soc/rockchip/rockchip_i2s.h                  |  10 +-
 3 files changed, 224 insertions(+), 83 deletions(-)

--
2.7.4

2 years agoMerge series "Patches to update for rockchip spdif" from Sugar Zhang <sugar.zhang...
Mark Brown [Thu, 26 Aug 2021 14:08:28 +0000 (15:08 +0100)]
Merge series "Patches to update for rockchip spdif" from Sugar Zhang <sugar.zhang@rock-chips.com>:

These patches fixup or update for rockchip spdif.

Sugar Zhang (4):
  ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile
  ASoC: rockchip: spdif: Fix some coding style
  ASoC: rockchip: spdif: Add support for rk3568 spdif
  ASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif

 .../devicetree/bindings/sound/rockchip-spdif.yaml  |  1 +
 sound/soc/rockchip/rockchip_spdif.c                | 38 ++++++++++++----------
 2 files changed, 22 insertions(+), 17 deletions(-)

--
2.7.4

2 years agoASoC: rockchip: i2s: Add support for frame inversion
Sugar Zhang [Thu, 26 Aug 2021 04:03:12 +0000 (12:03 +0800)]
ASoC: rockchip: i2s: Add support for frame inversion

This patch adds support for frame inversion.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950594-14345-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: rockchip: Add compatible strings for more SoCs
Sugar Zhang [Thu, 26 Aug 2021 04:03:11 +0000 (12:03 +0800)]
ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs

This patch adds compatible strings for more SoCs.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629950594-14345-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s: Add compatible for more SoCs
Sugar Zhang [Thu, 26 Aug 2021 04:02:38 +0000 (12:02 +0800)]
ASoC: rockchip: i2s: Add compatible for more SoCs

This patch adds more compatible strings for SoCs.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-5-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s: Make playback/capture optional
Sugar Zhang [Thu, 26 Aug 2021 04:02:37 +0000 (12:02 +0800)]
ASoC: rockchip: i2s: Make playback/capture optional

There are some controllers which support playback only or
capture only. so, make it optional. and initial capability
by 'dma-names' of DT.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B
Xiaotan Luo [Thu, 26 Aug 2021 04:02:36 +0000 (12:02 +0800)]
ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B

- DSP_A: PCM delay 1 bit mode, L data MSB after FRM LRC
- DSP_B: PCM no delay mode, L data MSB during FRM LRC

Signed-off-by: Xiaotan Luo <lxt@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: rockchip: Document reset property for i2s
Sugar Zhang [Thu, 26 Aug 2021 04:02:35 +0000 (12:02 +0800)]
ASoC: dt-bindings: rockchip: Document reset property for i2s

This patch documents reset property for i2s.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629950562-14281-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s: Fix regmap_ops hang
Sugar Zhang [Thu, 26 Aug 2021 04:01:50 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Fix regmap_ops hang

API 'set_fmt' maybe called when PD is off, in the situation,
any register access will hang the system. so, enable PD
before r/w register.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s: Improve dma data transfer efficiency
Sugar Zhang [Thu, 26 Aug 2021 04:01:49 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Improve dma data transfer efficiency

This patch changes dma data burst from 4 to 8 to improve
data transfer efficiency.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s: Fixup clk div error
Sugar Zhang [Thu, 26 Aug 2021 04:01:48 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Fixup clk div error

MCLK maybe not precise as required because of PLL,
but which still can be used and no side effect. so,
using DIV_ROUND_CLOSEST instead div.

e.g.

set mclk to 11289600 Hz, but get 11289598 Hz.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s: Add support for set bclk ratio
Sugar Zhang [Thu, 26 Aug 2021 04:01:47 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Add support for set bclk ratio

This patch adds support for set bclk ratio from machine driver.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif
Sugar Zhang [Tue, 24 Aug 2021 10:16:02 +0000 (18:16 +0800)]
ASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif

This patch adds compatible string for rk3568 spdif.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629800162-12824-5-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: spdif: Add support for rk3568 spdif
Sugar Zhang [Tue, 24 Aug 2021 10:16:01 +0000 (18:16 +0800)]
ASoC: rockchip: spdif: Add support for rk3568 spdif

This patch adds support for rk3568 spdif which is the same
with rk3366.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: spdif: Fix some coding style
Sugar Zhang [Tue, 24 Aug 2021 10:16:00 +0000 (18:16 +0800)]
ASoC: rockchip: spdif: Fix some coding style

This patch fix some coding style.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile
Sugar Zhang [Tue, 24 Aug 2021 10:15:59 +0000 (18:15 +0800)]
ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile

This patch marks SPDIF_SMPDR as volatile to make it resaonable,
which also requires marking it as readable, even though it isn't.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: Fix spelling mistake "bitwiedh" -> "bitwidth"
Colin Ian King [Thu, 26 Aug 2021 11:26:11 +0000 (12:26 +0100)]
ASoC: mediatek: mt8195: Fix spelling mistake "bitwiedh" -> "bitwidth"

There is a spelling mistake in a dev_dbg message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210826112611.10356-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dwc: Get IRQ optionally
Robin Murphy [Wed, 25 Aug 2021 15:42:03 +0000 (16:42 +0100)]
ASoC: dwc: Get IRQ optionally

The IRQ is explicitly optional, so use platform_get_irq_optional() and
avoid platform_get_irq() logging a spurious error when trying to use the
thing in DMA mode.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/c857f334e3c9e651e088b675b3938cb5f798b133.1629906123.git.robin.murphy@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: imx-rpmsg: change dev_err to dev_err_probe for -EPROBE_DEFER
Shengjiu Wang [Wed, 25 Aug 2021 07:14:41 +0000 (15:14 +0800)]
ASoC: imx-rpmsg: change dev_err to dev_err_probe for -EPROBE_DEFER

Change dev_err to dev_err_probe for no need print error message
when defer probe happens.

Fixes: 39f8405c3e50 ("ASoC: imx-rpmsg: Add machine driver for audio base on rpmsg")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1629875681-16373-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rt5682: Fix the vol+ button detection issue
Derek Fang [Wed, 25 Aug 2021 04:03:46 +0000 (12:03 +0800)]
ASoC: rt5682: Fix the vol+ button detection issue

Fix the wrong button vol+ detection issue with some brand headsets
by fine tuning the threshold of button vol+ and SAR ADC button accuracy.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20210825040346.28346-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: bytcr_rt5640: Make rt5640_jack_gpio/rt5640_jack2_gpio static
Peter Ujfalusi [Wed, 25 Aug 2021 12:25:19 +0000 (15:25 +0300)]
ASoC: Intel: bytcr_rt5640: Make rt5640_jack_gpio/rt5640_jack2_gpio static

Marking the two jack gpio as static fixes the following Sparse errors:
sound/soc/intel/boards/bytcr_rt5640.c:468:26: error: symbol 'rt5640_jack_gpio' was not declared. Should it be static?
sound/soc/intel/boards/bytcr_rt5640.c:475:26: error: symbol 'rt5640_jack2_gpio' was not declared. Should it be static?

Fixes: 9ba00856686ad ("ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210825122519.3364-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge branch 'for-5.14' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Wed, 25 Aug 2021 13:14:30 +0000 (14:14 +0100)]
Merge branch 'for-5.14' of https://git./linux/kernel/git/broonie/sound into asoc-5.15

2 years agoMerge series "ASoC: mediatek: Add support for MT8195 SoC" from Trevor Wu <trevor...
Mark Brown [Wed, 25 Aug 2021 09:50:21 +0000 (10:50 +0100)]
Merge series "ASoC: mediatek: Add support for MT8195 SoC" from Trevor Wu <trevor.wu@mediatek.com>:

This series of patches adds support for Mediatek AFE of MT8195 SoC.
Patches are based on broonie tree "for-next" branch.

Changes since v4:
  - removed sof related code

Changes since v3:
  - fixed warnings found by kernel test robot
  - removed unused critical section
  - corrected the lock protected sections on etdm driver
  - added DPTX and HDMITX audio support

Changes since v2:
  - added audio clock gate control
  - added 'mediatek' prefix to private dts properties
  - added consumed clocks to dt-bindins and adopted suggestions from Rob
  - refined clock usage and remove unused clock and control code
  - fixed typos

Changes since v1:
  - fixed some problems related to dt-bindings
  - added some missing properties to dt-bindings
  - added depency declaration on dt-bindings
  - fixed some warnings found by kernel test robot

Trevor Wu (11):
  ASoC: mediatek: mt8195: update mediatek common driver
  ASoC: mediatek: mt8195: support audsys clock control
  ASoC: mediatek: mt8195: support etdm in platform driver
  ASoC: mediatek: mt8195: support adda in platform driver
  ASoC: mediatek: mt8195: support pcm in platform driver
  ASoC: mediatek: mt8195: add platform driver
  dt-bindings: mediatek: mt8195: add audio afe document
  ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and
    rt5682
  ASoC: mediatek: mt8195: add DPTX audio support
  ASoC: mediatek: mt8195: add HDMITX audio support
  dt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682
    document

 .../bindings/sound/mt8195-afe-pcm.yaml        |  184 +
 .../sound/mt8195-mt6359-rt1019-rt5682.yaml    |   47 +
 sound/soc/mediatek/Kconfig                    |   24 +
 sound/soc/mediatek/Makefile                   |    1 +
 sound/soc/mediatek/common/mtk-afe-fe-dai.c    |   22 +-
 sound/soc/mediatek/common/mtk-base-afe.h      |   10 +-
 sound/soc/mediatek/mt8195/Makefile            |   15 +
 sound/soc/mediatek/mt8195/mt8195-afe-clk.c    |  441 +++
 sound/soc/mediatek/mt8195/mt8195-afe-clk.h    |  109 +
 sound/soc/mediatek/mt8195/mt8195-afe-common.h |  158 +
 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c    | 3281 +++++++++++++++++
 sound/soc/mediatek/mt8195/mt8195-audsys-clk.c |  214 ++
 sound/soc/mediatek/mt8195/mt8195-audsys-clk.h |   15 +
 .../soc/mediatek/mt8195/mt8195-audsys-clkid.h |   93 +
 sound/soc/mediatek/mt8195/mt8195-dai-adda.c   |  830 +++++
 sound/soc/mediatek/mt8195/mt8195-dai-etdm.c   | 2639 +++++++++++++
 sound/soc/mediatek/mt8195/mt8195-dai-pcm.c    |  389 ++
 .../mt8195/mt8195-mt6359-rt1019-rt5682.c      | 1087 ++++++
 sound/soc/mediatek/mt8195/mt8195-reg.h        | 2796 ++++++++++++++
 19 files changed, 12350 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/mt8195-afe-pcm.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/mt8195-mt6359-rt1019-rt5682.yaml
 create mode 100644 sound/soc/mediatek/mt8195/Makefile
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-clk.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-clk.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-common.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clk.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clk.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clkid.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-adda.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-pcm.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-reg.h

--
2.18.0

2 years agoASoC: SOF: intel: remove duplicate include
Changcheng Deng [Tue, 24 Aug 2021 03:00:15 +0000 (20:00 -0700)]
ASoC: SOF: intel: remove duplicate include

Clean up the following includecheck warning:

./sound/soc/sof/intel/pci-tng.c: shim.h is included more than once.

No functional change.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210824030015.57267-1-deng.changcheng@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agodt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682 document
Trevor Wu [Thu, 19 Aug 2021 08:41:44 +0000 (16:41 +0800)]
dt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682 document

This patch adds document for mt8195 board with mt6359, rt1019 and rt5682

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-12-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: add HDMITX audio support
Trevor Wu [Thu, 19 Aug 2021 08:41:43 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add HDMITX audio support

This patch adds HDMITX audio support on mt8195-mt6359-rt1019-rt5682 board.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-11-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: add DPTX audio support
Trevor Wu [Thu, 19 Aug 2021 08:41:42 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add DPTX audio support

This patch adds DPTX audio support on mt8195-mt6359-rt1019-rt5682 board.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-10-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682
Trevor Wu [Thu, 19 Aug 2021 08:41:41 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682

This patch adds support for mt8195 board with mt6359, rt1019 and rt5682.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210819084144.18483-9-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agodt-bindings: mediatek: mt8195: add audio afe document
Trevor Wu [Thu, 19 Aug 2021 08:41:40 +0000 (16:41 +0800)]
dt-bindings: mediatek: mt8195: add audio afe document

This patch adds mt8195 audio afe document.

In order to support dynamic clock reparenting for ADDA and ETDM, PLL
and MUX clocks are requested even though they are not consumed by afe
directly.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-8-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: add platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:39 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add platform driver

This patch adds mt8195 platform and affiliated driver.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210819084144.18483-7-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: support pcm in platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:38 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support pcm in platform driver

This patch adds mt8195 pcm dai driver.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-6-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: support adda in platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:37 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support adda in platform driver

This patch adds mt8195 adda dai driver.

audio_h clock is used by ADSP bus and ADDA module.
When ADDA requires audio_h clock, it is switched to APLL1, otherwise
it is switched to Xtal_26m so that APLL1 can be turned off when audio
feature is not used.
ADSP bus only requires that the clock is on, so dynamic reparenting
is used for the purpose of lowering power consumption.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: support etdm in platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:36 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support etdm in platform driver

This patch adds mt8195 tdm/i2s dai driver.

MCLK clock tree is as follows.
PLL -> MUX -> DIVIDER -> MCLK

For PLL source of MCLK, driver only supports APLL1 and APLL2 now.
APLL3 and APLL4 are used to track external clock source, so they are
only used when slave input is connected.

For example,
case 1: (HDMI RX connected)
DL memif (a1sys) -> etdm out2 (clk from apll1/apll2) -> codec
case 2: (HDMI RX disconnected)
HDMI RX -> a3sys -> UL memif (a3sys) -> DL memif (a3sys) -> .... ->
etdm out2 (clk from apll3) -> codec

We keep all modules in the pipeline working on the same clock domain.
MCLK is expected to output the clock generated from the same clock
source as the pipeline, so dynamic reparenting is required for MCLK
configuration.

As a result, clk_set_parent() is used to select PLL source,
and clk_set_rate() is used to configure divider to get MCLK output rate.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: support audsys clock control
Trevor Wu [Thu, 19 Aug 2021 08:41:35 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support audsys clock control

This patch adds mt8195 audio cg control.
Audio clock gates are registered to CCF for reference count and
clock parent management.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: update mediatek common driver
Trevor Wu [Thu, 19 Aug 2021 08:41:34 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: update mediatek common driver

Update mediatek common driver to support MT8195

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210819084144.18483-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: wm_adsp: Put debugfs_remove_recursive back in
Charles Keepax [Tue, 24 Aug 2021 10:15:52 +0000 (11:15 +0100)]
ASoC: wm_adsp: Put debugfs_remove_recursive back in

This patch reverts commit acbf58e53041 ("ASoC: wm_adsp: Let
soc_cleanup_component_debugfs remove debugfs"), and adds an
alternate solution to the issue. That patch removes the call to
debugfs_remove_recursive, which cleans up the DSPs debugfs. The
intention was to avoid an unbinding issue on an out of tree
driver/platform.

The issue with the patch is it means the driver no longer cleans up
its own debugfs, instead relying on ASoC to remove recurive on the
parent debugfs node. This is conceptually rather unclean, but also it
would prevent DSPs being added/removed independently of ASoC and soon
we are going to be upstreaming some non-audio parts with these DSPs,
which will require this.

Finally, it seems the issue on the platform is a result of the
wm_adsp2_cleanup_debugfs getting called twice. This is very likely a
problem on the platform side and will be resolved there. But in the mean
time make the code a little more robust to such issues, and again
conceptually a bit nicer, but clearing the debugfs_root variable in the
DSP structure when the debugfs is removed.

Fixes: acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs"
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210824101552.1119-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoALSA: usb-audio: Move set-interface-first workaround into common quirk
Takashi Iwai [Tue, 24 Aug 2021 05:57:20 +0000 (07:57 +0200)]
ALSA: usb-audio: Move set-interface-first workaround into common quirk

The recent quirk for WALKMAN (commit 7af5a14371c1: "ALSA: usb-audio:
Fix regression on Sony WALKMAN NW-A45 DAC") may be required for other
devices and is worth to be put into the common quirk flags.
This patch adds a new quirk flag bit QUIRK_FLAG_SET_IFACE_FIRST and a
quirk table entry for the device.

Link: https://lore.kernel.org/r/20210824055720.9240-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Tue, 24 Aug 2021 05:52:41 +0000 (07:52 +0200)]
Merge branch 'for-linus' into for-next

2 years agoALSA: hda/realtek: Quirk for HP Spectre x360 14 amp setup
Johnathon Clark [Mon, 23 Aug 2021 16:21:10 +0000 (17:21 +0100)]
ALSA: hda/realtek: Quirk for HP Spectre x360 14 amp setup

This patch extends support for the HP Spectre x360 14
amp enable quirk to support a model of the device with
an additional subdevice ID.

Signed-off-by: Johnathon Clark <john.clark@cantab.net>
Link: https://lore.kernel.org/r/20210823162110.8870-1-john.clark@cantab.net
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: usb-audio: Fix regression on Sony WALKMAN NW-A45 DAC
Takashi Iwai [Tue, 24 Aug 2021 05:47:00 +0000 (07:47 +0200)]
ALSA: usb-audio: Fix regression on Sony WALKMAN NW-A45 DAC

We've got a regression report for USB-audio with Sony WALKMAN NW-A45
DAC device where no sound is audible on recent kernel.  The bisection
resulted in the code change wrt endpoint management, and the further
debug session revealed that it was caused by the order of the USB
audio interface.  In the earlier code, we always set up the USB
interface at first before other setups, but it was changed to be done
at the last for UAC2/3, which is more standard way, while keeping the
old way for UAC1.  OTOH, this device seems requiring the setup of the
interface at first just like UAC1.

This patch works around the regression by applying the interface setup
specifically for the WALKMAN at the beginning of the endpoint setup
procedure.  This change is written straightforwardly to be easily
backported in old kernels.  A further cleanup to move the workaround
into a generic quirk section will follow in a later patch.

Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management")
Cc: <stable@vger.kernel.org>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214105
Link: https://lore.kernel.org/r/20210824054700.8236-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoMerge series "ASoC: Intel: Skylake: Fix and support complex" from Cezary Rojewski...
Mark Brown [Mon, 23 Aug 2021 17:26:22 +0000 (18:26 +0100)]
Merge series "ASoC: Intel: Skylake: Fix and support complex" from Cezary Rojewski <cezary.rojewski@intel.com>:

Existing skylake-driver supports very basic scenarios with limited range
of modules and their control. Attached changes first fix code as several
advanced configurations are 'mentioned' throughout the files but are not
actually functional. Follow up are changes adding missing support for
said configurations.

Cezary Rojewski (5):
  ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373
  ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs
  ASoC: Intel: Skylake: Fix module resource and format selection
  ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER
  ASoC: Intel: Skylake: Select first entry for singular pipe config
    arrays

Gustaw Lewandowski (2):
  ASoC: Intel: Skylake: Fix passing loadable flag for module
  ASoC: Intel: Skylake: Simplify m_state for loadable modules

Kareem Shaik (1):
  ASoC: Intel: Skylake: Support multiple format configs

Pawel Harlozinski (1):
  ASoC: Intel: Skylake: Properly configure modules with generic
    extension

Piotr Maziarz (1):
  ASoC: Intel: Skylake: Select proper format for NHLT blob

Szymon Mielczarek (1):
  ASoC: Intel: Skylake: Support modules with generic extension

 include/uapi/sound/snd_sst_tokens.h          |   6 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c |  55 +------
 sound/soc/intel/skylake/skl-messages.c       | 155 ++++++++++++-------
 sound/soc/intel/skylake/skl-pcm.c            |  25 ++-
 sound/soc/intel/skylake/skl-topology.c       | 155 +++++++++++--------
 sound/soc/intel/skylake/skl-topology.h       |  26 +++-
 6 files changed, 231 insertions(+), 191 deletions(-)

--
2.25.1

2 years agoASoC: rt1015: remove possible unused variable `bclk_ms'
Tzung-Bi Shih [Mon, 23 Aug 2021 15:33:23 +0000 (23:33 +0800)]
ASoC: rt1015: remove possible unused variable `bclk_ms'

bclk_ms is possible unused by using the given config (see [1]).

sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is
never read [clang-analyzer-deadcode.DeadStores]
           bclk_ms = frame_size > 32;
           ^         ~~~~~~~~~~~~~~~

In addition, bclk_ms is meaningless and confusing after applying commit
a5db2ca51367 ("ASoC: rt1015: remove unneeded variables in rt1015_priv").
The "> 32" in the expression looks like a typo but it was not.

Let's remove the confusing variable bclk_ms.

[1]: https://lkml.org/lkml/2021/8/23/305

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210823153323.1297723-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: bytcr_rt5640: Mark hp_elitepad_1000g2_jack?_check functions static
Hans de Goede [Mon, 23 Aug 2021 11:04:32 +0000 (13:04 +0200)]
ASoC: Intel: bytcr_rt5640: Mark hp_elitepad_1000g2_jack?_check functions static

The byt_rt5640_hp_elitepad_1000g2_jack?_check functions are only
used inside bytcr_rt5640.c, mark them as static.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210823110432.64860-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rt1015p: correct indentation
Krzysztof Kozlowski [Thu, 19 Aug 2021 10:10:20 +0000 (12:10 +0200)]
ASoC: rt1015p: correct indentation

Use common enum instead of oneOf and correct indentation warning:
  realtek,rt1015p.yaml:18:7: [warning] wrong indentation: expected 4 but found 6 (indentation)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210819101020.26368-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: ics43432: add compatible for CUI Devices
Angelo Dureghello [Sat, 21 Aug 2021 08:26:58 +0000 (10:26 +0200)]
ASoC: ics43432: add compatible for CUI Devices

Add compatible for CUI Devices CMM-4030D-261-I2S-TR.

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Link: https://lore.kernel.org/r/20210821082658.4147595-3-angelo.dureghello@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agodt-bindings: add compatible vendor prefix for CUI Devices
Angelo Dureghello [Sat, 21 Aug 2021 08:26:57 +0000 (10:26 +0200)]
dt-bindings: add compatible vendor prefix for CUI Devices

Add vendor prefix for CUI Devices.

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Link: https://lore.kernel.org/r/20210821082658.4147595-2-angelo.dureghello@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: ics43432: add CMM-4030D-261 support
Angelo Dureghello [Sat, 21 Aug 2021 08:26:56 +0000 (10:26 +0200)]
ASoC: ics43432: add CMM-4030D-261 support

Despite minimal datasheet differences, the driver seems
perfectly compatible with CMM-4030D-261.

Tested CMM-4030D-261 to work with this changes:

/ {
        cmm4030d: cmm4030d {
                #sound-dai-cells = <0>;
                compatible = "cui,cmm-4030d-261";
        };

        sound_mic {
                compatible = "simple-audio-card";
                simple-audio-card,name = "i2s mem mic";
                simple-audio-card,format = "i2s";
                simple-audio-card,bitclock-master = <&sound_master>;
                simple-audio-card,frame-master = <&sound_master>;
                sound_master: simple-audio-card,cpu {
                        sound-dai = <&ssi2>;
                        system-clock-frequency = <2822400>;
                };
                simple-audio-card,codec {
                        sound-dai = <&cmm4030d>;
                };
        };
};

Audio has been captured and tested successfully by:

arecord -D "hw:1,0" -f S24_LE > test.wav
aplay test.wav

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Link: https://lore.kernel.org/r/20210821082658.4147595-1-angelo.dureghello@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Select first entry for singular pipe config arrays
Cezary Rojewski [Wed, 18 Aug 2021 07:57:42 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Select first entry for singular pipe config arrays

When pipe does not expose multiple configuration options, always select
the first entry without searching for matching one.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Properly configure modules with generic extension
Pawel Harlozinski [Wed, 18 Aug 2021 07:57:41 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Properly configure modules with generic extension

Make use of struct skl_base_cfg_ext and its format setter to configure
modules which are described with said structure.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Pawel Harlozinski <pawel.harlozinski@linux.intel.com>
Signed-off-by: Szymon Mielczarek <szymonx.mielczarek@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Support modules with generic extension
Szymon Mielczarek [Wed, 18 Aug 2021 07:57:40 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Support modules with generic extension

Some DSP modules require, besides the module base configuration, a
generic extension containing audio format for all module's pins that are
in use.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Szymon Mielczarek <szymonx.mielczarek@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Support multiple format configs
Kareem Shaik [Wed, 18 Aug 2021 07:57:39 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Support multiple format configs

A module can have two kinds of set params, as per topology requirements.
For example, one pre-init and one post-init. But currently, there is
support for just one type, as the format_config.

This patch extends the format_configs to 4, so as to be able to support
pre-init, post-init and post-bind type of set params, for the same
module, simultaneously.

Signed-off-by: Kareem Shaik <kareem.m.shaik@intel.com>
Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Simplify m_state for loadable modules
Gustaw Lewandowski [Wed, 18 Aug 2021 07:57:38 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Simplify m_state for loadable modules

States SKL_MODULE_LOADED and SKL_MODULE_UNLOADED are redundant with
'loadable' flag in struct skl_module. Additionally
skl_tplg_mixer_dapm_post_pmd_event() sets m_state always to
SKL_MODULE_UNINIT so next unload function isn't called for such modules.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Fix passing loadable flag for module
Gustaw Lewandowski [Wed, 18 Aug 2021 07:57:37 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Fix passing loadable flag for module

skl_get_module_info() tries to set mconfig->module->loadable before
mconfig->module has been assigned thus flag was always set to false
and driver did not try to load module binaries.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Fix module configuration for KPB and MIXER
Cezary Rojewski [Wed, 18 Aug 2021 07:57:36 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER

KeyPhrasebuffer, Mixin and Mixout modules configuration is described by
firmware's basic module configuration structure. There are no extended
parameters required. Update functions taking part in building
INIT_INSTANCE IPC payload to reflect that.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Fix module resource and format selection
Cezary Rojewski [Wed, 18 Aug 2021 07:57:35 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Fix module resource and format selection

Module configuration may differ between its instances depending on
resources required and input and output audio format. Available
parameters to select from are stored in module resource and interface
(format) lists. These come from topology, together with description of
each of pipe's modules.

Ignoring index value provided by topology and relying always on 0th
entry leads to unexpected module behavior due to under/overbudged
resources assigned or impropper format selection. Fix by taking entry at
index specified by topology.

Fixes: f6fa56e22559 ("ASoC: Intel: Skylake: Parse and update module config structure")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Select proper format for NHLT blob
Piotr Maziarz [Wed, 18 Aug 2021 07:57:34 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Select proper format for NHLT blob

Use actual pipeline format, not PCM format for blob selection. Otherwise
selected blobs are not correct in pipelines with format conversion
e.g.: SRC module.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Signed-off-by: Lewandowski, Gustaw <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs
Cezary Rojewski [Wed, 18 Aug 2021 07:57:33 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs

Advancing pointer initially fixed issue for some users but caused
regression for others. Leave data as it to make it easier for end users
to adjust their topology files if needed.

Fixes: a8cd7066f042 ("ASoC: Intel: Skylake: Strip T and L from TLV IPCs")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373
Cezary Rojewski [Wed, 18 Aug 2021 07:57:32 +0000 (09:57 +0200)]
ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373

Contrary to what is said in board's file, topology targeting
kbl_da7219_max98373 expects format 16b, not 24/32b. Partially revert
changes added in 'ASoC: Intel: Boards: Add Maxim98373 support' to bring
old behavior back, aligning with topology expectations.

Fixes: 716d53cc7837 ("ASoC: Intel: Boards: Add Maxim98373 support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: intel: atom: Revert PCM buffer address setup workaround again
Takashi Iwai [Sun, 22 Aug 2021 07:21:27 +0000 (09:21 +0200)]
ASoC: intel: atom: Revert PCM buffer address setup workaround again

We worked around the breakage of PCM buffer setup by the commit
65ca89c2b12c ("ASoC: intel: atom: Fix breakage for PCM buffer address
setup"), but this isn't necessary since the CONTINUOUS buffer type
also sets runtime->dma_addr since commit f84ba106a018 ("ALSA:
memalloc: Store snd_dma_buffer.addr for continuous pages, too").
Let's revert the change again.

Link: https://lore.kernel.org/r/20210822072127.9786-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Mon, 23 Aug 2021 11:36:20 +0000 (13:36 +0200)]
Merge branch 'for-linus' into for-next

2 years agoALSA: doc: Fix indentation warning
Takashi Iwai [Mon, 23 Aug 2021 11:35:18 +0000 (13:35 +0200)]
ALSA: doc: Fix indentation warning

Fix a trivial warning for the indentation by putting an empty line:
  Documentation/sound/alsa-configuration.rst:2258: WARNING: Unexpected indentation.

Fixes: a39978ed6df1 ("ALSA: doc: Add the description of quirk_flags option for snd-usb-audio")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20210823113518.30134-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: hda: Update documentation for aliasing via the model option
Takashi Iwai [Mon, 23 Aug 2021 07:37:22 +0000 (09:37 +0200)]
ALSA: hda: Update documentation for aliasing via the model option

The previous patch allowed user to specify the aliasing of SSID via
model option for applying a quirk.  Update the documentation
accordingly.

Link: https://lore.kernel.org/r/20210823073722.14873-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: hda: Allow model option to specify PCI SSID alias
Takashi Iwai [Mon, 23 Aug 2021 07:37:21 +0000 (09:37 +0200)]
ALSA: hda: Allow model option to specify PCI SSID alias

There are tons of quirks for HD-audio and many of them are without
model string, hence it's not trivial to apply the same quirk for a new
device.  This patch makes it easier: namely, the model string accepts
a form as "XXXX:YYYY" (a pair of hex numbers of the subsystem-vendor
and subsystem-device IDs), to specify the alias of PCI (or codec)
SSID.  e.g. passing model=1234:abcd would apply the quirk that matches
with the given SSID 1234:abcd instead of the actual SSID.

Link: https://lore.kernel.org/r/20210823073722.14873-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: hda: Code refactoring snd_hda_pick_fixup()
Takashi Iwai [Mon, 23 Aug 2021 07:37:20 +0000 (09:37 +0200)]
ALSA: hda: Code refactoring snd_hda_pick_fixup()

This contains a slight code refactoring of snd_hda_pick_fixup():
- Unify the ID setup
- Unify the debug print message
- Use snd_pci_quirk_lookup_id() for the codec SSID matching

Mostly for simplifying the code flow but also it makes easier to add
the codec alias handling in the upcoming patch.

Link: https://lore.kernel.org/r/20210823073722.14873-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: firewire-motu: add support for MOTU 896HD
Takashi Sakamoto [Mon, 23 Aug 2021 08:57:41 +0000 (17:57 +0900)]
ALSA: firewire-motu: add support for MOTU 896HD

Mark of the Unicorn (MOTU) shipped 896HD 2003 as one of models in second
generation of its FireWire series, and already discontinued it. The model
consists of below ICs:

 * Texas Instruments TSB41AB2
 * Phillips Semiconductors PDI1394L40
 * Altera cyclone EP1C3
 * Texas Instruments TMS320VC5402

It supports sampling transmission frequency up to 192.0 kHz. The packet
format differs depending on both of sampling transfer frequency and enabling
ADAT channels. The model doesn't support MIDI message transmission.

This commit adds support for it.

$ python3 crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  04101b66  bus_info_length 4, crc_length 16, crc 7014
404  31333934  bus_name "1394"
408  20001000  irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4)
40c  0001f200  company_id 0001f2     |
410  0001dbce  device_id 000001dbce  | EUI-64 0001f2000001dbce

               root directory
               -----------------------------------------------------------------
414  0004c65c  directory_length 4, crc 50780
418  030001f2  vendor
41c  0c0083c0  node capabilities per IEEE 1394
420  8d000006  --> eui-64 leaf at 438
424  d1000001  --> unit directory at 428

               unit directory at 428
               -----------------------------------------------------------------
428  0003dcc1  directory_length 3, crc 56513
42c  120001f2  specifier id
430  13000005  version
434  17102800  model

               eui-64 leaf at 438
               -----------------------------------------------------------------
438  000264f2  leaf_length 2, crc 25842
43c  0001f200  company_id 0001f2     |
440  0001dbce  device_id 000001dbce  | EUI-64 0001f2000001dbce

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210823085741.33864-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoALSA: hda/realtek: Workaround for conflicting SSID on ASUS ROG Strix G17
Takashi Iwai [Fri, 20 Aug 2021 14:32:14 +0000 (16:32 +0200)]
ALSA: hda/realtek: Workaround for conflicting SSID on ASUS ROG Strix G17

ASUS ROG Strix G17 has the very same PCI and codec SSID (1043:103f) as
ASUS TX300, and unfortunately, the existing quirk for TX300 is broken
on ASUS ROG.  Actually the device works without the quirk, so we'll
need to clear the quirk before applying for this device.
Since ASUS ROG has a different codec (ALC294 - while TX300 has
ALC282), this patch adds a workaround for the device, just clearing
the codec->fixup_id by checking the codec vendor_id.

It's a bit ugly to add such a workaround there, but it seems to be the
simplest way.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214101
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210820143214.3654-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoLinux 5.14-rc7
Linus Torvalds [Sun, 22 Aug 2021 21:24:56 +0000 (14:24 -0700)]
Linux 5.14-rc7