OSDN Git Service

tomoyo/tomoyo-test1.git
22 months agoASoC: dt-bindings: max98396: Document data monitor properties
Daniel Mack [Fri, 26 Aug 2022 08:59:26 +0000 (10:59 +0200)]
ASoC: dt-bindings: max98396: Document data monitor properties

This device features a data monitor that puts the device in software reset
upon a configurable set of events.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220826085927.2336224-1-daniel@zonque.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: fix spelling mistake: "i.e" -> "i.e."
Syed Saba kareem [Tue, 30 Aug 2022 13:22:55 +0000 (18:52 +0530)]
ASoC: amd: fix spelling mistake: "i.e" -> "i.e."

trivial fix to spelling mistake in Kconfig File.

Reported by : Randy Dunlap <rdunlap@infradead.org>

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20220830132259.7759-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoAdd Pink Sardine platform ASoC driver
Mark Brown [Tue, 30 Aug 2022 10:08:12 +0000 (11:08 +0100)]
Add Pink Sardine platform ASoC driver

Merge series from Syed Saba Kareem <Syed.SabaKareem@amd.com>:

Pink Sardine platform is new APU series based on acp6.2 design.
This patch set adds an ASoC driver for the ACP (Audio CoProcessor) block
on AMD Pink Sardine APU with DMIC endpoint support.

22 months agoASoC: codecs: rk817: fix missing I2C dependency in compile test
Krzysztof Kozlowski [Tue, 30 Aug 2022 07:58:55 +0000 (10:58 +0300)]
ASoC: codecs: rk817: fix missing I2C dependency in compile test

SND_SOC_RK817 uses I2C regmap so compile testing without parent MFD_RK808, requires I2C:

  WARNING: unmet direct dependencies detected for REGMAP_I2C
    Depends on [n]: I2C [=n]
    Selected by [y]:
    - SND_SOC_RK817 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (MFD_RK808 [=n] || COMPILE_TEST [=y])

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 5b7f4e5de61b ("ASoC: codecs: allow compile testing without MFD drivers")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220830075855.278046-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: enable Pink sardine platform machine driver build.
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:57 +0000 (22:26 +0530)]
ASoC: amd: enable Pink sardine platform machine driver build.

This patch enables Pink Sardine platform machine driver build.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-14-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add Pink Sardine machine driver using dmic
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:56 +0000 (22:26 +0530)]
ASoC: amd: add Pink Sardine machine driver using dmic

Add Pink Sardine platform machine driver using dmic.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-13-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: create platform device for acp6.2 machine driver
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:55 +0000 (22:26 +0530)]
ASoC: amd: create platform device for acp6.2 machine driver

Create platform device for acp6.2 machine driver.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-12-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: enable Pink Sardine acp6.2 drivers build
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:54 +0000 (22:26 +0530)]
ASoC: amd: enable Pink Sardine acp6.2 drivers build

Pink Sardine ACP6.2 drivers can be built by selecting necessary
kernel config option.
The patch enables build support of the same.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-11-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add acp6.2 pdm driver pm ops
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:53 +0000 (22:26 +0530)]
ASoC: amd: add acp6.2 pdm driver pm ops

Add acp6.2 pdm driver pm ops.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-10-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add acp6.2 pci driver pm ops
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:52 +0000 (22:26 +0530)]
ASoC: amd: add acp6.2 pci driver pm ops

Add acp6.2 pci driver pm ops.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-9-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add acp6.2 pdm driver dma ops
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:51 +0000 (22:26 +0530)]
ASoC: amd: add acp6.2 pdm driver dma ops

This patch adds PDM driver DMA operations for Pink Sardine Platform.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-8-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add acp6.2 irq handler
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:50 +0000 (22:26 +0530)]
ASoC: amd: add acp6.2 irq handler

Add ACP6.2 irq handler for handling irq events for ACP IP.
Add pdm irq events handling.
Whenever audio data equal to the PDM watermark level are consumed,
interrupt is generated. Acknowledge the interrupt.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-7-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add acp6.2 pdm platform driver
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:49 +0000 (22:26 +0530)]
ASoC: amd: add acp6.2 pdm platform driver

PDM platform driver binds to the platform device created by
ACP6.2 PCI device. PDM driver registers ALSA DMA and CPU DAI
components with ASoC framework.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-6-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add platform devices for acp6.2 pdm driver and dmic driver
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:48 +0000 (22:26 +0530)]
ASoC: amd: add platform devices for acp6.2 pdm driver and dmic driver

ACP6.2 IP has PDM decoder block.
Create a platform device for it, so that the PDM platform driver
can be bound to this device.
Pass PCI resources like MMIO to this platform device.

Create a platform device for generic dmic codec driver.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-5-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add acp6.2 init/de-init functions
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:47 +0000 (22:26 +0530)]
ASoC: amd: add acp6.2 init/de-init functions

Add Pink Sardine platform ACP6.2 PCI driver init/deinit functions.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-4-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add Pink Sardine ACP PCI driver
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:46 +0000 (22:26 +0530)]
ASoC: amd: add Pink Sardine ACP PCI driver

ACP is a PCI audio device.
This patch adds PCI driver to bind to this device and get
PCI resources for Pink Sardine Platform.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-3-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: add Pink Sardine platform ACP IP register header
Syed Saba Kareem [Sat, 27 Aug 2022 16:56:45 +0000 (22:26 +0530)]
ASoC: amd: add Pink Sardine platform ACP IP register header

Add ACP IP Register header for Pink Sardine platform.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-2-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoTAS2764 fixes/extensions
Mark Brown [Mon, 29 Aug 2022 15:56:25 +0000 (16:56 +0100)]
TAS2764 fixes/extensions

Merge series from Martin Povišer <povik+lin@cutebit.org>:

First three patches are fixes analogical to those recently done to
the TAS2770 driver.
Link: https://lore.kernel.org/asahi/20220808141246.5749-1-povik+lin@cutebit.org/T/#t
The latter two add IRQ handler to log faults and expose a new control.

22 months agoASoC: codecs: max98088: remove redundant ret variable
Jinpeng Cui [Mon, 29 Aug 2022 09:13:19 +0000 (09:13 +0000)]
ASoC: codecs: max98088: remove redundant ret variable

Return value from devm_snd_soc_register_component() directly
instead of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
Link: https://lore.kernel.org/r/20220829091319.266068-1-cui.jinpeng2@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: codecs: allow compile testing without MFD drivers
Krzysztof Kozlowski [Fri, 26 Aug 2022 09:36:59 +0000 (12:36 +0300)]
ASoC: codecs: allow compile testing without MFD drivers

Motorola CPCAP, Lochnagar Sound, Rockchip RK817 and Qualcomm
WCD9340/WCD9341 do not depend on parent MFD driver in build time and can
be compile tested without respective MFD part for increased build
coverage.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220826093659.1059276-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agodt-bindings: mediatek: Add axi clock in mt8173 dts example
Xiangsheng Hou [Mon, 25 Jul 2022 12:02:05 +0000 (20:02 +0800)]
dt-bindings: mediatek: Add axi clock in mt8173 dts example

For mt8173, it is needed to add the axi clock for dma mode.

Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220725120204.10834-1-xiangsheng.hou@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: acp: Modify dai_id macros to be more generic
Venkata Prasad Potturu [Fri, 26 Aug 2022 06:42:45 +0000 (12:12 +0530)]
ASoC: amd: acp: Modify dai_id macros to be more generic

Change dai_id macros to make I2S instances in order.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20220826064250.3302260-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: Cleanup deprecated regmap-irq functionality
Mark Brown [Sun, 28 Aug 2022 20:58:57 +0000 (21:58 +0100)]
ASoC: Cleanup deprecated regmap-irq functionality

Merge series from Aidan MacDonald <aidanmacdonald.0x0@gmail.com>:

Update two ASoC codec drivers to remove uses of regmap-irq type
registers, which have recently been deprecated by the "regmap-irq
cleanups and refactoring" series in linux-next.

Link: https://lore.kernel.org/lkml/20220623211420.918875-1-aidanmacdonald.0x0@gmail.com/
22 months agoASoC: wcd938x: Remove spurious type_base from irq chip
Aidan MacDonald [Thu, 21 Jul 2022 10:25:58 +0000 (11:25 +0100)]
ASoC: wcd938x: Remove spurious type_base from irq chip

There is no reason to set type_base here: the chip doesn't set
num_type_regs and none of the IRQs have type information so it's
not possible for regmap-irq to configure IRQ types.

Type registers are also deprecated in regmap-irq, so any IRQ type
support in the future should be implemented using config registers
instead.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20220721102558.25457-3-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: wcd9335: Convert irq chip to config regs
Aidan MacDonald [Thu, 21 Jul 2022 10:25:57 +0000 (11:25 +0100)]
ASoC: wcd9335: Convert irq chip to config regs

Type registers in regmap-irq have been deprecated in favor of config
registers, which are more general. Chips using type_base can switch
over to a single config base register and a standard ->set_irq_type()
callback provided by regmap-irq, which uses the type info associated
with each 'struct regmap_irq' to update type registers in the same
way as the old code did.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20220721102558.25457-2-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tas2764: Export highpass filter setting
Martin Povišer [Thu, 25 Aug 2022 14:02:41 +0000 (16:02 +0200)]
ASoC: tas2764: Export highpass filter setting

Expose a control for the setting of 'DC blocker' highpass filter in the
playback path of TAS2764.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220825140241.53963-6-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tas2764: Add IRQ handling
Martin Povišer [Thu, 25 Aug 2022 14:02:40 +0000 (16:02 +0200)]
ASoC: tas2764: Add IRQ handling

Add an IRQ handler which logs detected faults (but doesn't do anything
else).

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220825140241.53963-5-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tas2764: Fix mute/unmute
Martin Povišer [Thu, 25 Aug 2022 14:02:39 +0000 (16:02 +0200)]
ASoC: tas2764: Fix mute/unmute

Because the PWR_CTRL field is modeled as the power state of the DAC
widget, and at the same time it is used to implement mute/unmute, we
need some additional book-keeping to have the right end result no matter
the sequence of calls. Without this fix, one permanently mutes an
ongoing stream by toggling the associated speaker pin control.

(This mirrors commit 1e5907bcb3a3 ("ASoC: tas2770: Fix handling of
mute/unmute") which was a fix to the tas2770 driver.)

Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220825140241.53963-4-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tas2764: Drop conflicting set_bias_level power setting
Martin Povišer [Thu, 25 Aug 2022 14:02:38 +0000 (16:02 +0200)]
ASoC: tas2764: Drop conflicting set_bias_level power setting

The driver is setting the PWR_CTRL field in both the set_bias_level
callback and on DAPM events of the DAC widget (and also in the
mute_stream method). Drop the set_bias_level callback altogether as the
power setting it does is in conflict with the other code paths.

(This mirrors commit c8a6ae3fe1c8 ("ASoC: tas2770: Drop conflicting
set_bias_level power setting") which was a fix to the tas2770 driver.)

Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220825140241.53963-3-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tas2764: Allow mono streams
Martin Povišer [Thu, 25 Aug 2022 14:02:37 +0000 (16:02 +0200)]
ASoC: tas2764: Allow mono streams

The part is a mono speaker amp, but it can do downmix and switch between
left and right channel, so the right channel range is 1 to 2.

(This mirrors commit bf54d97a835d ("ASoC: tas2770: Allow mono streams")
which was a fix to the tas2770 driver.)

Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220825140241.53963-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: soc-pcm.c: call __soc_pcm_close() in soc_pcm_close()
Kuninori Morimoto [Mon, 22 Aug 2022 02:35:32 +0000 (02:35 +0000)]
ASoC: soc-pcm.c: call __soc_pcm_close() in soc_pcm_close()

commit b7898396f4bbe16 ("ASoC: soc-pcm: Fix and cleanup DPCM locking")
added __soc_pcm_close() for non-lock version of soc_pcm_close().
But soc_pcm_close() is not using it. It is no problem, but confusable.

static int __soc_pcm_close(...)
{
=> return soc_pcm_clean(rtd, substream, 0);
}

static int soc_pcm_close(...)
{
...
snd_soc_dpcm_mutex_lock(rtd);
=> soc_pcm_clean(rtd, substream, 0);
snd_soc_dpcm_mutex_unlock(rtd);
return 0;
}

This patch use it.

Fixes: b7898396f4bbe16 ("ASoC: soc-pcm: Fix and cleanup DPCM locking")
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czctgg3w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC platform driver for Apple MCA
Mark Brown [Thu, 25 Aug 2022 15:24:42 +0000 (16:24 +0100)]
ASoC platform driver for Apple MCA

Merge series from Martin Povišer <povik+lin@cutebit.org>:

sending what should be the final touches on Apple MCA driver. It most
likely goes without saying but please do not merge the DT additions
into the ASoC tree.

23 months agoASoC: sigmadsp: switch to use kmemdup_nul() helper
Yang Yingliang [Thu, 25 Aug 2022 12:35:25 +0000 (20:35 +0800)]
ASoC: sigmadsp: switch to use kmemdup_nul() helper

Use kmemdup_nul() helper instead of open-coding to
simplify the code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220825123525.1845695-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Add Apple MCA I2S transceiver bindings
Martin Povišer [Wed, 24 Aug 2022 16:07:12 +0000 (18:07 +0200)]
ASoC: Add Apple MCA I2S transceiver bindings

Add binding schema for MCA I2S transceiver found on Apple M1 and other
chips.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220824160715.95779-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: apple: mca: Add locking
Martin Povišer [Wed, 24 Aug 2022 16:07:15 +0000 (18:07 +0200)]
ASoC: apple: mca: Add locking

In DAI ops, accesses to the native cluster (of the DAI), and to data of
clusters related to it by a DPCM frontend-backend link, should have
been synchronized by the 'pcm_mutex' lock at ASoC level.

What is not covered are the 'port_driver' accesses on foreign clusters
to which the current cluster has no a priori relation, so fill in
locking for that. (This should only matter in bizarre configurations of
sharing one MCA peripheral between ASoC cards.)

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220824160715.95779-5-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: apple: mca: Start new platform driver
Martin Povišer [Wed, 24 Aug 2022 16:07:14 +0000 (18:07 +0200)]
ASoC: apple: mca: Start new platform driver

Add ASoC platform driver for the MCA peripheral found on Apple M1 and
other chips.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220824160715.95779-4-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: update SOF driver for mt8186
Mark Brown [Thu, 25 Aug 2022 12:37:57 +0000 (13:37 +0100)]
ASoC: SOF: mediatek: update SOF driver for mt8186

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

In these patches, we update SOF driver for mt8186

23 months agoASoC: max98088: add support for noise gate reg
Tommaso Merciai [Thu, 25 Aug 2022 10:17:13 +0000 (12:17 +0200)]
ASoC: max98088: add support for noise gate reg

Add support for Noise Gate Threshold reg (ANTH reg 0x40 bit 4 to 7)

References:
 - https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf, p75

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Link: https://lore.kernel.org/r/20220825101714.81580-1-tommaso.merciai@amarulasolutions.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: add suspend and resume for ES8316
Zhu Ning [Thu, 25 Aug 2022 01:49:52 +0000 (09:49 +0800)]
ASoC: codecs: add suspend and resume for ES8316

The registers may be lost after suspend due to powerdown.
regcache_sync solves this issue.

Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
Link: https://lore.kernel.org/r/20220825014952.1038508-1-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field
Chunxu Li [Thu, 25 Aug 2022 06:54:11 +0000 (14:54 +0800)]
ASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field

Use generic sof_ipc_msg_data instead of specific implementation as
they do the same things

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220825065411.31279-4-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box
Chunxu Li [Thu, 25 Aug 2022 06:54:10 +0000 (14:54 +0800)]
ASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box

Use generic IPC stream and mailbox ops for mt8186

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220825065411.31279-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: Add dai driver for mt8186
Chunxu Li [Thu, 25 Aug 2022 06:54:09 +0000 (14:54 +0800)]
ASoC: SOF: mediatek: Add dai driver for mt8186

Add dsp ops callback to register AFE DL1/DL2/UL1/UL2 SOF dai's with ALSA

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220825065411.31279-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: dt-bindings: modify machine
Mark Brown [Wed, 24 Aug 2022 16:23:44 +0000 (17:23 +0100)]
ASoC: mediatek: dt-bindings: modify machine

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

Add SOF related field.
1. Add a property "mediatek,adsp", Only when adsp phandle could be retrieved,
 from DTS, the SOF related part of machine driver is executed.
2. Add a property "mediatek,dai-link" to support dai-links could be specified
 from DTS

23 months agoASoC: mediatek: dt-bindings: modify machine bindings for SOF
chunxu.li [Wed, 24 Aug 2022 12:23:19 +0000 (20:23 +0800)]
ASoC: mediatek: dt-bindings: modify machine bindings for SOF

Add SOF related field.
1. Add a property "mediatek,adsp", Only when adsp phandle could be
retrieved, from DTS, the SOF related part of machine driver is executed.
2. Add a property "mediatek,dai-link" to support dai-links could be
specified from DTS

Signed-off-by: chunxu.li <chunxu.li@mediatek.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220824122319.23918-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: dt-bindings: modify machine bindings for SOF
chunxu.li [Wed, 24 Aug 2022 12:23:18 +0000 (20:23 +0800)]
ASoC: mediatek: dt-bindings: modify machine bindings for SOF

Add SOF related field.
1. Add a property "mediatek,adsp", Only when adsp phandle could be
retrieved, from DTS, the SOF related part of machine driver is executed.
2. Add a property "mediatek,dai-link" to support dai-links could be
specified from DTS

Signed-off-by: chunxu.li <chunxu.li@mediatek.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220824122319.23918-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: imx8ulp: add missing of_node_put() in imx8ulp_probe()
Yang Yingliang [Wed, 24 Aug 2022 01:32:34 +0000 (09:32 +0800)]
ASoC: SOF: imx8ulp: add missing of_node_put() in imx8ulp_probe()

After using 'res_node' returned by of_parse_phandle(), of_node_put()
need be called to decrease the refcount.

Fixes: fb5319af6ad8 ("ASoC: SOF: imx: Add i.MX8ULP HW support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220824013234.375738-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codes: src4xxx: Avoid clang -Wsometimes-uninitialized in src4xxx_hw_params()
Nathan Chancellor [Tue, 23 Aug 2022 15:19:40 +0000 (08:19 -0700)]
ASoC: codes: src4xxx: Avoid clang -Wsometimes-uninitialized in src4xxx_hw_params()

Clang warns:

  sound/soc/codecs/src4xxx.c:280:3: error: variable 'd' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
                  default:
                  ^~~~~~~
  sound/soc/codecs/src4xxx.c:298:59: note: uninitialized use occurs here
                  ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_11, d);
                                                                          ^
  sound/soc/codecs/src4xxx.c:223:20: note: initialize the variable 'd' to silence this warning
          int val, pj, jd, d;
                            ^
                            = 0
  sound/soc/codecs/src4xxx.c:280:3: error: variable 'jd' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
                  default:
                  ^~~~~~~
  sound/soc/codecs/src4xxx.c:293:59: note: uninitialized use occurs here
                  ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_10, jd);
                                                                          ^~
  sound/soc/codecs/src4xxx.c:223:17: note: initialize the variable 'jd' to silence this warning
          int val, pj, jd, d;
                        ^
                          = 0
  sound/soc/codecs/src4xxx.c:280:3: error: variable 'pj' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
                  default:
                  ^~~~~~~
  sound/soc/codecs/src4xxx.c:288:59: note: uninitialized use occurs here
                  ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_0F, pj);
                                                                          ^~
  sound/soc/codecs/src4xxx.c:223:13: note: initialize the variable 'pj' to silence this warning
          int val, pj, jd, d;
                    ^
                      = 0
  3 errors generated.

The datasheet does not have any default values for these regmap values
so pick some arbitrary values and print to the user that this is the
case to silence the warnings.

Link: https://github.com/ClangBuiltLinux/linux/issues/1691
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: "Sudip Mukherjee (Codethink)" <sudipm.mukherjee@gmail.com>
Suggested-by: Matt Flax <flatmax@flatmax.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Matt Flax <flatmax@flatmax.com>
Link: https://lore.kernel.org/r/20220823151939.2493697-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda: Skip IMR boot after a firmware crash or boot failure
Peter Ujfalusi [Tue, 23 Aug 2022 12:43:59 +0000 (15:43 +0300)]
ASoC: SOF: Intel: hda: Skip IMR boot after a firmware crash or boot failure

To make sure that we start from a clean state next time when the DSP is
powered up after a firmware crash or boot failure we must skip the IMR
booting attempt.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220823124359.24865-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: dt-bindings: Add missing (unevaluated|additional)Properties on child nodes
Rob Herring [Tue, 23 Aug 2022 14:56:39 +0000 (09:56 -0500)]
ASoC: dt-bindings: Add missing (unevaluated|additional)Properties on child nodes

In order to ensure only documented properties are present, node schemas
must have unevaluatedProperties or additionalProperties set to false
(typically).

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220823145649.3118479-8-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: ipc4-loader: Verify ext manifest magic number
Peter Ujfalusi [Tue, 23 Aug 2022 12:42:19 +0000 (15:42 +0300)]
ASoC: SOF: ipc4-loader: Verify ext manifest magic number

Firmware image must start with an extended manifest. Add a check to make
sure that the image does contain it.

The magic number (the first u32 of a firmware image if manifest is present)
for an IPC4 image must be 0x31454124 (ASCI "$AE1").

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220823124219.927-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: imx: imx8ulp: declare ops structure as static
Pierre-Louis Bossart [Tue, 23 Aug 2022 15:40:27 +0000 (17:40 +0200)]
ASoC: SOF: imx: imx8ulp: declare ops structure as static

Sparse warning:

sound/soc/sof/imx/imx8ulp.c:416:24: error: symbol 'sof_imx8ulp_ops'
was not declared. Should it be static?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220823154027.762889-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: fsl_sai: Update slots number according to bclk_ratio
Shengjiu Wang [Fri, 5 Aug 2022 06:45:26 +0000 (14:45 +0800)]
ASoC: fsl_sai: Update slots number according to bclk_ratio

The bclk_ratio is set by .set_bclk_ratio API.
bclk_ratio = slots * slot_width
So if slots is not set by .set_tdm_slot, then it can be calculated
by bclk_ratio.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1659681926-13493-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda: Correct Firmware State Register use
Mark Brown [Tue, 23 Aug 2022 18:48:41 +0000 (19:48 +0100)]
ASoC: SOF: Intel: hda: Correct Firmware State Register use

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

Hi,

The FSR (Firmware State Register) holds the ROM state information, it does not
contain error information.
The FSR itself is a bit more complicated as well as the state depends on the
module currently in use.

The error code from ROM or the status code from the firmware is located at the
next register.

Fix the handling of the FSR in order to provide usable and human readable (in
most cases) report on the status and error.

Regards,
Peter
---
Peter Ujfalusi (3):
  ASoC: SOF: Intel: hda: Correct the ROM/FW state reporting code
  ASoC: SOF: Intel: hda-loader: Use the FSR state definitions during
    bootup
  ASoC: SOF: Intel: hda: Drop no longer used ROM state definitions

 sound/soc/sof/intel/hda-loader.c |  10 +--
 sound/soc/sof/intel/hda.c        | 147 ++++++++++++++++++++++++++-----
 sound/soc/sof/intel/hda.h        |  69 +++++++++++++--
 3 files changed, 194 insertions(+), 32 deletions(-)

--
2.37.0

23 months agoIntroduce sof_of_machine_select
Mark Brown [Tue, 23 Aug 2022 18:48:39 +0000 (19:48 +0100)]
Introduce sof_of_machine_select

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

In these patches, we introduce function sof_of_machine_select for SOF

23 months agoASoC: SOF: mediatek: Add sof_mt8186_machs for mt8186
Chunxu Li [Fri, 5 Aug 2022 07:04:49 +0000 (15:04 +0800)]
ASoC: SOF: mediatek: Add sof_mt8186_machs for mt8186

Add .of_machines field sof_mt8186_machs for mt8186

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220805070449.6611-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Introduce function sof_of_machine_select
Chunxu Li [Fri, 5 Aug 2022 07:04:48 +0000 (15:04 +0800)]
ASoC: SOF: Introduce function sof_of_machine_select

From current design in sof_machine_check and snd_sof_new_platform_drv,
the SOF can only support ACPI type machine.

1. In sof_machine_check if there is no ACPI machine exist, the function
will return -ENODEV directly, that's we don't expected if we do not
base on ACPI machine.

2. In snd_sof_new_platform_drv the component driver need a driver name
to do ignore_machine, currently the driver name is obtained from
machine->drv_name, and the type of machine is snd_soc_acpi_mach.

So we add a new function named sof_of_machine_select that we can pass
sof_machine_check and obtain info required by snd_sof_new_platform_drv.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220805070449.6611-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda: Drop no longer used ROM state definitions
Peter Ujfalusi [Tue, 12 Jul 2022 12:57:34 +0000 (15:57 +0300)]
ASoC: SOF: Intel: hda: Drop no longer used ROM state definitions

All code have been switched to use the new FSR defines and macros for
ROM/FW state tracking.
The old definitions can be dropped now.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220712125734.30512-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda-loader: Use the FSR state definitions during bootup
Peter Ujfalusi [Tue, 12 Jul 2022 12:57:33 +0000 (15:57 +0300)]
ASoC: SOF: Intel: hda-loader: Use the FSR state definitions during bootup

Switch to use the newly added FSR (Firmware State Register) definitions
for DSP state handling and targeting.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220712125734.30512-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: fsl_sai: Add support multi fifo sdma script
Shengjiu Wang [Tue, 23 Aug 2022 01:36:13 +0000 (09:36 +0800)]
ASoC: fsl_sai: Add support multi fifo sdma script

With disabling combine mode, the multiple successive
FIFO registers or non successive FIFO registers of SAI module
can work with the sdma multi fifo script.

This patch is to configure the necessary information to
the SDMA engine driver for support multi fifo script.

'words_per_fifo' is the channels for each dataline
'n_fifos_src' and 'n_fifos_dst' are the fifo number
'stride_fifos_src' and 'stride_fifos_dst' are the stride
between enable FIFOs
'maxburst' is the multiply of datalines

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1661218573-2154-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Remove dai_posn variable
Daniel Baluta [Mon, 22 Aug 2022 17:49:37 +0000 (20:49 +0300)]
ASoC: SOF: compress: Remove dai_posn variable

dai_posn is set but never used. Initial intention was
to use dai_posn to shorthen one code line but it looks fine
without it too.

Fixes: c1a731c71359 ("ASoC: SOF: compress: Add support for computing timestamps")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220822174937.254873-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: atmel_ssc_dai: Remove the unneeded result variable
ye xingchen [Tue, 23 Aug 2022 07:53:35 +0000 (07:53 +0000)]
ASoC: atmel_ssc_dai: Remove the unneeded result variable

Return the value from asoc_ssc_init() directly instead of storing it
in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220823075335.209072-1-ye.xingchen@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: rename sound card name
chunxu.li [Tue, 23 Aug 2022 09:07:35 +0000 (17:07 +0800)]
ASoC: mediatek: mt8186: rename sound card name

The field 'topology_shortname' in 'snd_soc_card' is defined as char[32],
Current card name will be truncated when SOF is enabled, so rename the
sound card name.

Signed-off-by: chunxu.li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220823090735.12176-1-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: samsung: Use iio_get_channel_type() accessor.
Jonathan Cameron [Sun, 21 Aug 2022 16:09:14 +0000 (17:09 +0100)]
ASoC: samsung: Use iio_get_channel_type() accessor.

struct iio_chan_spec is meant to be opaque to IIO consumer drivers
which should only use the interfaces in linux/iio/consumer.h.
Use the provided accessor function to find get the type of the
channel instead of directly reading it form the structure.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20220821160914.2207116-1-jic23@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: soc-pcm.c: summarize related settings at soc_new_pcm()
Kuninori Morimoto [Mon, 22 Aug 2022 02:46:25 +0000 (02:46 +0000)]
ASoC: soc-pcm.c: summarize related settings at soc_new_pcm()

soc_new_pcm() sets pcm->no_device_suspend, but it sets other pcm->xxx
at the same function with different timing.
pcm->no_device_suspend setup timing has no effect. This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bksdgflq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: support SOF for mt8186
Mark Brown [Fri, 19 Aug 2022 22:46:57 +0000 (23:46 +0100)]
ASoC: mediatek: support SOF for mt8186

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

In these patches, we add SOF support for mt8186 which have HiFi5 DSP
inside.

23 months agoASoC: amd: acp: remove unnecessary NULL checks
Dan Carpenter [Fri, 19 Aug 2022 05:23:09 +0000 (08:23 +0300)]
ASoC: amd: acp: remove unnecessary NULL checks

The list iterator can never be NULL.  Delete the bogus NULL checks.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yv8ePUuBfzaRu6xV@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Change handling of unimplemented set_bclk_ratio
Martin Povišer [Thu, 18 Aug 2022 16:53:36 +0000 (18:53 +0200)]
ASoC: Change handling of unimplemented set_bclk_ratio

If a 'set_bclk_ratio' call is attempted on a DAI not implementing the
method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can
still be okay with the ratio, just does not care to register a handler.

No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect
the return value, but -ENOSUPP disables an error print from within the
common soc_dai_ret return filter. With the new behavior a machine
driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of
which may care about the ratio, some of which may not.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220818165336.76403-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: amd: acp: add a label to make error path more clean
Yang Yingliang [Fri, 19 Aug 2022 07:37:58 +0000 (15:37 +0800)]
ASoC: amd: acp: add a label to make error path more clean

Move platform_device_unregister() to a new label to make code more clean.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: amd: acp: switch to use dev_err_probe()
Yang Yingliang [Fri, 19 Aug 2022 07:37:57 +0000 (15:37 +0800)]
ASoC: amd: acp: switch to use dev_err_probe()

Use dev_err_probe() to simplify code and print error code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()
Yang Yingliang [Fri, 19 Aug 2022 07:37:56 +0000 (15:37 +0800)]
ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()

Add missing platform_device_unregister() in error path in acp_pci_probe().

Fixes: c49f5e74a11e ("ASoC: amd: acp: Add error handling cases")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: imx: Add i.MX8ULP HW support
Zhang Peng [Thu, 18 Aug 2022 01:53:54 +0000 (09:53 +0800)]
ASoC: SOF: imx: Add i.MX8ULP HW support

This adds skeleton support for the audio DSP hardware found on
NXP i.MX8ULP platform.

On i.MX8ULP resources (clocks, power, etc) are managed by the
System Integration Module in LPAV domain and XRDC which is handled
by arm trusted firmware.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1660787634-28550-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agodt-bindings: dsp: fsl: Add SOF compatile string for i.MX8ULP
Shengjiu Wang [Thu, 18 Aug 2022 01:53:53 +0000 (09:53 +0800)]
dt-bindings: dsp: fsl: Add SOF compatile string for i.MX8ULP

Add SOF compatile string "fsl,imx8ulp-dsp" for supporting DSP
device on i.MX8ULP platform.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1660787634-28550-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-da7219-max98357
Chunxu Li [Thu, 18 Aug 2022 02:51:13 +0000 (10:51 +0800)]
ASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-da7219-max98357

1. Add widgets, routes and dai-links required by SOF

2. Only when adsp phandle could be retrieved from DTS, the SOF related part
of machine driver is executed.

3. Support dai-links could be specified from DTS, so that
we can disable AP side hardware controls when DSP SOF controls the same
audio FE.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220818025113.17144-4-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-rt1019-rt5682s
Chunxu Li [Thu, 18 Aug 2022 02:51:12 +0000 (10:51 +0800)]
ASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-rt1019-rt5682s

1. Add widgets, routes and dai-links required by SOF

2. Only when adsp phandle could be retrieved from DTS, the SOF related part
of machine driver is executed.

3. Support dai-links could be specified from DTS, so that
we can disable AP side hardware controls when DSP SOF controls the same
audio FE.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220818025113.17144-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: support DSP downlink
Chunxu Li [Thu, 18 Aug 2022 02:51:11 +0000 (10:51 +0800)]
ASoC: mediatek: mt8186: support DSP downlink

1. add DSP downlink link widget
2. add DSP to I2S route path

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220818025113.17144-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: fsl_sai: Remove unnecessary FIFO reset in ISR
Shengjiu Wang [Wed, 17 Aug 2022 05:24:27 +0000 (13:24 +0800)]
ASoC: fsl_sai: Remove unnecessary FIFO reset in ISR

The FIFO reset drops the words in the FIFO, which may cause
channel swap when SAI module is running, especially when the
DMA speed is low. So it is not good to do FIFO reset in ISR,
then remove the operation.

Fixes: e2681a1bf5ae ("ASoC: fsl_sai: Add isr to deal with error flag")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1660713867-26921-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Some small code improvements
Mark Brown [Wed, 17 Aug 2022 17:05:13 +0000 (18:05 +0100)]
ASoC: cs42l42: Some small code improvements

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

This is a collection of minor improvements to the code or comments.

23 months agoASoC: soc-utils-test: Add test for snd_soc_params_to_bclk()
Richard Fitzgerald [Wed, 17 Aug 2022 12:55:08 +0000 (13:55 +0100)]
ASoC: soc-utils-test: Add test for snd_soc_params_to_bclk()

snd_soc_params_to_bclk() calculates the BCLK from only the information in
snd_pcm_hw_params. It is therefore a subset of the functionality of
snd_soc_tdm_params_to_bclk() so can use a subset of the test case table.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817125508.1406651-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoEnable timestamp support for SOF compress driver
Mark Brown [Wed, 17 Aug 2022 14:18:49 +0000 (15:18 +0100)]
Enable timestamp support for SOF compress driver

Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This patchseries computes pcm_io_frames from the DAI position reported
by SOF firmware.  Using pcm_io_frames userspace applications can later
compute timestamps for compressed stream.

23 months agoASoC/soundwire: log actual PING status on resume issues
Mark Brown [Wed, 17 Aug 2022 14:18:47 +0000 (15:18 +0100)]
ASoC/soundwire: log actual PING status on resume issues

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

we've been stuck with problems in the dual-amplifier configurations where
one of the two devices seems to become UNATTACHED and never regains sync,
see https://github.com/thesofproject/linux/issues/3638.

This is a rather infrequent issue that may happen once or twice per month,
but still it remains a concern.

One possibility is that the device does lose sync but somehow our hardware
detection fails to see it resync.

This series just adds a basic read directly from the PING frames to help
confirm if yes/no the device regain sync.

23 months agoASoC: cs42l42: Use snd_soc_tdm_params_to_bclk()
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:47 +0000 (13:23 +0100)]
ASoC: cs42l42: Use snd_soc_tdm_params_to_bclk()

Use the new snd_soc_tdm_params_to_bclk() helper function to
calculate the bclk. This function handles most of the previous
manipulation and makes the code tidier.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Fix comment typo in cs42l42_slow_start_put()
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:46 +0000 (13:23 +0100)]
ASoC: cs42l42: Fix comment typo in cs42l42_slow_start_put()

Fix "much change together" to "must change together".

It's probably obvious what was meant but it's nice to fix it.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Move cs42l42_supply_names to .c file
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:45 +0000 (13:23 +0100)]
ASoC: cs42l42: Move cs42l42_supply_names to .c file

The array of supply name strings doesn't need to be in the header file.
Move it to the .c file.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Add include dependencies to cs42l42.h
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:44 +0000 (13:23 +0100)]
ASoC: cs42l42: Add include dependencies to cs42l42.h

Make cs42l42.h include the other headers it depends on instead of
assuming that the .c file already included them.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Don't include kernel.h
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:43 +0000 (13:23 +0100)]
ASoC: cs42l42: Don't include kernel.h

kernel.h includes a lot of other headers that we don't need.
Replace with an include of types.h.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: show PING status on resume failures
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:43 +0000 (09:10 +0800)]
ASoC: codecs: show PING status on resume failures

This helper should help identify cases where devices fall off the bus
and don't resync.

BugLink: https://github.com/thesofproject/linux/issues/3638
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agosoundwire: add sdw_show_ping_status() helper
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:42 +0000 (09:10 +0800)]
soundwire: add sdw_show_ping_status() helper

This helper provides an optional delay parameter to wait for devices
to resync in case of errors, and checks that devices are indeed
attached on the bus.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agosoundwire: intel/cadence: expose PING status in manager ops
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:41 +0000 (09:10 +0800)]
soundwire: intel/cadence: expose PING status in manager ops

Simple indirection to existing register.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agosoundwire: add read_ping_status helper definition in manager ops
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:40 +0000 (09:10 +0800)]
soundwire: add read_ping_status helper definition in manager ops

The existing manager ops provide callbacks to transfer read/write
commands, but don't allow for direct access to PING status
register. This is accessible in all existing IP, and would help
diagnose timeouts or resume issues by reporting the 'true' status
instead of the internal status reported by the IP.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: core: remove setting platform_max in kcontrol macros
Srinivas Kandagatla [Tue, 16 Aug 2022 17:21:29 +0000 (18:21 +0100)]
ASoC: core: remove setting platform_max in kcontrol macros

platform_max should not be set by the driver, its intended for machine drivers
or DT to override the max value for platform specific reasons.

So remove setting this from Kcontrol macros.

Setting this to max in these macros would limit the range when min
value is less then zero.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220816172129.6661-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tlv320adcx140: Add a new kcontrol
Kevin Lu [Mon, 15 Aug 2022 11:27:15 +0000 (19:27 +0800)]
ASoC: tlv320adcx140: Add a new kcontrol

Add a new kcontrol for phase calib

Signed-off-by: Kevin Lu <luminlong@139.com>
Link: https://lore.kernel.org/r/20220815112715.21617-1-luminlong@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: qcom: qdsp6: q6prm: add new clocks
Srinivas Kandagatla [Tue, 16 Aug 2022 17:01:18 +0000 (18:01 +0100)]
ASoC: qcom: qdsp6: q6prm: add new clocks

Add support to new clocks that are added in Q6DSP as part of newer version
of LPASS support on SM8450 and SC8280XP.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220816170118.13470-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Variable type completion
Xin Gao [Tue, 16 Aug 2022 17:51:05 +0000 (01:51 +0800)]
ASoC: Variable type completion

'unsigned int' is better than 'unsigned'.

Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
Link: https://lore.kernel.org/r/20220816175105.8084-1-gaoxin@cdjrlc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: es8326: change es8326_regmap_config to static
Yang Yingliang [Wed, 17 Aug 2022 09:15:19 +0000 (17:15 +0800)]
ASoC: codecs: es8326: change es8326_regmap_config to static

es8326_regmap_config is only used in es8326.c now, change it to static.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220817091519.2487385-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Add support for computing timestamps
Laurentiu Mihalcea [Wed, 17 Aug 2022 08:05:29 +0000 (11:05 +0300)]
ASoC: SOF: compress: Add support for computing timestamps

We compute the number of pcm_io_frames by dividing the
dai position to size of a frame (channels * sample size).

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Save channel count and sample bytes
Laurentiu Mihalcea [Wed, 17 Aug 2022 08:05:28 +0000 (11:05 +0300)]
ASoC: SOF: compress: Save channel count and sample bytes

The purpose of this change is to enable the saving of the
channel count and sample container bytes format parameters for later use
to compute the timestamps.

This is done when setting the compress stream parameters
(in sof_compr_set_params).

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Introduce sof_compr_stream
Daniel Baluta [Wed, 17 Aug 2022 08:05:27 +0000 (11:05 +0300)]
ASoC: SOF: compress: Introduce sof_compr_stream

This will keep SOF compress stream private data. So far
we used snd_compr_tstamp to hold the private data but this
is no longer enough as we need to hold other info like
number of channels or sample bytes.

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Remove byte offset computation
Daniel Baluta [Wed, 17 Aug 2022 08:05:26 +0000 (11:05 +0300)]
ASoC: SOF: compress: Remove byte offset computation

Byte offset is the offset in the ring buffer to the DSP
while posn_offset is an offset inside the stream_box where
we keep position information.

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: HSW and BDW updates
Mark Brown [Tue, 16 Aug 2022 16:33:11 +0000 (17:33 +0100)]
ASoC: Intel: HSW and BDW updates

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Sharing this PR as it touches on cross-driver subjects. Four commits yet
two subject. Given the small delta, decided to combine within single PR
here.

23 months agoASoC: SOF: Intel: pci-tgl: use RPL specific firmware definitions
Kai Vehmanen [Tue, 16 Aug 2022 13:05:10 +0000 (16:05 +0300)]
ASoC: SOF: Intel: pci-tgl: use RPL specific firmware definitions

Split out firmware definitions for Intel Raptor Lake platforms.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Suggested-by: Gopal Vamshi Krishna <vamshi.krishna.gopal@intel.com>
Link: https://lore.kernel.org/r/20220816130510.190427-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>