platform/kernel/linux-starfive.git
23 months agoASoC: Intel: avs: Lock substream before snd_pcm_stop()
Cezary Rojewski [Wed, 16 Nov 2022 11:55:49 +0000 (12:55 +0100)]
ASoC: Intel: avs: Lock substream before snd_pcm_stop()

snd_pcm_stop() shall be called with stream lock held to prevent any
races between nonatomic streaming operations.

Fixes: 2f1f570cd730 ("ASoC: Intel: avs: Coredump and recovery flow")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221116115550.1100398-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: add Dell SKU 0C11 support
Mark Brown [Tue, 22 Nov 2022 15:20:52 +0000 (15:20 +0000)]
ASoC: Intel: add Dell SKU 0C11 support

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

Add Dell SKU 0C11 support with rt1318 codec.

23 months agoASoC: Intel: soc-acpi: add SKU 0C11 SoundWire configuration
Gongjun Song [Thu, 17 Nov 2022 00:27:58 +0000 (08:27 +0800)]
ASoC: Intel: soc-acpi: add SKU 0C11 SoundWire configuration

Audio hardware configuration of SKU 0C11 product is rt711 on link0,
two rt1318s on link1 and link2, rt714 on link3

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221117002758.496211-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: sof_sdw: Add support for SKU 0C11 product
Gongjun Song [Thu, 17 Nov 2022 00:27:57 +0000 (08:27 +0800)]
ASoC: Intel: sof_sdw: Add support for SKU 0C11 product

SKU 0C11 product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221117002758.496211-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: intel: sof_sdw: add rt1318 codec support.
Gongjun Song [Thu, 17 Nov 2022 00:27:56 +0000 (08:27 +0800)]
ASoC: intel: sof_sdw: add rt1318 codec support.

Add rt1318 sdca codec support in sof_sdw machine driver.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221117002758.496211-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: Skylake: Fix Kconfig dependency
Lili Li [Mon, 21 Nov 2022 10:47:42 +0000 (18:47 +0800)]
ASoC: Intel: Skylake: Fix Kconfig dependency

Commit e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and
exit routines") introduced HDA codec init routine which depends on SND_HDA.
Select SND_SOC_HDAC_HDA unconditionally to fix following compile error:
ERROR: modpost: "snd_hda_codec_device_init" [sound/soc/intel/skylake/snd-soc-skl.ko] undefined!

Fixes: e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines")
Reviewed-by: Junxiao Chang <junxiao.chang@intel.com>
Suggested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Lili Li <lili.li@intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221121104742.1007486-1-lili.li@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: nau8825: Add a manually mechanism for detection failure
David Lin [Tue, 22 Nov 2022 07:38:56 +0000 (15:38 +0800)]
ASoC: nau8825: Add a manually mechanism for detection failure

This patch is to use saradc to check the jack type when auto
detection is still failure.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20221122073855.43024-2-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: nau8825: Adjust internal clock during jack detection
David Lin [Tue, 22 Nov 2022 07:38:55 +0000 (15:38 +0800)]
ASoC: nau8825: Adjust internal clock during jack detection

This patch is to rasie up internal clock during jack detection.
The fast clock will accelerate charge and discharge effect.
So this mechanism will make jack detection more robust.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20221122073855.43024-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: sof_sdw: Add support for SKU 0C4F product
Gongjun Song [Tue, 22 Nov 2022 05:20:52 +0000 (13:20 +0800)]
ASoC: Intel: sof_sdw: Add support for SKU 0C4F product

SKU 0C4F product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221122052052.687281-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: core: Exit all links before removing their components
Cezary Rojewski [Thu, 27 Oct 2022 08:58:40 +0000 (10:58 +0200)]
ASoC: core: Exit all links before removing their components

Flows leading to link->init() and link->exit() are not symmetric.
Currently the relevant part of card probe sequence goes as:

for_each_card_rtds(card, rtd)
for_each_rtd_components(rtd, i, component)
component->probe()
for_each_card_rtds(card, rtd)
for_each_rtd_dais(rtd, i, dai)
dai->probe()
for_each_card_rtds(card, rtd)
rtd->init()

On the other side, equivalent remove sequence goes as:

for_each_card_rtds(card, rtd)
for_each_rtd_dais(rtd, i, dai)
dai->remove()
for_each_card_rtds(card, rtd)
for_each_rtd_components(rtd, i, component)
component->remove()
for_each_card_rtds(card, rtd)
rtd->exit()

what can lead to errors as link->exit() may still operate on resources
owned by its components despite the probability of them being freed
during the component->remove().

This change modifies the remove sequence to:

for_each_card_rtds(card, rtd)
rtd->exit()
for_each_card_rtds(card, rtd)
for_each_rtd_dais(rtd, i, dai)
dai->remove()
for_each_card_rtds(card, rtd)
for_each_rtd_components(rtd, i, component)
component->remove()

so code found in link->exit() is safe to touch any component stuff as
component->remove() has not been called yet.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20221027085840.1562698-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mchp-spdiftx: add power saving features
Mark Brown [Fri, 18 Nov 2022 15:13:50 +0000 (15:13 +0000)]
ASoC: mchp-spdiftx: add power saving features

Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>:

This series adds support for runtime PM and system suspend/resume
for Microchip SPDIFTX (patches 2/3, 3/3). Along with it I took the
chance and added a minor cleanup (patch 1/3).

23 months agoASoC: Intel: sof_sdw_amp: mark coeff tables with __maybe_unused
Pierre-Louis Bossart [Fri, 18 Nov 2022 01:51:06 +0000 (09:51 +0800)]
ASoC: Intel: sof_sdw_amp: mark coeff tables with __maybe_unused

The same file provides two tables used in separate drivers, make them
as __maybe_unused to avoid errors:

sound/soc/intel/boards/sof_sdw_amp_coeff_tables.h:163:17: error:
‘dell_0b00_bq_params’ defined but not used
[-Werror=unused-const-variable=]
  163 | static const u8 dell_0b00_bq_params[] = {

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221118015106.532302-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: avs: Initialize private data for subsequent HDA FEs
Cezary Rojewski [Fri, 18 Nov 2022 11:30:52 +0000 (12:30 +0100)]
ASoC: Intel: avs: Initialize private data for subsequent HDA FEs

HDAudio implementation found in sound/pci/hda expects a valid stream
pointer in substream->runtime->private_data location. For ASoC users,
that should point to a valid link stream which is assigned when BE
opens.

As BE borrows its runtime from FE, the information may be lost when
reparenting comes into picture - see dpcm_be_reparent(). To support the
DPCM reparenting functionality for HDAudio scenarios while still
fulfilling expectations of HDAudio common code, have all FEs point to
the same private data.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221118113052.1340593-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mchp-spdiftx: add support for system suspend/resume
Claudiu Beznea [Thu, 17 Nov 2022 12:37:50 +0000 (14:37 +0200)]
ASoC: mchp-spdiftx: add support for system suspend/resume

Add support for system suspend/resume by moving the enable/disable
of interrupts in mchp_spdiftx_trigger() on SNDRV_PCM_TRIGGER_SUSPEND/
SNDRV_PCM_TRIGGER_RESUME commands.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20221117123750.291911-4-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mchp-spdiftx: add runtime pm support
Claudiu Beznea [Thu, 17 Nov 2022 12:37:49 +0000 (14:37 +0200)]
ASoC: mchp-spdiftx: add runtime pm support

Add runtime PM support for Microchip SPDIFTX driver. The runtime PM
APIs disables/enables IP's clock and enables/disable caching for
regmap.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20221117123750.291911-3-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mchp-spdiftx: simplify locking around ctrl->ch_stat
Claudiu Beznea [Thu, 17 Nov 2022 12:37:48 +0000 (14:37 +0200)]
ASoC: mchp-spdiftx: simplify locking around ctrl->ch_stat

Use a temporary variable to keep the AES3 value. With this a
spin_unlock_irqrestore() call has been removed from the final code.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20221117123750.291911-2-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: dt-bindings: sun50i-dmic: Add D1 compatible string
Samuel Holland [Wed, 16 Nov 2022 03:46:21 +0000 (21:46 -0600)]
ASoC: dt-bindings: sun50i-dmic: Add D1 compatible string

The Allwinner D1 SoC has a DMIC codec like the one in the H6. It appears
to be register-compatible with the H6 variant, and the existing Linux
driver has been tested on a D1-based board, the Lichee RV 86 Panel.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Ban Tao <fengzheng923@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221116034621.37762-1-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: amd: acp: Fix possible UAF in acp_dma_open
Gaosheng Cui [Fri, 18 Nov 2022 03:00:56 +0000 (11:00 +0800)]
ASoC: amd: acp: Fix possible UAF in acp_dma_open

Smatch report warning as follows:

sound/soc/amd/acp/acp-platform.c:199 acp_dma_open() warn:
  '&stream->list' not removed from list

If snd_pcm_hw_constraint_integer() fails in acp_dma_open(),
stream will be freed, but stream->list will not be removed from
adata->stream_list, then list traversal may cause UAF.

Fix by adding the newly allocated stream to the list once it's fully
initialised.

Fixes: 7929985cfe36 ("ASoC: amd: acp: Initialize list to store acp_stream during pcm_open")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20221118030056.3135960-1-cuigaosheng1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: sof_nau8825: support rt1015p speaker amplifier
Brent Lu [Thu, 17 Nov 2022 23:19:19 +0000 (17:19 -0600)]
ASoC: Intel: sof_nau8825: support rt1015p speaker amplifier

Add rt1015p speaker amplifier support with a new board info
'adl_rt1015p_nau8825' which supports NAU8825 on SSP0 and ALC1015Q on
SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221117231919.112483-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: probes: Check ops before memory allocation
Andy Shevchenko [Thu, 17 Nov 2022 10:32:23 +0000 (12:32 +0200)]
ASoC: SOF: probes: Check ops before memory allocation

We may check ops before spending resources on memory allocation.
While at it, utilize dev_get_platdata() helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221117103223.74425-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: wsa883x: Simplify with dev_err_probe
Krzysztof Kozlowski [Wed, 9 Nov 2022 16:37:59 +0000 (17:37 +0100)]
ASoC: codecs: wsa883x: Simplify with dev_err_probe

Code can be a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221109163759.1158837-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: wsa883x: Shutdown on error path
Krzysztof Kozlowski [Wed, 9 Nov 2022 16:37:58 +0000 (17:37 +0100)]
ASoC: codecs: wsa883x: Shutdown on error path

If probe fails, toggle shutdown via GPIO to save power and reverse
probe actions.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221109163759.1158837-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: ps: Move acp63_dev_data strcture from PCI driver
Syed Saba Kareem [Wed, 16 Nov 2022 10:59:23 +0000 (16:29 +0530)]
ASoC: amd: ps: Move acp63_dev_data strcture from PCI driver

Move acp63_dev_data structure from PCI driver to acp header file.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20221116105938.762550-2-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: ps: update macros with ps platform naming convention
Syed Saba Kareem [Wed, 16 Nov 2022 10:59:22 +0000 (16:29 +0530)]
ASoC: amd: ps: update macros with ps platform naming convention

Update macros using ps platform naming convention.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20221116105938.762550-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoAdds the combination of headset codec ALC5682I-VD + amp rt1019p
Mark Brown [Wed, 16 Nov 2022 13:12:20 +0000 (13:12 +0000)]
Adds the combination of headset codec ALC5682I-VD + amp rt1019p

Merge series from Ajye Huang <ajye_huang@compal.corp-partner.google.com>:

v1:
- machine driver:
  - Adds the combination of headset codec ALC5682I-VD + amp rt1019p.
  - Remove the duplicate code in machine driver.

Ajye Huang (2):
  ASoC: Intel: sof_rt5682: add support for ALC5682I-VD with amp rt1019p
  ASoC: Intel: sof rt5682: remove the duplicate codes

 sound/soc/intel/boards/sof_rt5682.c               | 7 +------
 sound/soc/intel/common/soc-acpi-intel-adl-match.c | 4 ++--
 2 files changed, 3 insertions(+), 8 deletions(-)

--
2.25.1

2 years agoASoC: rt1318: Add RT1318 SDCA vendor-specific driver
Shuming Fan [Tue, 8 Nov 2022 09:27:27 +0000 (17:27 +0800)]
ASoC: rt1318: Add RT1318 SDCA vendor-specific driver

This is the initial amplifier driver for rt1318 SDCA version.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20221108092727.13011-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof rt5682: remove the duplicate codes
Ajye Huang [Tue, 8 Nov 2022 04:27:16 +0000 (12:27 +0800)]
ASoC: Intel: sof rt5682: remove the duplicate codes

Remove the redundant code to prevent user confuse.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221108042716.2930255-3-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof_rt5682: add support for ALC5682I-VD with amp rt1019p
Ajye Huang [Tue, 8 Nov 2022 04:27:15 +0000 (12:27 +0800)]
ASoC: Intel: sof_rt5682: add support for ALC5682I-VD with amp rt1019p

This patch adds the driver data for two rt1019 speaker amplifiers on
SSP1 and ALC5682I-VD on SSP0 for ADL platform.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221108042716.2930255-2-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: core: fix wrong size kzalloc for rtd's components member
lishqchn [Tue, 8 Nov 2022 04:24:56 +0000 (12:24 +0800)]
ASoC: core: fix wrong size kzalloc for rtd's components member

The actual space for struct snd_soc_component has been allocated by
snd_soc_register_component, here rtd's components are pointers to
components, I replace the base size from *component to component.

Signed-off-by: lishqchn <lishqchn@qq.com>
Link: https://lore.kernel.org/r/tencent_59850BB028662B6F2D49D7F3624AB84CCF05@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: tx-macro: add dmic support via tx macro
Srinivas Kandagatla [Tue, 15 Nov 2022 06:54:30 +0000 (06:54 +0000)]
ASoC: codecs: tx-macro: add dmic support via tx macro

DMIC Paths into LPASS digital codec can go via tx-macro or va-macro codec, add
support to tx-macro path as va-macro path is already supported.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221115065430.4126-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: sunxi: use devm_platform_get_and_ioremap_resource()
Minghao Chi [Fri, 11 Nov 2022 08:41:51 +0000 (16:41 +0800)]
ASoC: sunxi: use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/202211111641514826535@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: pxa: fix null-pointer dereference in filter()
Zeng Heng [Mon, 14 Nov 2022 08:56:29 +0000 (16:56 +0800)]
ASoC: pxa: fix null-pointer dereference in filter()

kasprintf() would return NULL pointer when kmalloc() fail to allocate.
Need to check the return pointer before calling strcmp().

Fixes: 7a824e214e25 ("ASoC: mmp: add audio dma support")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Link: https://lore.kernel.org/r/20221114085629.1910435-1-zengheng4@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: Remove a useless include
Christophe JAILLET [Sat, 12 Nov 2022 21:12:13 +0000 (22:12 +0100)]
ASoC: codecs: Remove a useless include

<linux/gcd.h> is not needed for these drivers. Remove the corresponding
#include.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/875ca433849025edf8c23624cf29b0e2250bba50.1668287523.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: wsa883x: use correct header file
Randy Dunlap [Tue, 8 Nov 2022 00:18:29 +0000 (16:18 -0800)]
ASoC: codecs: wsa883x: use correct header file

Fix build errors when GPIOLIB is not set/enabled:

../sound/soc/codecs/wsa883x.c: In function 'wsa883x_probe':
../sound/soc/codecs/wsa883x.c:1394:25: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'? [-Werror=implicit-function-declaration]
         wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
../sound/soc/codecs/wsa883x.c:1395:49: error: 'GPIOD_FLAGS_BIT_NONEXCLUSIVE' undeclared (first use in this function)
         GPIOD_FLAGS_BIT_NONEXCLUSIVE);
../sound/soc/codecs/wsa883x.c:1414:9: error: implicit declaration of function 'gpiod_direction_output'; did you mean 'gpio_direction_output'? [-Werror=implicit-function-declaration]
         gpiod_direction_output(wsa883x->sd_n, 1);

Fixes: 43b8c7dc85a1 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Banajit Goswami <bgoswami@quicinc.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221108001829.5100-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: wsa883x: Use proper shutdown GPIO polarity
Krzysztof Kozlowski [Thu, 10 Nov 2022 13:35:12 +0000 (14:35 +0100)]
ASoC: codecs: wsa883x: Use proper shutdown GPIO polarity

The shutdown GPIO is active low (SD_N), but this depends on actual board
layout.  Linux drivers should only care about logical state, where high
(1) means shutdown and low (0) means do not shutdown.

Invert the GPIO to match logical value.

Fixes: 43b8c7dc85a1 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221110133512.478831-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: qcom,wsa883x: Use correct SD_N polarity
Krzysztof Kozlowski [Thu, 10 Nov 2022 13:35:11 +0000 (14:35 +0100)]
ASoC: dt-bindings: qcom,wsa883x: Use correct SD_N polarity

Use correct polarity in example and powerdown-gpios description.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221110133512.478831-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: add new Dell devices support
Mark Brown [Fri, 11 Nov 2022 17:33:41 +0000 (17:33 +0000)]
ASoC: Intel: add new Dell devices support

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

Add 2 Dell SKU support.

2 years agoASoC: Intel: add more ACPI tables/quirks for RPL/MTL
Mark Brown [Fri, 11 Nov 2022 17:33:35 +0000 (17:33 +0000)]
ASoC: Intel: add more ACPI tables/quirks for RPL/MTL

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Add support for two RaptorLake SoundWire SKUs and one test board for
MeteorLake.

There will be additional RaptorLake SKUs shared when validation is
complete.

2 years agoASoC: audio-graph-card2: remove Experimental announce
Kuninori Morimoto [Fri, 11 Nov 2022 04:34:51 +0000 (04:34 +0000)]
ASoC: audio-graph-card2: remove Experimental announce

Audio Graph Card2 has been announcing "Audio Graph Card2 is
still under Experimental stage", but it is time to remove it.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k042nm6s.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qcom: q6prm: Correct module description
Krzysztof Kozlowski [Fri, 11 Nov 2022 09:13:28 +0000 (10:13 +0100)]
ASoC: qcom: q6prm: Correct module description

The description was copied from APM driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221111091328.31549-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Set BQ parameters for some Dell models
Mark Brown [Fri, 11 Nov 2022 17:01:39 +0000 (17:01 +0000)]
ASoC: Set BQ parameters for some Dell models

There are some Dell SKUs that need to set the parameters of the
crossover filter (biquad).  Each amplifier connects to one tweeter
speaker and one woofer speaker.  We should control HPF/LPF to output the
proper frequency for the different speakers.  If the codec driver got
the BQ parameters from the device property, it will apply these
parameters to the hardware.

2 years agoASoC: Intel: soc-acpi: add SKU 0C40 SoundWire configuration
Gongjun Song [Fri, 11 Nov 2022 04:50:16 +0000 (12:50 +0800)]
ASoC: Intel: soc-acpi: add SKU 0C40 SoundWire configuration

Audio hardware configuration of SKU 0C40 product is rt711 on link2,
two rt1316s on link0 and link1, rt714 on link 3.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221111045016.46573-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof_sdw: Add support for SKU 0C40 product
Gongjun Song [Fri, 11 Nov 2022 04:50:15 +0000 (12:50 +0800)]
ASoC: Intel: sof_sdw: Add support for SKU 0C40 product

SKU 0C40 product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221111045016.46573-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: soc-acpi: add SKU 0C10 SoundWire configuration
Gongjun Song [Fri, 11 Nov 2022 04:50:14 +0000 (12:50 +0800)]
ASoC: Intel: soc-acpi: add SKU 0C10 SoundWire configuration

Audio hardware configuration of SKU 0C10 product is rt714 on link0,
two rt1316s on link1 and link2

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221111045016.46573-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof_sdw: Add support for SKU 0C10 product
Gongjun Song [Fri, 11 Nov 2022 04:50:13 +0000 (12:50 +0800)]
ASoC: Intel: sof_sdw: Add support for SKU 0C10 product

SKU 0C10 product supports SoundWire capture from local microphone
and two SoundWire amplifiers(no headset codec).

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221111045016.46573-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: soc-acpi: add MTL AIC SoundWire configurations
Yong Zhi [Thu, 10 Nov 2022 22:54:32 +0000 (16:54 -0600)]
ASoC: Intel: soc-acpi: add MTL AIC SoundWire configurations

Add support to the following daughter card:

SDW0: MX98373 Speaker
SDW2: ALC5682 Headset

Share same driver data used by sof_sdw driver for mtlrvp.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221110225432.144184-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: soc-acpi: add SKU 0C40 SoundWire configuration
Gongjun Song [Thu, 10 Nov 2022 22:54:31 +0000 (16:54 -0600)]
ASoC: Intel: soc-acpi: add SKU 0C40 SoundWire configuration

Audio hardware configuration of SKU 0C40 product is rt711 on link2,
two rt1316s on link0 and link1, rt714 on link 3.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221110225432.144184-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof_sdw: Add support for SKU 0C40 product
Gongjun Song [Thu, 10 Nov 2022 22:54:30 +0000 (16:54 -0600)]
ASoC: Intel: sof_sdw: Add support for SKU 0C40 product

SKU 0C40 product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221110225432.144184-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: soc-acpi: add SKU 0C10 SoundWire configuration
Gongjun Song [Thu, 10 Nov 2022 22:54:29 +0000 (16:54 -0600)]
ASoC: Intel: soc-acpi: add SKU 0C10 SoundWire configuration

Audio hardware configuration of SKU 0C10 product is rt714 on link0,
two rt1316s on link1 and link2

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221110225432.144184-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof_sdw: Add support for SKU 0C10 product
Gongjun Song [Thu, 10 Nov 2022 22:54:28 +0000 (16:54 -0600)]
ASoC: Intel: sof_sdw: Add support for SKU 0C10 product

SKU 0C10 product supports SoundWire capture from local microphone
and two SoundWire amplifiers(no headset codec).

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221110225432.144184-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: lpass-wsa-macro: parse clock-output-names
Krzysztof Kozlowski [Thu, 3 Nov 2022 19:53:40 +0000 (15:53 -0400)]
ASoC: codecs: lpass-wsa-macro: parse clock-output-names

If we have several instances of WSA macro, each one of them should
register clock with unique name, so parse clock-output-names for this.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221103195341.174972-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: qcom,lpass: do not hard-code clock-output-names
Krzysztof Kozlowski [Thu, 3 Nov 2022 19:53:39 +0000 (15:53 -0400)]
ASoC: dt-bindings: qcom,lpass: do not hard-code clock-output-names

The purpose of clock-output-names is to customize desired clock name,
not use one, same name.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103195341.174972-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof_sdw_rt1316: add BQ params for the Dell models
Shuming Fan [Wed, 9 Nov 2022 09:13:17 +0000 (17:13 +0800)]
ASoC: Intel: sof_sdw_rt1316: add BQ params for the Dell models

The Dell SKU 0B00/0B01/0AFE/0AFF model needs the BQ params for the tweeter/woofer.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20221109091317.17240-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: sof_sdw_rt1308: add BQ params for the Dell models
Shuming Fan [Wed, 9 Nov 2022 09:13:06 +0000 (17:13 +0800)]
ASoC: Intel: sof_sdw_rt1308: add BQ params for the Dell models

The Dell SKU 0A5D/0A5E/0990/098F model needs the BQ params for the tweeter/woofer.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20221109091306.17221-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rt1316-sdw: get BQ params property and apply them
Shuming Fan [Wed, 9 Nov 2022 09:12:44 +0000 (17:12 +0800)]
ASoC: rt1316-sdw: get BQ params property and apply them

If the machine driver level sets the BQ params into the device property,
the codec driver will get the BQ params and apply them.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20221109091244.17198-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rt1308-sdw: get BQ params property and apply them
Shuming Fan [Wed, 9 Nov 2022 09:12:34 +0000 (17:12 +0800)]
ASoC: rt1308-sdw: get BQ params property and apply them

If the machine driver level sets the BQ params into the device property,
the codec driver will get the BQ params and apply them.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20221109091234.17180-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: tegra: Fix spelling mistake "fliter" -> "filter"
Colin Ian King [Tue, 8 Nov 2022 11:13:40 +0000 (11:13 +0000)]
ASoC: tegra: Fix spelling mistake "fliter" -> "filter"

There is a spelling mistake in struct member fliter_structure.
Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20221108111340.115387-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: fsl-sai: Sort main section properties
Marek Vasut [Fri, 4 Nov 2022 16:03:15 +0000 (17:03 +0100)]
ASoC: dt-bindings: fsl-sai: Sort main section properties

Sort main section properties, no functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221104160315.213836-3-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: fsl-sai: Use minItems 5 for i.MX8MN clock and similar
Marek Vasut [Fri, 4 Nov 2022 16:03:14 +0000 (17:03 +0100)]
ASoC: dt-bindings: fsl-sai: Use minItems 5 for i.MX8MN clock and similar

The i.MX8MN currently uses "bus", "mclk0", "mclk1", "mclk2", "mclk3"
clock, which adds up to 5 clock total. Use minItems 5 for this setup.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221104160315.213836-2-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings
Marek Vasut [Fri, 4 Nov 2022 16:03:13 +0000 (17:03 +0100)]
ASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings

Describe existing used combinations of compatible strings on MX6UL
and MX7D, which are backward compatible with MX6SX. Add the missing
imx7d-sai compatible string which is used on i.MX7 .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221104160315.213836-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: da7219: Do not export da7219_aad_jack_det()
Mark Brown [Thu, 10 Nov 2022 17:50:21 +0000 (17:50 +0000)]
ASoC: codecs: da7219: Do not export da7219_aad_jack_det()

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

Goal of the series is to drop any usage of the internal function.

First, update all users to utilize component->set_jack() and then remove
the relevant EXPORT_SYMBOL_GPL.

2 years agoASoC: SOF: ipc4-topology: Add widget queue support
Mark Brown [Thu, 10 Nov 2022 17:50:14 +0000 (17:50 +0000)]
ASoC: SOF: ipc4-topology: Add widget queue support

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

with SOF topology2 for IPC4, widgets might have mutliple queues they can be
connected.
The queues to use between components are descibed in the topology file.

This series adds widget queue support (specify which pin to connect) for
ipc4-topology with topology2.

Note: currently queue 0 of a widget is used as hardwired default.

2 years agoASoC: simpe-card/audio-graph fixups
Mark Brown [Thu, 10 Nov 2022 17:50:07 +0000 (17:50 +0000)]
ASoC: simpe-card/audio-graph fixups

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

These are simpe-card/audio-graph fixup patches.

2 years agoAdjust usage of rt5682(s) power supply properties
Mark Brown [Thu, 10 Nov 2022 17:50:00 +0000 (17:50 +0000)]
Adjust usage of rt5682(s) power supply properties

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

This series sets straight the usage of power supply properties for the
rt5682 and rt5682s audio codecs.

These properties were already being used by sc7180-trogdor.dtsi (and
derived DTs like sc7180-trogdor-kingoftown.dtsi).

We start by documenting the power supplies that are already in use and
then add few others that were missing to the bindings.

Then we update the drivers to also support the new supplies.

Finally we update the trogdor DTs so they have the newly added but
required supplies and remove a superfluous one that was causing
warnings.

2 years agoASoC: SOF: get pipeline instance id from pipe_widget->instance_id
Mark Brown [Thu, 10 Nov 2022 17:49:54 +0000 (17:49 +0000)]
ASoC: SOF: get pipeline instance id from pipe_widget->instance_id

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

Currently we set pipeline instance id = swidget->pipeline_id, but
pipeline_id is from topology and can be any number. In fact, the
number of pipelines is limited. This patch use ida to allocate pipeline
instance id and will be used for pipeline instance id in the IPC
message.

2 years agoASoC: SOF: Intel: update D0i3 registers for MTL
Mark Brown [Thu, 10 Nov 2022 17:49:48 +0000 (17:49 +0000)]
ASoC: SOF: Intel: update D0i3 registers for MTL

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

MeteorLake relies on a different register for D0i3 configuration, add
a platform-specific callback to abstract the differences.

2 years agoASoC: mediatek: Register machine drivers to module device table
Mark Brown [Thu, 10 Nov 2022 17:49:41 +0000 (17:49 +0000)]
ASoC: mediatek: Register machine drivers to module device table

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

Some ASoC machine drivers for MediaTek platforms were not being
registered to the module device table, preventing them to be
automatically loaded when built as modules. This series adds the missing
registration to the drivers.

2 years agoASoC: mediatek: mt8195-mt6359: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:37 +0000 (11:04 -0500)]
ASoC: mediatek: mt8195-mt6359: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-10-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8192-mt6359: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:36 +0000 (11:04 -0500)]
ASoC: mediatek: mt8192-mt6359: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-9-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8186-rt5682: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:35 +0000 (11:04 -0500)]
ASoC: mediatek: mt8186-rt5682: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-8-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8186-da7219: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:34 +0000 (11:04 -0500)]
ASoC: mediatek: mt8186-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-7-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8183-mt6358: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:33 +0000 (11:04 -0500)]
ASoC: mediatek: mt8183-mt6358: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-6-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8183-da7219: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:32 +0000 (11:04 -0500)]
ASoC: mediatek: mt8183-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-5-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt6797-mt6351: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:31 +0000 (11:04 -0500)]
ASoC: mediatek: mt6797-mt6351: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-4-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt2701-wm8960: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:30 +0000 (11:04 -0500)]
ASoC: mediatek: mt2701-wm8960: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-3-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt2701-cs42448: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:29 +0000 (11:04 -0500)]
ASoC: mediatek: mt2701-cs42448: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: ipc4: get pipeline instance id from pipe_widget->instance_id
Bard Liao [Tue, 8 Nov 2022 00:29:10 +0000 (08:29 +0800)]
ASoC: SOF: ipc4: get pipeline instance id from pipe_widget->instance_id

Currently we set pipeline instance id = swidget->pipeline_id, but
pipeline_id is from topology and can be any number. In fact, the
number of pipelines is limited. This patch use ida to allocate pipeline
instance id and will be used for pipeline instance id in the IPC
message.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221108002910.2819709-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: ipc4-loader: get max pipeline number
Bard Liao [Tue, 8 Nov 2022 00:29:09 +0000 (08:29 +0800)]
ASoC: SOF: ipc4-loader: get max pipeline number

Get max pipeline number from firmware configuration.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221108002910.2819709-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: ipc4-topology: rename sof_ipc4_widget_free_comp
Bard Liao [Tue, 8 Nov 2022 00:29:08 +0000 (08:29 +0800)]
ASoC: SOF: ipc4-topology: rename sof_ipc4_widget_free_comp

sof_ipc4_widget_free_comp is dedicated to pipeline. Rename it
to sof_ipc4_widget_free_comp_pipeline.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221108002910.2819709-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: set d0i3 register with d0i3_offset
Rander Wang [Mon, 7 Nov 2022 16:41:54 +0000 (10:41 -0600)]
ASoC: SOF: Intel: set d0i3 register with d0i3_offset

Set the d0i3 with d0i3_offset for different platforms

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221107164154.21925-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: add d0i3_offset in chip_info
Rander Wang [Mon, 7 Nov 2022 16:41:53 +0000 (10:41 -0600)]
ASoC: SOF: Intel: add d0i3_offset in chip_info

MTL has different d0i3 offset compared to cavs platforms.
Use d0i3_offset to unify the setting.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221107164154.21925-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: add d0i3 definition for MTL
Rander Wang [Mon, 7 Nov 2022 16:41:52 +0000 (10:41 -0600)]
ASoC: SOF: Intel: add d0i3 definition for MTL

MTL has a different offset of d0i3 compared to cavs platforms.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221107164154.21925-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rt5682: Support DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:20:00 +0000 (14:20 -0400)]
ASoC: rt5682: Support DBVDD and LDO1-IN supplies

Add support for the DBVDD and LDO1-IN supplies.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-7-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rt5682s: Support DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:59 +0000 (14:19 -0400)]
ASoC: rt5682s: Support DBVDD and LDO1-IN supplies

Add support for the DBVDD and LDO1-IN supplies.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-6-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:58 +0000 (14:19 -0400)]
ASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies

The rt5682 codec has two additional power supply pins, DBVDD and
LDO1_IN, that aren't currently described in the binding. Add them.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221102182002.255282-5-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:57 +0000 (14:19 -0400)]
ASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies

The rt5682 codec has three supplies - AVDD, MICVDD and VBAT - which are
already used by sc7180-trogdor.dtsi. Document them in the binding.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-4-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:56 +0000 (14:19 -0400)]
ASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies

The rt5682s codec has two additional power supply pins, DBVDD and
LDO1_IN, that aren't currently described in the binding. Add them.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221102182002.255282-3-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies
Nícolas F. R. A. Prado [Wed, 2 Nov 2022 18:19:55 +0000 (14:19 -0400)]
ASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies

The rt5682s codec has two supplies - AVDD and MICVDD - which are already
used by sc7180-trogdor-kingoftown.dtsi. Document them in the binding.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20221102182002.255282-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda-loader: use small buffer for iccmax stream
Kai Vehmanen [Mon, 7 Nov 2022 07:26:21 +0000 (09:26 +0200)]
ASoC: SOF: Intel: hda-loader: use small buffer for iccmax stream

The data received via iccmax stream is not used anywhere, so no need to
allocate a big DMA buffer for it. This is especially important as the
allocation is done even in cases where reload of the firmware is skipped
and execution happens directly from the firmware stored in IMR.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter 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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221107072621.28904-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: ipc4-topology: Implement tear_down_all_pipelines callback
Peter Ujfalusi [Mon, 7 Nov 2022 08:41:58 +0000 (10:41 +0200)]
ASoC: SOF: ipc4-topology: Implement tear_down_all_pipelines callback

During system suspend there is a chance that the running stream undergo
an xrun and instead of the expected SNDRV_PCM_TRIGGER_SUSPEND trigger
we will receive SNDRV_PCM_TRIGGER_STOP.

The handling of SUSPEND and STOP triggers differ that case of the later
the sof_pcm_stream_free() will be called with free_widget_list = false.
But we must make sure that all active widgets and streams are free before
entering suspend in order to be able to resume without error.

We can utilize the tear_down_all_pipelines to put the system to an expected
state and to fix the suspend/resume error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.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/20221107084158.26629-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8183-mt6358: Register to module device table
Nícolas F. R. A. Prado [Fri, 4 Nov 2022 21:24:08 +0000 (17:24 -0400)]
ASoC: mediatek: mt8183-mt6358: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221104212409.603970-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8183-da7219: Register to module device table
Nícolas F. R. A. Prado [Fri, 4 Nov 2022 21:24:07 +0000 (17:24 -0400)]
ASoC: mediatek: mt8183-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221104212409.603970-1-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: da7219: Do not export internal symbols
Amadeusz Sławiński [Mon, 31 Oct 2022 16:02:27 +0000 (17:02 +0100)]
ASoC: codecs: da7219: Do not export internal symbols

With all users utilizing component->set_jack(), there is no need to
export da7219_aad_jack_det() function.

While at it, remove exports from all other functions as well.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:26 +0000 (17:02 +0100)]
ASoC: Intel: avs: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:25 +0000 (17:02 +0100)]
ASoC: amd: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:24 +0000 (17:02 +0100)]
ASoC: rockchip: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:23 +0000 (17:02 +0100)]
ASoC: mediatek: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: Drop da7219_aad_jack_det() usage
Cezary Rojewski [Mon, 31 Oct 2022 16:02:22 +0000 (17:02 +0100)]
ASoC: Intel: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: da7219: Introduce set_jack() callback
Amadeusz Sławiński [Mon, 31 Oct 2022 16:02:21 +0000 (17:02 +0100)]
ASoC: codecs: da7219: Introduce set_jack() callback

Codec driver for da7219 implements jack detect functionality, but does
not integrate it with the framework. Platform component drivers are
accessing the functionality through internal da7219_aad_jack_det()
instead.

Address this by implementing set_jack() for the codec.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: topology: Add helper to get/put widget queue id
Chao Song [Mon, 7 Nov 2022 08:57:06 +0000 (10:57 +0200)]
ASoC: SOF: topology: Add helper to get/put widget queue id

Add get/put queue id helper to manage queue id in route
setup and route free.

The queue allocation rules are:

  - If widget only has one sink/source pin, zero will be
returned as the queue ID directly.

  - If widget has more than one sink/source pins, and pin
binding array is defined in topology, queue ID will be
allocated according to the pin binding array.

  - If widget has more than one sink/sink pins, and pin
binding array is not defined, Linux ID allocation will be
used to allocate queue ID dynamically.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221107085706.2550-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>