platform/kernel/linux-rpi.git
16 months agoASoC: Merge fixes due to dependencies
Mark Brown [Fri, 16 Jun 2023 13:55:20 +0000 (14:55 +0100)]
ASoC: Merge fixes due to dependencies

So we can apply the tlv320aic3xxx DT conversion.

16 months agoASoC: loongson: fix compile testing on 32-bit
Arnd Bergmann [Fri, 16 Jun 2023 09:00:40 +0000 (11:00 +0200)]
ASoC: loongson: fix compile testing on 32-bit

DIV_ROUND_CLOSEST() does not work on 64-bit variables when building for
a 32-bit target:

ld.lld: error: undefined symbol: __udivdi3
>>> referenced by loongson_i2s.c
>>>               sound/soc/loongson/loongson_i2s.o:(loongson_i2s_hw_params) in archive vmlinux.a

Use DIV_ROUND_CLOSEST_ULL() instead.

Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230616090156.2347850-4-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: loongson: add PCI dependency
Arnd Bergmann [Fri, 16 Jun 2023 09:00:39 +0000 (11:00 +0200)]
ASoC: loongson: add PCI dependency

The new driver fails to build when PCI is disabled:

WARNING: unmet direct dependencies detected for SND_SOC_LOONGSON_I2S_PCI
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=y]) && PCI [=n]
  Selected by [y]:
  - SND_SOC_LOONGSON_CARD [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=y])
sound/soc/loongson/loongson_i2s_pci.c:167:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
module_pci_driver(loongson_i2s_driver);

Add the appropriate Kconfig dependency.

Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230616090156.2347850-3-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: loongson: fix unused PM function warning
Arnd Bergmann [Fri, 16 Jun 2023 09:00:38 +0000 (11:00 +0200)]
ASoC: loongson: fix unused PM function warning

Build testing without CONFIG_PM_SLEEP causes a warning:

sound/soc/loongson/loongson_i2s.c:246:12: error: unused function 'i2s_suspend' [-Werror,-Wunused-function]
sound/soc/loongson/loongson_i2s.c:255:12: error: unused function 'i2s_resume' [-Werror,-Wunused-function]

Use the modern SYSTEM_SLEEP_PM_OPS() instead of the old one to avoid this.

Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230616090156.2347850-2-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: max98388: fix unused function warnings
Arnd Bergmann [Fri, 16 Jun 2023 09:00:37 +0000 (11:00 +0200)]
ASoC: max98388: fix unused function warnings

The PM functions are never referenced when CONFIG_PM_SLEEP is
disabled:

sound/soc/codecs/max98388.c:854:12: error: unused function 'max98388_suspend' [-Werror,-Wunused-function]
static int max98388_suspend(struct device *dev)
           ^
sound/soc/codecs/max98388.c:864:12: error: unused function 'max98388_resume' [-Werror,-Wunused-function]
static int max98388_resume(struct device *dev)

Fix this by using the modern SYSTEM_SLEEP_PM_OPS() macro in place of
the deprecated SET_SYSTEM_SLEEP_PM_OPS() version, and use pm_sleep_ptr()
to hide the entire structure as well.

On a related note, the of_match_ptr() and ACPI_PTR() macros have the same
problem and would cause the device id table to be unused when the driver
is built-in and the respective subsystems are disabled. This does not
cause warnings unless -Wunused-const-variable is passed to the compiler,
but it's better to just not use the macros at all here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230616090156.2347850-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dt-bindings: Add support for Loongson audio card
Yingkun Meng [Wed, 14 Jun 2023 12:26:59 +0000 (20:26 +0800)]
ASoC: dt-bindings: Add support for Loongson audio card

The audio card uses loongson I2S controller present in
7axxx/2kxxx chips to transfer audio data.

On loongson platform, the chip has only one I2S controller.

Signed-off-by: Yingkun Meng <mengyingkun@loongson.cn>
Link: https://lore.kernel.org/r/20230614122659.3402788-1-mengyingkun@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: loongson: Add Loongson ASoC Sound Card Support
Yingkun Meng [Wed, 14 Jun 2023 12:22:40 +0000 (20:22 +0800)]
ASoC: loongson: Add Loongson ASoC Sound Card Support

The Loongson ASoC Sound Card is a general ASoC DAI Link driver that
can be used for Loongson CPU DAI drivers and external CODECs.

The driver supports the use of ACPI table to describe device resources.
On loongson 7axxx platforms, the audio device is an ACPI device.

Signed-off-by: Yingkun Meng <mengyingkun@loongson.cn>
Link: https://lore.kernel.org/r/20230614122240.3402762-1-mengyingkun@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: max98388: add amplifier driver
Ryan Lee [Tue, 13 Jun 2023 06:09:45 +0000 (23:09 -0700)]
ASoC: max98388: add amplifier driver

Added Analog Devices MAX98388 amplifier driver.
MAX98388 provides a PCM interface for audio data and a standard I2C
interface for control data communication.

Signed-off-by: Ryan Lee <ryans.lee@analog.com>
Link: https://lore.kernel.org/r/20230613060945.183128-2-ryan.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dt-bindings: max98388: add amplifier driver
Ryan Lee [Tue, 13 Jun 2023 06:09:44 +0000 (23:09 -0700)]
ASoC: dt-bindings: max98388: add amplifier driver

Add dt-bindings information for Analog Devices MAX98388 I2S Amplifier

Signed-off-by: Ryan Lee <ryans.lee@analog.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230613060945.183128-1-ryan.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: Add support for Loongson I2S controller
Yingkun Meng [Thu, 15 Jun 2023 12:27:18 +0000 (20:27 +0800)]
ASoC: Add support for Loongson I2S controller

Loongson I2S controller is found on 7axxx/2kxxx chips from loongson,
it is a PCI device with two private DMA controllers, one for playback,
the other for capture.

The driver supports the use of DTS or ACPI to describe device resources.

Signed-off-by: Yingkun Meng <mengyingkun@loongson.cn>
Link: https://lore.kernel.org/r/20230615122718.3412942-1-mengyingkun@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: Use the maple tree register cache for RealTek
Mark Brown [Thu, 15 Jun 2023 12:52:12 +0000 (13:52 +0100)]
ASoC: Use the maple tree register cache for RealTek

Merge series from Mark Brown <broonie@kernel.org>:

The RealTek SoundWire CODECs don't support bulk register operations so
they gain no advantage from using the rbtree cache, convert them to use
the maple tree cache instead - it is more modern.

16 months agoASoC: simple_card_utils: remove unused cpus/codecs/platforms from props
Kuninori Morimoto [Thu, 15 Jun 2023 05:32:42 +0000 (05:32 +0000)]
ASoC: simple_card_utils: remove unused cpus/codecs/platforms from props

simple_dai_props has cpus/codecs/platforms. These pointer were used
for dai_link before, but are allocated today since
commit 050c7950fd70 ("ASoC: simple-card-utils: alloc dai_link
information for CPU/Codec/Platform").
We don't need to keep it anymore. This patch removes these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkhhxpc6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: simple-card-utils.c: share asoc_graph_parse_dai()
Kuninori Morimoto [Wed, 14 Jun 2023 00:02:57 +0000 (00:02 +0000)]
ASoC: simple-card-utils.c: share asoc_graph_parse_dai()

Current Audio Graph Card/Card2 implements asoc_simple_parse_dai()
on each driver, but these are same function.
This patch share it as asoc_graph_parse_dai().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7lihpvy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: amd: Add support for IPC with a reply_size set to zero
Venkata Prasad Potturu [Wed, 14 Jun 2023 10:37:05 +0000 (16:07 +0530)]
ASoC: SOF: amd: Add support for IPC with a reply_size set to zero

Add support for IPC tx_message with a reply_size set to zero,
return zero when message reply_size is zero at acp_dsp_ipc_get_reply().

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230614103707.2246296-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: ti,tlv320aic3x: Add missing type for "gpio-reset"
Rob Herring [Tue, 13 Jun 2023 20:10:05 +0000 (14:10 -0600)]
ASoC: dt-bindings: ti,tlv320aic3x: Add missing type for "gpio-reset"

"gpio-reset" may be deprecated, but it still needs a type.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Jai Luthra <j-luthra@ti.com>
Link: https://lore.kernel.org/r/20230613201006.2822985-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt1318: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:19 +0000 (15:27 +0100)]
ASoC: rt1318: Use maple tree register cache

The rt1318 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-8-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt1316: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:18 +0000 (15:27 +0100)]
ASoC: rt1316: Use maple tree register cache

The rt1316 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-7-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt1308: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:17 +0000 (15:27 +0100)]
ASoC: rt1308: Use maple tree register cache

The rt1308 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-6-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt722: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:16 +0000 (15:27 +0100)]
ASoC: rt722: Use maple tree register cache

The rt722 can only support single register read and write operations so
does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-5-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt715: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:15 +0000 (15:27 +0100)]
ASoC: rt715: Use maple tree register cache

The rt715 can only support single register read and write operations so
does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-4-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt712: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:14 +0000 (15:27 +0100)]
ASoC: rt712: Use maple tree register cache

The rt712 can only support single register read and write operations so
does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-3-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt711: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:13 +0000 (15:27 +0100)]
ASoC: rt711: Use maple tree register cache

The rt711 can only support single register read and write operations so
does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-2-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: rt700: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 14:27:12 +0000 (15:27 +0100)]
ASoC: rt700: Use maple tree register cache

The rt700 can only support single register read and write operations so
does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-1-85ee50c93905@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: add new trigger ordering method
Mark Brown [Tue, 13 Jun 2023 16:39:51 +0000 (17:39 +0100)]
ASoC: add new trigger ordering method

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

This patch-set adds new "trigger" starting/stopping method.

17 months agoASoC: add N cpus to M codecs dai link support
Mark Brown [Tue, 13 Jun 2023 16:16:51 +0000 (17:16 +0100)]
ASoC: add N cpus to M codecs dai link support

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

Currently, ASoC supports dailinks with the following mappings:
1 cpu DAI to N codec DAIs
N cpu DAIs to N codec DAIs
But the mapping between N cpu DAIs and M codec DAIs is not supported.
The reason is that we didn't have a mechanism to map cpu and codec DAIs

This series suggests a new snd_soc_dai_link_codec_ch_map struct in
struct snd_soc_dai_link{} which provides codec DAI to cpu DAI mapping
information used to implement N cpu DAIs to M codec DAIs support.

And add the codec_ch_maps to SOF SoundWire machine driver.

17 months agoASoC: Use maple tree for Cirrus Logic devices
Mark Brown [Tue, 13 Jun 2023 16:16:44 +0000 (17:16 +0100)]
ASoC: Use maple tree for Cirrus Logic devices

Merge series from Mark Brown <broonie@kernel.org>:

A lot of the Cirrus Logic devices only support single register
read/write operations so they get no benefit from using the rbtree cache
over the more modern maple tree cache, convert them to use maple tree.

17 months agoASoC: siu: Add MODULE_FIRMWARE macro
Juerg Haefliger [Tue, 13 Jun 2023 09:54:54 +0000 (11:54 +0200)]
ASoC: siu: Add MODULE_FIRMWARE macro

The module loads firmware so add a MODULE_FIRMWARE macro to provide that
information via modinfo.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Link: https://lore.kernel.org/r/20230613095454.38696-1-juerg.haefliger@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: remove old trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:49:11 +0000 (06:49 +0000)]
ASoC: remove old trigger ordering method

All drivers switch to use generic trigger ordering method.
Let's remove old method.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87legufnyy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: starfive: use use new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:49:04 +0000 (06:49 +0000)]
ASoC: starfive: use use new trigger ordering method

ASoC is now supporting generic trigger ordering method.
This patch switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mt1afnz5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: atmel: use use new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:48:58 +0000 (06:48 +0000)]
ASoC: atmel: use use new trigger ordering method

ASoC is now supporting generic trigger ordering method.
This patch switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/87o7lqfnzb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: amd: use use new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:48:51 +0000 (06:48 +0000)]
ASoC: amd: use use new trigger ordering method

ASoC is now supporting generic trigger ordering method.
This patch switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pm66fnzi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: add new trigger ordering method
Kuninori Morimoto [Thu, 8 Jun 2023 06:48:36 +0000 (06:48 +0000)]
ASoC: add new trigger ordering method

Current ASoC is assuming that trigger starting order is
Link -> Component -> DAI as default, and its reverse order for stopping.
But some Driver / Card want to reorder it for some reasons.
We have such flags, but is unbalance like below.

struct snd_soc_component_driver :: start_dma_last
struct snd_soc_dai_link :: stop_dma_first

We want to have more flexible, and more generic method.
This patch adds new snd_soc_trigger_order for start/stop at
component / DAI-link.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0qmfnzx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: sof_sdw: add dai_link_codec_ch_map
Bard Liao [Wed, 7 Jun 2023 03:12:42 +0000 (11:12 +0800)]
ASoC: Intel: sof_sdw: add dai_link_codec_ch_map

The captured data will be combined from each cpu DAI if the dai link
has more than one cpu DAIs. We can set channel number indirectly by
adding sdw_codec_ch_maps.

Signed-off-by: Bard Liao <yung-chuan.liao@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>
Link: https://lore.kernel.org/r/20230607031242.1032060-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: add N cpus to M codecs dai link support
Bard Liao [Wed, 7 Jun 2023 03:12:41 +0000 (11:12 +0800)]
ASoC: add N cpus to M codecs dai link support

Currently, ASoC supports dailinks with the following mappings:
1 cpu DAI to N codec DAIs
N cpu DAIs to N codec DAIs
But the mapping between N cpu DAIs and M codec DAIs is not supported.
The reason is that we didn't have a mechanism to map cpu and codec DAIs

This patch suggests a new snd_soc_dai_link_codec_ch_map struct in
struct snd_soc_dai_link{} which provides codec DAI to cpu DAI mapping
information used to implement N cpu DAIs to M codec DAIs
support.

When a dailink contains two or more cpu DAIs, we should set channel
number of cpus based on its channel mask. The new struct also provides
channel mask information for each codec and we can construct the cpu
channel mask by combining all codec channel masks which map to the cpu.

The N:M mapping is however restricted to the N <= M case due to physical
restrictions on a time-multiplexed bus such as I2S/TDM, AC97, SoundWire
and HDaudio.

Signed-off-by: Bard Liao <yung-chuan.liao@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>
Link: https://lore.kernel.org/r/20230607031242.1032060-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs35l30: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:30 +0000 (14:56 +0100)]
ASoC: cs35l30: Use maple tree register cache

The cs35l30 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-10-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs43130: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:29 +0000 (14:56 +0100)]
ASoC: cs43130: Use maple tree register cache

The cs43130 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-9-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs42l83: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:28 +0000 (14:56 +0100)]
ASoC: cs42l83: Use maple tree register cache

The cs42l83 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-8-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs42l73: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:27 +0000 (14:56 +0100)]
ASoC: cs42l73: Use maple tree register cache

The cs42l73 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-7-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs42l42: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:26 +0000 (14:56 +0100)]
ASoC: cs42l42: Use maple tree register cache

The cs42l42 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-6-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs4234: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:25 +0000 (14:56 +0100)]
ASoC: cs4234: Use maple tree register cache

The cs4234 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-5-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs35l35: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:24 +0000 (14:56 +0100)]
ASoC: cs35l35: Use maple tree register cache

The cs35l35 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-4-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs35l34: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:23 +0000 (14:56 +0100)]
ASoC: cs35l34: Use maple tree register cache

The cs35l34 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-3-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs35l33: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:22 +0000 (14:56 +0100)]
ASoC: cs35l33: Use maple tree register cache

The cs35l33 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-2-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: cs35l32: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:56:21 +0000 (14:56 +0100)]
ASoC: cs35l32: Use maple tree register cache

The cs35l32 can only support single register read and write operations
so does not benefit from block writes. This means it gets no benefit from
using the rbtree register cache over the maple tree register cache so
convert it to use maple trees instead, it is more modern.

Acked-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-1-b806c4cbd1d4@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: tegra: Fix Master Volume Control
Jon Hunter [Tue, 13 Jun 2023 09:34:53 +0000 (10:34 +0100)]
ASoC: tegra: Fix Master Volume Control

Commit 3ed2b549b39f ("ALSA: pcm: fix wait_time calculations") corrected
the PCM wait_time calculations and in doing so reduced the calculated
wait_time. This exposed an issue with the Tegra Master Volume Control
(MVC) device where the reduced wait_time caused the MVC to fail. For now
fix this by setting the default wait_time for Tegra to be 500ms.

Fixes: 3ed2b549b39f ("ALSA: pcm: fix wait_time calculations")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20230613093453.13927-1-jonathanh@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs: remove redundant dapm routes
Mark Brown [Mon, 12 Jun 2023 17:35:11 +0000 (18:35 +0100)]
ASoC: Intel: avs: remove redundant dapm routes

Merge series from Brent Lu <brent.lu@intel.com>:

This patch series remove redundant dapm routes declared in multiple machine
drivers. These routes will be created by snd_soc_dapm_connect_dai_link_widgets()
during soundcard initialization. Following is the kernel log from a KBL
chromebook nocturne.

dmic:
[   13.773455] avs_dmic avs_dmic: connected DAI link dmic-codec:Capture -> dmic-platform:DMIC Rx
[   13.773460] avs_dmic avs_dmic: connected DAI link dmic-codec:Capture -> dmic-platform:DMIC WoV Rx

max98373:
[   14.079536] avs_max98373 avs_max98373.1: connected DAI link avs_max98373.1-platform:ssp0 Tx -> i2c-MX98373:00:Right HiFi Playback
[   14.079545] avs_max98373 avs_max98373.1: connected DAI link i2c-MX98373:00:Right HiFi Capture -> avs_max98373.1-platform:ssp0 Rx
[   14.079550] avs_max98373 avs_max98373.1: connected DAI link avs_max98373.1-platform:ssp0 Tx -> i2c-MX98373:01:Left HiFi Playback
[   14.079554] avs_max98373 avs_max98373.1: connected DAI link i2c-MX98373:01:Left HiFi Capture -> avs_max98373.1-platform:ssp0 Rx

hdaudio:
[   14.094818] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu0 Tx -> hdaudioB0D2:HDMI 0 Playback
[   14.094824] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu1 Tx -> hdaudioB0D2:HDMI 1 Playback
[   14.094828] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu2 Tx -> hdaudioB0D2:HDMI 2 Playback

17 months agoASoC: mediatek: mt8173: Fix error paths
Mark Brown [Mon, 12 Jun 2023 17:26:12 +0000 (18:26 +0100)]
ASoC: mediatek: mt8173: Fix error paths

Merge series from Ricardo Ribalda Delgado <ribalda@chromium.org>:

ASoC: mediatek: mt8173, presented a couple of error paths errors, lets
fix them.

17 months agoASoC: audio-graph-card2-custom-sample.dtsi: remove DT warning
Kuninori Morimoto [Mon, 12 Jun 2023 01:59:34 +0000 (01:59 +0000)]
ASoC: audio-graph-card2-custom-sample.dtsi: remove DT warning

Current audio-graph-card2-custom-sample.dtsi is missing
address-cells / size-cells / reg. Thus it get too many DT warnings.
This patch solved it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a5x5qw3d.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Switch two more i2c drivers back to use .probe()
Uwe Kleine-König [Mon, 12 Jun 2023 07:06:08 +0000 (09:06 +0200)]
ASoC: Switch two more i2c drivers back to use .probe()

The previous conversion back to .probe() applied in commit 9abcd24002bf
("ASoC: Switch i2c drivers back to use .probe()") was created based on
v6.3. Since then two more drivers were added which need to be convert
back in the same way before eventually .probe_new() can be dropped from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230612070608.836186-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: cirrus,cs35l45: drop unneeded quotes
Krzysztof Kozlowski [Fri, 9 Jun 2023 14:06:58 +0000 (16:06 +0200)]
ASoC: dt-bindings: cirrus,cs35l45: drop unneeded quotes

Cleanup bindings dropping unneeded quotes. Once all these are fixed,
checking for this can be enabled in yamllint.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230609140658.64557-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8173: Fix irq error path
Ricardo Ribalda Delgado [Mon, 12 Jun 2023 09:05:32 +0000 (11:05 +0200)]
ASoC: mediatek: mt8173: Fix irq error path

After reordering the irq probe, the error path was not properly done.
Lets fix it.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: stable@kernel.org
Fixes: 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready")
Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-2-432aa99ce24d@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path
Ricardo Ribalda Delgado [Mon, 12 Jun 2023 09:05:31 +0000 (11:05 +0200)]
ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path

If the second component fails to initialize, cleanup the first on.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: stable@kernel.org
Fixes: f1b5bf07365d ("ASoC: mt2701/mt8173: replace platform to component")
Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-1-432aa99ce24d@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-ssm4567: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:58 +0000 (19:09 +0800)]
ASoC: Intel: avs-ssm4567: remove redundant dapm routes

Four routes "Left Playback<-sspX Tx", "Right Playback<-sspX Tx",
"sspX Rx<-Left Capture Sense", and "sspX Rx<-Right Capture Sense" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-13-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-rt5682: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:57 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt5682: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-12-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-rt298: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:56 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt298: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-11-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-rt286: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:55 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt286: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-10-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-rt274: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:54 +0000 (19:09 +0800)]
ASoC: Intel: avs-rt274: remove redundant dapm routes

Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are
created by snd_soc_dapm_connect_dai_link_widgets() automatically.
Remove the duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-9-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-nau8825: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:53 +0000 (19:09 +0800)]
ASoC: Intel: avs-nau8825: remove redundant dapm routes

Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-8-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-max98927: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:52 +0000 (19:09 +0800)]
ASoC: Intel: avs-max98927: remove redundant dapm routes

Two routes "Left HiFi Playback<-sspX Tx" and
"Right HiFi Playback<-sspX Tx" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-7-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-max98373: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:51 +0000 (19:09 +0800)]
ASoC: Intel: avs-max98373: remove redundant dapm routes

Two routes "Left HiFi Playback<-sspX Tx" and
"Right HiFi Playback<-sspX Tx" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-6-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-max98357a: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:50 +0000 (19:09 +0800)]
ASoC: Intel: avs-max98357a: remove redundant dapm routes

The route "HiFi Playback<-sspX Tx" is created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-5-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-hdaudio: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:49 +0000 (19:09 +0800)]
ASoC: Intel: avs-hdaudio: remove redundant dapm routes

Three routes "HDMI 0 Playback<-hdaudioB0D2-cpu0 Tx",
"HDMI 1 Playback<-hdaudioB0D2-cpu1 Tx" and
"HDMI 2 Playback<-hdaudioB0D2-cpu2 Tx" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-4-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-dmic: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:48 +0000 (19:09 +0800)]
ASoC: Intel: avs-dmic: remove redundant dapm routes

Two routes "DMIC Rx<-Capture" and "DMIC WoV Rx<-Capture" are created
by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-3-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: avs-da7219: remove redundant dapm routes
Brent Lu [Mon, 12 Jun 2023 11:09:47 +0000 (19:09 +0800)]
ASoC: Intel: avs-da7219: remove redundant dapm routes

Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by
snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the
duplicate routes.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230612110958.592674-2-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoFix error check and cleanup for JH7110 TDM
Mark Brown [Fri, 9 Jun 2023 12:13:51 +0000 (13:13 +0100)]
Fix error check and cleanup for JH7110 TDM

Merge series from Walker Chen <walker.chen@starfivetech.com>:

Some minor issues were found during addtional testing and static
analysis. The first patch fix the error check for the return value of
devm_reset_control_array_get_exclusive(). The second patch drop some
unused macros.

17 months agoASoC: dt-bindings: audio-graph-card: Expand 'widgets' documentation
Marek Vasut [Tue, 6 Jun 2023 17:59:51 +0000 (19:59 +0200)]
ASoC: dt-bindings: audio-graph-card: Expand 'widgets' documentation

Document the encoding of 'widgets' property to avoid confusion.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20230606175951.215740-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: audio-graph-card2-custom-sample: add missing CPU:Codec = 1:N sample
Kuninori Morimoto [Fri, 9 Jun 2023 01:40:41 +0000 (01:40 +0000)]
ASoC: audio-graph-card2-custom-sample: add missing CPU:Codec = 1:N sample

It has CPU:Codec = 1:1 and N:N samples, but missing 1:N settings.
This patch adds it.

One note here is that because of registering timing, probing and
CPU/Codec numbering are mismatching.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ilbx1kh3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Add IPC3 Kernel Injector
Curtis Malainey [Thu, 8 Jun 2023 22:18:16 +0000 (15:18 -0700)]
ASoC: SOF: Add IPC3 Kernel Injector

Add debugfs path to fake a malicious firmware message for fuzzing purposes.

Skip IPC4 for initial integration

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
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/20230608221822.2825786-2-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Refactor rx function for fuzzing
Curtis Malainey [Thu, 8 Jun 2023 22:18:15 +0000 (15:18 -0700)]
ASoC: SOF: Refactor rx function for fuzzing

Refactor the function so reading the data is done outside the work
function so fuzzing can pass data directly into the work callbacks.

Also expose the inner function outside the module so we can call it from
the injector.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
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/20230608221822.2825786-1-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8192-mt6359: Go back to old headphone pin name
Nícolas F. R. A. Prado [Thu, 8 Jun 2023 22:10:48 +0000 (18:10 -0400)]
ASoC: mediatek: mt8192-mt6359: Go back to old headphone pin name

This reverts commit cbbc0ec6dea09c ("ASoC: mediatek: mt8192-mt6359:
Remove " Jack" from Headphone pin name"). That commit removed the "
Jack" suffix with the reasoning that it is automatically added to the
name of the kcontrol created, which is true, but this name is also used
to look for the DAPM widget that will be toggled when the jack status is
updated. Since the widget is still called "Headphone Jack" the jack
can't link to the widget and the following error is shown:

mt8192_mt6359 sound: ASoC: DAPM unknown pin Headphone

It is not possible to also rename the headphone DAPM widget because its
name is used by a switch kcontrol, "Headphone Jack Switch", both to link
to the headphone widget and to assemble its name. This switch's name is
referenced in the upstream UCM file, so renaming it would break
userspace. Since the original commit didn't bring any benefit, besides
sparing a few CPU cycles, simply revert it.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20230608221050.217968-1-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: starfive: Remove some unused macros
Walker Chen [Thu, 8 Jun 2023 13:57:50 +0000 (21:57 +0800)]
ASoC: starfive: Remove some unused macros

These macros are unused and can be dropped.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230608135750.11041-3-walker.chen@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: starfive: Fix an error check in jh7110_tdm_clk_reset_get()
Walker Chen [Thu, 8 Jun 2023 13:57:49 +0000 (21:57 +0800)]
ASoC: starfive: Fix an error check in jh7110_tdm_clk_reset_get()

Fix the check for devm_reset_control_array_get_exclusive() return value.
The devm_reset_control_array_get_exclusive() function may return NULL if
it's an optional request. If optional is intended then NULL should not
be treated as an error case, but as a special kind of success case. So
here the IS_ERR() is used to check better.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230608135750.11041-2-walker.chen@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mt8188-mt6359: Cleanups
Mark Brown [Thu, 8 Jun 2023 15:07:32 +0000 (16:07 +0100)]
ASoC: mt8188-mt6359: Cleanups

Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:

This series performs some cleanups to the mt8188-mt6359 driver,
including usage of bitfield macros, adding definitions of register
fields and some others for readability and consistency.

17 months agoASoC: tegra: Simplify code around clk_get_rate() handling
Christophe JAILLET [Thu, 8 Jun 2023 05:27:22 +0000 (07:27 +0200)]
ASoC: tegra: Simplify code around clk_get_rate() handling

clk_get_rate() returns an unsigned long, so there is no point in storing it
in a long, and test for negative values.

So, turn 'parent_rate' into an unsigned long, simplify the sanity check,
the error message and the return value, in case of error (i.e. 0).

Doing so also turns 'i' and 'valid_rates' into unsigned long, but it is
fine and harmless.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/53f928290f08f50ff43031e17fe1d88443c2c441.1686202022.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: max98088: clean up some inconsistent indenting
Jiapeng Chong [Thu, 8 Jun 2023 07:55:40 +0000 (15:55 +0800)]
ASoC: max98088: clean up some inconsistent indenting

No functional modification involved.

sound/soc/codecs/max98088.c:316 m98088_eq_band() warn: inconsistent indenting.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5461
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230608075540.61575-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:27 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers

Replace open coded instances of FIELD_GET() with it, move register
definitions at the top of the file and also replace magic numbers
with register definitions.

While at it, also change a regmap_update_bits() call to regmap_write()
because the top 29 bits of AUD_TOP_CFG (31:3) are reserved (unused).

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-6-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188-mt6359: Clean up log levels
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:26 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Clean up log levels

Change some dev_info prints to dev_err() and some to dev_dbg(),
depending on the actual severity of them.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-5-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return ret
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:25 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return ret

Change all instances of `return ret` to `return 0` at the end of
functions where ret is always zero and also change functions
mt8188_{hdmi,dptx}_codec_init to be consistent with how other
functions are returning errors

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-4-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188-mt6359: clean up a return in codec_init
Dan Carpenter [Thu, 8 Jun 2023 08:47:24 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init

This code triggers a Smatch static checker warning and does sort of
look like an error path.

sound/soc/mediatek/mt8188/mt8188-mt6359.c:597 mt8188_max98390_codec_init() warn: missing error code? 'ret'

However, returning 0 is intentional.  Make that explicit.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-3-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
AngeloGioacchino Del Regno [Thu, 8 Jun 2023 08:47:23 +0000 (10:47 +0200)]
ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries

Those entries fit in one line: compress them to reduce line count.
While at it, also add the sentinel comment to the last entry.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230608084727.74403-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: stm32: fix dtbs_check warnings
Mark Brown [Wed, 7 Jun 2023 20:16:47 +0000 (21:16 +0100)]
ASoC: stm32: fix dtbs_check warnings

Merge series from Olivier Moysan <olivier.moysan@foss.st.com>:

Fix dtbs_check warnings in STM32MP15 DK boards Devices Trees for
STM32 I2S and Cirrus CS42L51 codec.

- Add OF graph port property in I2S and CS42L51 DT bindings.
  Fixes warnings:
  audio-controller@4000b000: Unevaluated properties are not allowed
  ('port' was unexpected)
  cs42l51@4a: Unevaluated properties are not allowed
  ('port' was unexpected)
- Correct OF graph DAI audio format property for STM32MP15x Dkx I2S node

17 months agoASoC: codecs: wsa883x: use existing define instead of raw value
Krzysztof Kozlowski [Wed, 7 Jun 2023 17:13:26 +0000 (19:13 +0200)]
ASoC: codecs: wsa883x: use existing define instead of raw value

Use existing define for WSA883X_GLOBAL_PA_ENABLE instead of hard-coded
value, just like in other places in this driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230607171326.179527-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: HDA: two cleanups
Mark Brown [Wed, 7 Jun 2023 17:22:08 +0000 (18:22 +0100)]
ASoC: Intel: HDA: two cleanups

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

One removal of a non-existent Kconfig initialization and one
correction to enable SoundWire link when no HDaudio external codec is
detected. This will generate more information and help resolve cases
where the ACPI information is incorrect.

17 months agoASoC: mediatek: mt8188-mt6359: add i2c dependency
Arnd Bergmann [Wed, 7 Jun 2023 12:08:15 +0000 (14:08 +0200)]
ASoC: mediatek: mt8188-mt6359: add i2c dependency

The newly added driver is missing this dependency, causing a possible
build failure:

WARNING: unmet direct dependencies detected for SND_SOC_MAX98390
WARNING: unmet direct dependencies detected for SND_SOC_NAU8825
  Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=m]
  Selected by [y]:
  - SND_SOC_MT8188_MT6359 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_MT8188 [=y] && MTK_PMIC_WRAP [=y]
aarch64-linux-ld: sound/soc/codecs/max98390.o: in function `max98390_i2c_probe':
max98390.c:(.text+0x514): undefined reference to `__devm_regmap_init_i2c'

Fixes: 9f08dcbddeb30 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230607120831.3587379-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Intel: hda-pcm: remove kernel parameter init
Pierre-Louis Bossart [Tue, 6 Jun 2023 22:25:29 +0000 (17:25 -0500)]
ASoC: SOF: Intel: hda-pcm: remove kernel parameter init

The 'hda_disable_rewinds' kernel parameter is initialized with a
non-existent CONFIG_SND_SOC_SOF_HDA_DISABLE_REWINDS.

We probably forgot to clean this up when this Kconfig option was
removed when upstreaming in 2021.

Reported-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230606222529.57156-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion
Pierre-Louis Bossart [Tue, 6 Jun 2023 22:25:28 +0000 (17:25 -0500)]
ASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion

The functionality described in Commit 61bef9e68dca ("ASoC: SOF: Intel: hda: enforce exclusion between HDaudio and SoundWire")
does not seem to be properly implemented with two issues that need to
be corrected.

a) The test used is incorrect when DisplayAudio codecs are not supported.

b) Conversely when only Display Audio codecs can be found, we do want
to start the SoundWire links, if any. That will help add the relevant
topologies and machine descriptors, and identify cases where the
SoundWire information in ACPI needs to be modified with a quirk.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230606222529.57156-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: add snd_soc_get_stream_cpu()
Kuninori Morimoto [Thu, 1 Jun 2023 00:42:49 +0000 (00:42 +0000)]
ASoC: add snd_soc_get_stream_cpu()

We are using get_stream_cpu() to get CPU stream which cares
Codec2Codec. But it is static function for now, and we want to use it
from other files. This patch makes it global function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs7cj9mf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: soc.h: remove snd_soc_compr_ops :: trigger
Kuninori Morimoto [Thu, 1 Jun 2023 00:43:02 +0000 (00:43 +0000)]
ASoC: soc.h: remove snd_soc_compr_ops :: trigger

ASoC framework is not using trigger call-back for snd_soc_compr_ops.
This patch remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edmwj9m1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: Intel: machine driver updates for 6.5
Mark Brown [Tue, 6 Jun 2023 15:41:59 +0000 (16:41 +0100)]
ASoC: Intel: machine driver updates for 6.5

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

An unusually large set of patches to deal with new SoundWire-based
platforms.

The bulk of the patches addresses support for MTL using RT712, RT713,
MAX98363, CS42L42 jack codec and amplifiers. The sof_sdw machine
driver had to be updated to remove limitations on number of codecs per
links, dai types, dai naming, etc. We also moved parts of the Realtek
and Maxim support in common code to avoid duplication.

Community users also reported two Dell SKUs which were not supported
in the mainline due to hardware permutations.

17 months agoASoC: dt-bindings: document audio of graph port for cs42l51
Olivier Moysan [Tue, 6 Jun 2023 11:56:03 +0000 (13:56 +0200)]
ASoC: dt-bindings: document audio of graph port for cs42l51

When linking the CS42L51 to another DAI component, according
to audio graph cards bindings, an OF graph port property is expected
in the node. Document the port property.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230606115605.1633595-3-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: dt-bindings: stm32: document audio of graph port for i2s
Olivier Moysan [Tue, 6 Jun 2023 11:56:02 +0000 (13:56 +0200)]
ASoC: dt-bindings: stm32: document audio of graph port for i2s

When linking the STM32 I2S to another DAI component, according
to audio graph cards bindings, an OF graph port property is expected
in the node. Document the port property.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230606115605.1633595-2-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: mt8188: add new board support
Mark Brown [Mon, 5 Jun 2023 17:29:36 +0000 (18:29 +0100)]
ASoC: mt8188: add new board support

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

In the series, we extend the capability of mt8188-mt6359 driver.

The following changes are included.
1. Divide ADDA BE dai into two dais for SOF.
2. Register hdmi/dp jack pins.
3. dai_fmt can be configured from device tree.
4. Add some I2S codecs support.

In addition, new compatible string "mediatek,mt8188-nau8825" is
included for a new board support.

17 months agoASoC: SOF: Intel: LunarLake preparation patches
Mark Brown [Mon, 5 Jun 2023 17:29:30 +0000 (18:29 +0100)]
ASoC: SOF: Intel: LunarLake preparation patches

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

This patchset adds the changes required for the hda-dai extension to
deal with SSSP/DMIC/SoundWire starting with LunarLake, as well as the
new TLV IPC to provide the DMA stream_tag to the DSP firmware.

LunarLake support for SSP/DMIC is ready but is gated by the patch
"ASoC: SOF: Intel: shim: add enum for ACE 2.0 IP used in LunarLake"
currently only present in the SoundWire tree.

17 months agofirmware: cs_dsp: Log correct region name in bin error messages
Richard Fitzgerald [Mon, 5 Jun 2023 14:32:38 +0000 (15:32 +0100)]
firmware: cs_dsp: Log correct region name in bin error messages

In cs_dsp_load_coeff() region_name should be set in the XM/YM/ZM
cases otherwise any errors will log the region as "Unknown".

While doing this also change one error message that logged the
region type ID to log the region_name instead. This makes it
consistent with other messages in the same function.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230605143238.4001982-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Intel: hda: add helper to extract SoundWire link count
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:20 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda: add helper to extract SoundWire link count

The register changed with the HDaudio integration, the information is
present in the extended link descriptor and not in the SHIM.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Intel: mtl: prepare for code reuse
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:19 +0000 (15:56 -0500)]
ASoC: SOF: Intel: mtl: prepare for code reuse

Some functions can be used for newer LNL hardware.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-topology: add DMA config TLV to IPC data
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:18 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: add DMA config TLV to IPC data

This patch adds a DMA config TLV structure and the relevant code to
copy this TLV after the gateway configuration. For now this is an
iso-functionality change, the TLVs are not configured just
yet. Additional patches will be needed for DMIC/SSP/ALH (aka
SoundWire).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-topology: introduce DMA config TLV
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:17 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: introduce DMA config TLV

Starting with LunarLake, the DMIC/SSP/SoundWire audio interfaces will
use the HDaudio DMA. This patch adds the DMA configuration structure
to be passed as a TLV appended at the end of each gateway
configuration.

This patch only provides the definitions for now, the TLV will be
added in the actual blobs separately for each interface.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: ipc4-topology: extend ALH-specific data structure
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:16 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: extend ALH-specific data structure

LunarLake introduces a new TLV blob passed to the firmware for DMA
configuration. This TLV structure is directly inspired by the ALH
multi-gateway structure used so far. This patch suggest a transition
to the more abstract structure with no references to ALH.

This is an iso-functionality redefinition of structure, the TLV will
be added in a follow-up patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
17 months agoASoC: SOF: Intel: hda-dai: add get_hlink callback
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:15 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add get_hlink callback

The existing code for HDAudio DAIs cannot be extended to other types
of DAIs, specific programming sequences need to be abstracted
away.

This patch hides the mechanism to determine the multi-link structure
related to the DAI and program the LOSIDV register. An added benefit
is that we can remove all references to the codec DAI from what should
be a CPU dai configuration only.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>