platform/kernel/linux-rpi.git
16 months agoASoC: amd: ps: add fix for dma irq mask for rx streams for SDW0 instance
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:50 +0000 (16:23 +0530)]
ASoC: amd: ps: add fix for dma irq mask for rx streams for SDW0 instance

Correct the DMA irq mask macro to program DMA irq bits correctly for
SDW0 instance rx streams.

Fixes: 298d4f7b1765 ("ASoC: amd: ps: add support for SoundWire DMA interrupts")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: add comments for DMA irq bits mapping
Vijendar Mukunda [Mon, 26 Jun 2023 10:53:49 +0000 (16:23 +0530)]
ASoC: amd: ps: add comments for DMA irq bits mapping

Add comments for DMA stream id and IRQ bit mapping in
ACP_EXTERNAL_CNTL & ACP_EXTERNAL_CNTL1 registers for
SDW0 and SDW1 manager instances.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: hdmi-codec: fix channel info for compressed formats
Matthias Reichl [Sat, 24 Jun 2023 16:52:32 +0000 (18:52 +0200)]
ASoC: hdmi-codec: fix channel info for compressed formats

According to CTA 861 the channel/speaker allocation info in the
audio infoframe only applies to uncompressed (PCM) audio streams.

The channel count info should indicate the number of channels
in the transmitted audio, which usually won't match the number of
channels used to transmit the compressed bitstream.

Some devices (eg some Sony TVs) will refuse to decode compressed
audio if these values are not set correctly.

To fix this we can simply set the channel count to 0 (which means
"refer to stream header") and set the channel/speaker allocation to 0
as well (which would mean stereo FL/FR for PCM, a safe value all sinks
will support) when transmitting compressed audio.

Signed-off-by: Matthias Reichl <hias@horus.com>
Link: https://lore.kernel.org/r/20230624165232.5751-1-hias@horus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: core: Always store of_node when getting DAI link component
Mark Brown [Fri, 23 Jun 2023 21:04:39 +0000 (22:04 +0100)]
ASoC: core: Always store of_node when getting DAI link component

The generic snd_soc_dai_get_dlc() contains a default translation function
for DAI names which has factored out common code in a number of card
drivers, resolving the dai_name and of_node either using a driver provided
translation function or with a generic implementation. Unfortunately the
of_node can't be set by the translation function since it currently doesn't
have an interface to do that but snd_soc_dai_get_dlc() only initialises the
of_node in the case where there is no translation function.

This breaks the Meson support after conversion to use the generic helpers
since the DPCM cards for it check which component of the SoC is connected
to each link by checking the compatible for the component and the Meson
components provide a custom operation so don't use the generic code.

Fix this and potentially other cards by unconditionally storing the node in
the dai_link_component, there shouldn't be a binding specific of_node
selected since that's how we determine the translation function.

Fixes: 2e1dbea1f8a3 ("ASoC: meson: use snd_soc_{of_}get_dlc()")
Fixes: 3c8b5861850c ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()")
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tas2781: Fix error code in tas2781_load_calibration()
Dan Carpenter [Fri, 23 Jun 2023 12:09:48 +0000 (15:09 +0300)]
ASoC: tas2781: Fix error code in tas2781_load_calibration()

Return -EINVAL instead of success on this error path.

Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: update pm_runtime enable sequence
Arun Gopal Kondaveeti [Fri, 23 Jun 2023 21:41:40 +0000 (03:11 +0530)]
ASoC: amd: update pm_runtime enable sequence

pm_runtime_allow() is not needed for ACP child platform devices.
Replace pm_runtime_allow() with pm_runtime_mark_last_busy()
& pm_runtime_set_active() in pm_runtime enable sequence for
ACP child platform drivers.

Signed-off-by: Arun Gopal <arungopal.kondaveeti@amd.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tas2781: fix Kconfig dependencies
Arnd Bergmann [Thu, 22 Jun 2023 10:11:23 +0000 (12:11 +0200)]
ASoC: tas2781: fix Kconfig dependencies

The new driver has two modules that both get enabled for build testing
when all codecs are selected. The comlib part has an i2c dependency,
so this remains disabled on builds without i2c, but then the other
one fails to link:

ERROR: modpost: "tasdevice_dev_bulk_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_update_bits" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_bulk_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!

There are many ways to address this, adding an explicit dependency seems
to be the clearest method that keeps the structure of the driver otherwise
unchanged.

Fixes: ef3bcde75d06d ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: acp: remove acp poweroff function
Syed Saba Kareem [Thu, 22 Jun 2023 15:23:41 +0000 (20:53 +0530)]
ASoC: amd: acp: remove acp poweroff function

BIOS invokes ACP Power off sequence based on ACP device state.
Remove redundant code from ACP PCI driver for ACP Power off sequence.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: acp: clear pdm dma interrupt mask
Syed Saba Kareem [Thu, 22 Jun 2023 15:23:38 +0000 (20:53 +0530)]
ASoC: amd: acp: clear pdm dma interrupt mask

Clear pdm dma interrupt mask in acp_dmic_shutdown().

'Fixes: c32bd332ce5c9 ("ASoC: amd: acp: Add generic support for
PDM controller on ACP")'

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: codecs: max98090: Allow dsp_a mode
Maxim Kochetkov [Thu, 22 Jun 2023 14:20:36 +0000 (17:20 +0300)]
ASoC: codecs: max98090: Allow dsp_a mode

TDM mode for max98090 is dsp_a compatible with such limitations:
1) Up to four timeslots supported.
2) Only 16 bits timeslots supported.
3) Only 2 active timeslots (L/R) supported.

We want to setup TDM mode only when dsp_a mode is selected. So move
M98090_REG_TDM_FORMAT/M98090_REG_TDM_CONTROL registers setup from
max98090_set_tdm_slot() to the max98090_dai_set_fmt(). Also extend
max98090_set_tdm_slot() with all TDM limitations check.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: qcom: common: add default jack dapm pins
Srinivas Kandagatla [Thu, 2 Mar 2023 12:03:27 +0000 (12:03 +0000)]
ASoC: qcom: common: add default jack dapm pins

If the soundcard does not specify the dapm pins, let the common
code add these pins for jack.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: loongson: fix address space confusion
Arnd Bergmann [Thu, 22 Jun 2023 10:12:22 +0000 (12:12 +0200)]
ASoC: loongson: fix address space confusion

The i2s driver uses the mapped __iomem address of the FIFO as the DMA
address for the device. This apparently works on loongarch because of
the way it handles __iomem pointers as aliases of physical addresses,
but this is not portable to other architectures and causes a compiler
warning when dma addresses are not the same size as pointers:

sound/soc/loongson/loongson_i2s_pci.c: In function 'loongson_i2s_pci_probe':
sound/soc/loongson/loongson_i2s_pci.c:110:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  110 |         tx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_TX_DATA;
      |                             ^
sound/soc/loongson/loongson_i2s_pci.c:113:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  113 |         rx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_RX_DATA;
      |                             ^

Change the driver to instead use the physical address as stored in the
PCI BAR resource directly. Since 'dev_addr' is a 32-bit address, I think
this results in the same truncated address on loongarch but is otherwise
closer to portable code and avoids the warning.

Fixes: d84881e06836d ("ASoC: Add support for Loongson I2S controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dt-bindings: microchip,sama7g5-pdmc: Simplify "microchip,mic-pos" constraints
Rob Herring [Wed, 21 Jun 2023 23:10:44 +0000 (17:10 -0600)]
ASoC: dt-bindings: microchip,sama7g5-pdmc: Simplify "microchip,mic-pos" constraints

"enum" values should be integers or strings, not arrays (though json-schema
does allow arrays, we do not). In this case, all possible combinations are
allowed anyways, so there's little point in expressing as an array.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tegra: Remove stale comments in AHUB
Sameer Pujar [Thu, 22 Jun 2023 11:34:14 +0000 (17:04 +0530)]
ASoC: tegra: Remove stale comments in AHUB

Remove stale comments in AHUB driver which is related to DAPM
widgets and routes. This is misleading otherwise.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tegra: Use normal system sleep for ASRC
Sameer Pujar [Thu, 22 Jun 2023 11:34:13 +0000 (17:04 +0530)]
ASoC: tegra: Use normal system sleep for ASRC

Align with other AHUB module drivers and use normal system
sleep for ASRC as well.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: fsl-asoc-card: Allow passing the number of slots in use
Fabio Estevam [Fri, 16 Jun 2023 20:39:13 +0000 (17:39 -0300)]
ASoC: fsl-asoc-card: Allow passing the number of slots in use

Currently, fsl-asoc-card supports passing the width of the TDM slot, but
not the number of slots in use, as it harcodes it as two slots.

Add support for passing the number of slots in use.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20230616203913.551183-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: codecs: wsa884x: Add WSA884x family of speakers
Krzysztof Kozlowski [Fri, 16 Jun 2023 11:57:51 +0000 (13:57 +0200)]
ASoC: codecs: wsa884x: Add WSA884x family of speakers

Add drivers for Qualcomm WSA8840/WSA8845/WSA8845H smart speaker
amplifiers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230616115751.392886-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dt-bindings: qcom,wsa8840: Add WSA884x family of speakers
Krzysztof Kozlowski [Fri, 16 Jun 2023 11:57:50 +0000 (13:57 +0200)]
ASoC: dt-bindings: qcom,wsa8840: Add WSA884x family of speakers

Add binding for WSA8840/WSA8845/WSA8845H smart speaker amplifiers used
in Qualcomm QRD8550 board with SM8550 SoC.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230616115751.392886-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: Intel: sof_rt5682: Add mtl support RT1019P speaker
Mac Chiang [Fri, 16 Jun 2023 06:36:17 +0000 (02:36 -0400)]
ASoC: Intel: sof_rt5682: Add mtl support RT1019P speaker

This patch support below hardware configuration:

SSP2: 10EC5682/RTL5682 codec
SSP0: RTL1019 amplifier

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20230616063617.25900-2-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: Intel: sof_rt5682: reorder quirk table
Terry Cheong [Fri, 16 Jun 2023 06:36:16 +0000 (02:36 -0400)]
ASoC: Intel: sof_rt5682: reorder quirk table

Reorder the entries in quirk table to group entries with same platform.

Signed-off-by: Terry Cheong <htcheong@chromium.org>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Link: https://lore.kernel.org/r/20230616063617.25900-1-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: Merge up fixes for CI
Mark Brown [Wed, 21 Jun 2023 00:32:31 +0000 (01:32 +0100)]
ASoC: Merge up fixes for CI

Some of the fixes merged should be relevant for my CI stability.

16 months agoASoC: amd: ps: add SoundWire support
Mark Brown [Tue, 20 Jun 2023 23:56:07 +0000 (00:56 +0100)]
ASoC: amd: ps: add SoundWire support

Merge series from Vijendar Mukunda <Vijendar.Mukunda@amd.com>:

This patch series add support for
- Platform device creation for SoundWire Manager instances and
  PDM controller.
- SoundWire DMA driver.
- Interrupt handling for SoundWire manager related interrupts,
  SoundWire DMA interrupts and ACP error interrupts.
- ACP PCI driver PM ops modification with respect to SoundWire
  Power modes.

16 months agoadd snd_soc_{of_}get_dlc()
Mark Brown [Tue, 20 Jun 2023 23:56:00 +0000 (00:56 +0100)]
add snd_soc_{of_}get_dlc()

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

Current soc-core.c has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component). It gets .dai_name, but we need
.of_node too. Therefor user need to arrange.

It will be more useful if it gets both .dai_name and .of_node.
This patch adds snd_soc_{of_}get_dlc() for it, and convert to use it.

16 months agoASoC: amd: ps: add acp_reset flag check in acp pci driver pm ops.
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:03 +0000 (15:29 +0530)]
ASoC: amd: ps: add acp_reset flag check in acp pci driver pm ops.

AMD SoundWire manager supports different power modes.
acp_reset flag will be set to false only when SoundWire manager power
mode is selected as ClockStop Mode. For rest of the combinations
(ACP PDM + SDW), acp_reset flag will be set to true.
When acp_reset flag is set, acp de-init and acp init sequence should
be invoked during suspend/resume callbacks.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: update comments in Kconfig file
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:02 +0000 (15:29 +0530)]
ASoC: amd: update comments in Kconfig file

Update comments in Kconfig file for Pink Sardine platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: enable SoundWire dma driver build
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:01 +0000 (15:29 +0530)]
ASoC: amd: ps: enable SoundWire dma driver build

Enable SoundWire dma driver build for PS platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: add pm ops support for SoundWire dma driver
Vijendar Mukunda [Mon, 12 Jun 2023 09:59:00 +0000 (15:29 +0530)]
ASoC: amd: ps: add pm ops support for SoundWire dma driver

Add support pm ops support for SoundWire dma driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: add support for SoundWire DMA interrupts
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:59 +0000 (15:28 +0530)]
ASoC: amd: ps: add support for SoundWire DMA interrupts

Move to request_threaded_irq and use thread for handling
SoundWire DMA interrupts.
Whenever audio data equal to the SoundWire FIFO watermark level
are produced/consumed, interrupt is generated.
Acknowledge the interrupt and wake up the irq thread.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: add SoundWire dma driver dma ops
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:58 +0000 (15:28 +0530)]
ASoC: amd: ps: add SoundWire dma driver dma ops

Add SoundWire DMA driver dma ops for Pink Sardine platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: add SoundWire dma driver
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:57 +0000 (15:28 +0530)]
ASoC: amd: ps: add SoundWire dma driver

SoundWire DMA platform driver binds to the platform device created by
ACP PCI device. SoundWire DMA driver registers ALSA DMA component
with ASoC framework.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: handle SoundWire interrupts in acp pci driver
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:56 +0000 (15:28 +0530)]
ASoC: amd: ps: handle SoundWire interrupts in acp pci driver

Handle SoundWire manager related interrupts in ACP PCI driver
interrupt handler and schedule SoundWire manager work queue for
further processing.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: amd: ps: create platform devices based on acp config
Vijendar Mukunda [Mon, 12 Jun 2023 09:58:55 +0000 (15:28 +0530)]
ASoC: amd: ps: create platform devices based on acp config

Based on ACP pin configuration and scanning child devices
under ACP pci device ACPI scope, platform device configuration
(pdev_config) and platform device count(pdev_count) will be
calculated.

Using pdev_config and pdev_count values, ACP PCI driver will
create platform devices for Pink Sardine platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230612095903.2113464-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tas2781: Fix spelling mistake "calibraiton" -> "calibration"
Colin Ian King [Tue, 20 Jun 2023 09:56:20 +0000 (10:56 +0100)]
ASoC: tas2781: Fix spelling mistake "calibraiton" -> "calibration"

There is a spelling mistake in a dev_err message. Fix it. Also fix
grammar and add space between last word and (%d)".

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20230620095620.2522058-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: qcom: audioreach: add compress offload
Mark Brown [Tue, 20 Jun 2023 14:24:06 +0000 (15:24 +0100)]
ASoC: qcom: audioreach: add compress offload

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

This patchset adds compressed offload support to Qualcomm audioreach drivers.
Currently it supports AAC, MP3 and FALC along with gapless.

Tested this on SM8450 and sc7280.

16 months agoASoC: Use maple tree register cache for Everest Semi
Mark Brown [Tue, 20 Jun 2023 14:23:56 +0000 (15:23 +0100)]
ASoC: Use maple tree register cache for Everest Semi

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

Several of the Everest Semi CODECs only support single register read and
write operations and therefore do not benefit from using the rbtree
cache over the maple tree cache, convert them to the more modern maple
tree cache.

16 months agoASoC: Convert Realtek I2C drivers to use maple tree
Mark Brown [Tue, 20 Jun 2023 14:23:47 +0000 (15:23 +0100)]
ASoC: Convert Realtek I2C drivers to use maple tree

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

Many of the Realtek I2C/SPI devices only support single register read
and write operations so don't benefit from using the rbtree cache
instead of the more modern maple tree cache, convert them to maple tree.

16 months agoASoC: simple-card.c: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:51 +0000 (02:14 +0000)]
ASoC: simple-card.c: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs6mdgmc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: soc-core.c: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:46 +0000 (02:14 +0000)]
ASoC: soc-core.c: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6r2dgmi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: loongson: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:40 +0000 (02:14 +0000)]
ASoC: loongson: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ilbidgmn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: samsung: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:35 +0000 (02:14 +0000)]
ASoC: samsung: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

- note: need deep check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jzvydgms.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: meson: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:30 +0000 (02:14 +0000)]
ASoC: meson: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87legedgmy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: qcom: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:24 +0000 (02:14 +0000)]
ASoC: qcom: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mt0udgn3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: fsl: use snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:18 +0000 (02:14 +0000)]
ASoC: fsl: use snd_soc_{of_}get_dlc()

Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7ladgn9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: soc-core.c: add index on snd_soc_of_get_dai_name()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:11 +0000 (02:14 +0000)]
ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()

Current snd_soc_of_get_dai_name() doesn't accept index
for #sound-dai-cells. It is not useful for user.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pm5qdgng.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: soc-core.c: add snd_soc_{of_}get_dlc()
Kuninori Morimoto [Tue, 20 Jun 2023 02:14:06 +0000 (02:14 +0000)]
ASoC: soc-core.c: add snd_soc_{of_}get_dlc()

Current soc-core.c has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component). It gets .dai_name, but we need
.of_node too. Therefor user need to arrange.

It will be more useful if it gets both .dai_name and .of_node.
This patch adds snd_soc_{of_}get_dlc() for it, and existing functions
uses it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0q6dgnm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dwc: don't assign addr_width for dt configs
Maxim Kochetkov [Tue, 13 Jun 2023 19:15:51 +0000 (22:15 +0300)]
ASoC: dwc: don't assign addr_width for dt configs

For proper DMA operation addr_width must corresponds with audio format
(S16, S24, S32, etc). Proper bus width calculations is performed by
snd_hwparams_to_dma_slave_config(). So drop wrong addr_width asignment
for dt configs and let snd_hwparams_to_dma_slave_config() do the job.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/20230613191552.724748-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dwc: add DMA handshake control
Maxim Kochetkov [Tue, 13 Jun 2023 19:19:08 +0000 (22:19 +0300)]
ASoC: dwc: add DMA handshake control

DMA mode uses hardware handshake signals. DMACR register is used to enable
the DMA Controller interface operation. So add DMA enable/disable to
i2s_start()/i2s_stop() functions if using DMA mode.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/20230613191910.725049-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: max98388: fix error code in probe()
Dan Carpenter [Mon, 19 Jun 2023 09:46:48 +0000 (12:46 +0300)]
ASoC: max98388: fix error code in probe()

This seems like a copy and paste bug.  Return the correct variable.
It should be "ret" instead of PTR_ERR(max98388->regmap).

Fixes: 6a8e1d46f062 ("ASoC: max98388: add amplifier driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/d44c8388-b12b-4045-95de-0d4bc7b428ac@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: loongson: change the type of variable irq to int
YingKun Meng [Mon, 19 Jun 2023 07:46:49 +0000 (15:46 +0800)]
ASoC: loongson: change the type of variable irq to int

We use variable 'irq' to store the return value of fwnode_get_irq_byname().
A negative value indicates that the operation failed. If the type of 'irq'
is unsigned int, we never know if the operation failed.

Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Closes: https://lore.kernel.org/loongarch/325dd825-6fa5-0ebc-4b7e-7acf2d2840e4@loongson.cn/
Signed-off-by: YingKun Meng <mengyingkun@loongson.cn>
Link: https://lore.kernel.org/r/20230619074649.3608726-1-mengyingkun@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dt-bindings: Add tas2781 amplifier
Shenghao Ding [Sun, 18 Jun 2023 12:28:19 +0000 (20:28 +0800)]
ASoC: dt-bindings: Add tas2781 amplifier

Create tas2781.yaml for tas2781 driver.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230618122819.23143-4-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tas2781: Add tas2781 driver
Shenghao Ding [Sun, 18 Jun 2023 12:28:18 +0000 (20:28 +0800)]
ASoC: tas2781: Add tas2781 driver

Create tas2781 driver.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Link: https://lore.kernel.org/r/20230618122819.23143-3-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tas2781: firmware lib
Shenghao Ding [Sun, 18 Jun 2023 12:28:17 +0000 (20:28 +0800)]
ASoC: tas2781: firmware lib

Create tas2781 firmware lib.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Link: https://lore.kernel.org/r/20230618122819.23143-2-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: tas2781: Add Header file for tas2781 driver
Shenghao Ding [Sun, 18 Jun 2023 12:28:16 +0000 (20:28 +0800)]
ASoC: tas2781: Add Header file for tas2781 driver

Create Header file for  tas2781 driver.

Signed-off-by: Shenghao Ding <13916275206@139.com>
Link: https://lore.kernel.org/r/20230618122819.23143-1-13916275206@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: loongson: fix error codes in loongson_card_parse_acpi()
Dan Carpenter [Mon, 19 Jun 2023 09:46:21 +0000 (12:46 +0300)]
ASoC: loongson: fix error codes in loongson_card_parse_acpi()

The acpi_node_get_property_reference() function returns kernel error
codes and not ACPI error codes.  So, although it does not affect the
compiled code, using the ACPI_FAILURE() macro is wrong.  Secondly,
if the is_acpi_device_node() function returns false, then we should
return -ENOENT instead of returning success.

Fixes: d24028606e76 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/fb14815d-2f9a-4b42-b193-cec61e7417ca@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: imx-audmix: check return value of devm_kasprintf()
Claudiu Beznea [Wed, 14 Jun 2023 12:15:09 +0000 (15:15 +0300)]
ASoC: imx-audmix: check return value of devm_kasprintf()

devm_kasprintf() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).

Fixes: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230614121509.443926-1-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: max98363: Remove cache defaults for volatile registers
Mark Brown [Fri, 9 Jun 2023 23:58:44 +0000 (00:58 +0100)]
ASoC: max98363: Remove cache defaults for volatile registers

The max98363 driver provides cache defaults for a number of volatile
registers. This is not meaningful, the cache values will never be used so
at best they will just consume memory and at worst they will be used in
preference to real values from the device, remove them.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-mx98363-volatile-v1-1-7acad55f5dd6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: q6apm-dai: Add mmap and copy compress DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:53 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add mmap and copy compress DAI callbacks

Add q6apm mmap and copy compress DAI callbacks to support compress
offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-12-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: q6apm-dai: Add compress set params and metadata DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:52 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add compress set params and metadata DAI callbacks

Add q6apm compress DAI callbacks for setting params and metadata to support
compress offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-11-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: q6apm-dai: Add trigger/pointer compress DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:51 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add trigger/pointer compress DAI callbacks

Add q6apm trigger and pointer compress DAI callbacks to support
compress offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: q6apm-dai: Add compress DAI and codec caps get callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:50 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add compress DAI and codec caps get callbacks

Add q6apm get compress DAI capabilities and codec capabilities callbacks
to support compress offload playback.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: q6apm-dai: Add open/free compress DAI callbacks
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:49 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm-dai: Add open/free compress DAI callbacks

Add q6apm open and free compress DAI callbacks to support compress
offload playback.
Include compress event handler callback also.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: audioreach: Add gapless feature support
Mohammad Rafi Shaik [Mon, 19 Jun 2023 10:16:48 +0000 (11:16 +0100)]
ASoC: q6dsp: audioreach: Add gapless feature support

Add support for setting EOS delay command and receive the
EOS response from ADSP, for seamless compress offload
playback feature.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: audioreach: Add support to set compress format params
Mohammad Rafi Shaik [Mon, 19 Jun 2023 10:16:47 +0000 (11:16 +0100)]
ASoC: q6dsp: audioreach: Add support to set compress format params

Add function for setting compress params.

Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: audioreach: Add placeholder decoder for compress playback
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:46 +0000 (11:16 +0100)]
ASoC: q6dsp: audioreach: Add placeholder decoder for compress playback

Add placeholder decoder graph module for compressed playback feature.

Co-developed-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: audioreach: add helper function to set u32 param
Srinivas Kandagatla [Mon, 19 Jun 2023 10:16:45 +0000 (11:16 +0100)]
ASoC: q6dsp: audioreach: add helper function to set u32 param

Some of the Audioreach commands take a u32 value,
ex: PARAM_ID_MODULE_ENABLE.

It makes more sense to provide a helper function so that other new
commands can reuse this.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: q6dsp: q6apm: add end of stream events
Mohammad Rafi Shaik [Mon, 19 Jun 2023 10:16:44 +0000 (11:16 +0100)]
ASoC: q6dsp: q6apm: add end of stream events

EOS event from dsp is currently not sent to the dai drivers, add the
missing callback.

Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: qcom: SC7280: audioreach: Add sc7280 hardware param fixup callback
Mohammad Rafi Shaik [Mon, 19 Jun 2023 10:16:43 +0000 (11:16 +0100)]
ASoC: qcom: SC7280: audioreach: Add sc7280 hardware param fixup callback

Add support to set backend params such as sampling rate and
number of channels using backend params fixup callback.
Also add no pcm check for hardware params constraints setting.

Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230619101653.9750-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5682: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:58:02 +0000 (14:58 +0100)]
ASoC: rt5682: Use maple tree register cache

The rt5682 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-16-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5670: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:58:01 +0000 (14:58 +0100)]
ASoC: rt5670: Use maple tree register cache

The rt5670 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-15-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5668: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:58:00 +0000 (14:58 +0100)]
ASoC: rt5668: Use maple tree register cache

The rt5668 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-14-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5665: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:59 +0000 (14:57 +0100)]
ASoC: rt5665: Use maple tree register cache

The rt5665 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-13-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5665: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:58 +0000 (14:57 +0100)]
ASoC: rt5665: Use maple tree register cache

The rt5663 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-12-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5660: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:57 +0000 (14:57 +0100)]
ASoC: rt5660: Use maple tree register cache

The rt5660 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-11-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5651: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:56 +0000 (14:57 +0100)]
ASoC: rt5651: Use maple tree register cache

The rt5651 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-10-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5645: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:55 +0000 (14:57 +0100)]
ASoC: rt5645: Use maple tree register cache

The rt5645 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-9-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5640: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:54 +0000 (14:57 +0100)]
ASoC: rt5640: Use maple tree register cache

The rt5640 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-8-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5631: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:53 +0000 (14:57 +0100)]
ASoC: rt5631: Use maple tree register cache

The rt5631 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-7-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5616: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:52 +0000 (14:57 +0100)]
ASoC: rt5616: Use maple tree register cache

The rt5616 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-6-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5514: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:51 +0000 (14:57 +0100)]
ASoC: rt5514: Use maple tree register cache

The rt5514 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-5-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt1308: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:50 +0000 (14:57 +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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-4-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt1305: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:49 +0000 (14:57 +0100)]
ASoC: rt1305: Use maple tree register cache

The rt1305 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-3-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt1019: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:48 +0000 (14:57 +0100)]
ASoC: rt1019: Use maple tree register cache

The rt1019 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-2-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt1011: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 13:57:47 +0000 (14:57 +0100)]
ASoC: rt1011: Use maple tree register cache

The rt1011 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-1-729c6553cdcf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: es8328: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 11:16:38 +0000 (12:16 +0100)]
ASoC: es8328: Use maple tree register cache

The es8328 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-es-maple-v1-2-45ada77f5643@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: es8316: Use maple tree register cache
Mark Brown [Sat, 10 Jun 2023 11:16:37 +0000 (12:16 +0100)]
ASoC: es8316: Use maple tree register cache

The es8316 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-asoc-es-maple-v1-1-45ada77f5643@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: intel: sof_sdw: Fixup typo in device link checking
Charles Keepax [Wed, 14 Jun 2023 14:21:16 +0000 (15:21 +0100)]
ASoC: intel: sof_sdw: Fixup typo in device link checking

The loop checking for multiple different devices on a single sdw link
contains a typo accidentally using i twice instead of j. Correct to the
correct index variable.

Fixes: dc5a3e60a4b5 ("ASoC: Intel: sof_sdw: append codec type to dai link name")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230614142116.1059677-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: bindings: fsl-asoc-card: add compatible string for nau8822 codec
Hui Wang [Thu, 16 Jun 2022 04:00:46 +0000 (12:00 +0800)]
ASoC: bindings: fsl-asoc-card: add compatible string for nau8822 codec

The nau8822 codec is used on an imx6sx EVB.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: fsl-asoc-card: add nau8822 support
Hui Wang [Thu, 16 Jun 2022 04:00:45 +0000 (12:00 +0800)]
ASoC: fsl-asoc-card: add nau8822 support

This is for an imx6sx EVB which has a nau8822 codec connects to the
SSI2 interface, so add the nau8822 support in this machine driver.

Because the codec driver nau8822.c doesn't handle mclk enabling, here
adding a codec_priv->mclk for nau8822 and similar codecs which need to
enable the mclk in the machine driver, and enable the mclk in the
card_late_probe() conditionally.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: max98388: set variable soc_codec_dev_max98388 storage-class-specifier to static
Tom Rix [Sat, 17 Jun 2023 12:26:35 +0000 (08:26 -0400)]
ASoC: max98388: set variable soc_codec_dev_max98388 storage-class-specifier to static

smatch reports
sound/soc/codecs/max98388.c:890:39: warning: symbol
  'soc_codec_dev_max98388' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: SOF: misc updates for 6.5
Mark Brown [Fri, 16 Jun 2023 16:16:21 +0000 (17:16 +0100)]
ASoC: SOF: misc updates for 6.5

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

Couple of improvements on virtual_widget support, firmware trace free,
IPC payload dump, duplicated code in suspend and MeteorLake primary
code support.

16 months agoASoC: codecs: wm0010: Add MODULE_FIRMWARE macros
Juerg Haefliger [Fri, 16 Jun 2023 11:54:32 +0000 (13:54 +0200)]
ASoC: codecs: wm0010: Add MODULE_FIRMWARE macros

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

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230616115432.1011707-1-juerg.haefliger@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: rt5677: Add MODULE_FIRMWARE macro
Juerg Haefliger [Fri, 16 Jun 2023 11:55:49 +0000 (13:55 +0200)]
ASoC: rt5677: 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/20230616115549.1011903-1-juerg.haefliger@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: dt-bindings: tlv320aic32x4: convert to DT schema format
Alexander Stein [Fri, 16 Jun 2023 08:35:49 +0000 (10:35 +0200)]
ASoC: dt-bindings: tlv320aic32x4: convert to DT schema format

Convert the binding to DT schema format.
Since commit 514b044cba667 ("ASoC: tlv320aic32x4: Model PLL in CCF")
clocks & clock-names = "mclk" is mandatory, it has been added to required
properties as well. '#sound-dai-cells' is added for reference from
simple-audio-card.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230616083549.2331830-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
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: SOF: Intel: mtl: setup primary core info on MeteorLake platform
Rander Wang [Fri, 16 Jun 2023 10:00:39 +0000 (12:00 +0200)]
ASoC: SOF: Intel: mtl: setup primary core info on MeteorLake platform

Set primary core mask and refcount.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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/20230616100039.378150-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 months agoASoC: SOF: pm: Remove duplicated code in sof_suspend
Peter Ujfalusi [Fri, 16 Jun 2023 10:00:38 +0000 (12:00 +0200)]
ASoC: SOF: pm: Remove duplicated code in sof_suspend

Over time the function has changed and now there is no need to have the
duplicated sof_fw_trace_suspend() and sof_suspend_clients() in the
if (target_state == SOF_DSP_PM_D0) branch.

Remove it and add a simple check with a single goto statement.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Paul Olaru <olarupaulstelian97@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230616100039.378150-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>