linux-block.git
3 months agoASoC: dapm: Use ASoC control macros where possible
Charles Keepax [Mon, 3 Mar 2025 17:14:22 +0000 (17:14 +0000)]
ASoC: dapm: Use ASoC control macros where possible

Update the DAPM kcontrol creation macros to use the ASoC macros where a
helpful version exists. One minor fixup is required in adau17x1, the
compiler doesn't like the extra level of macro indirection coupled with
the inline struct definition. Make the struct definition explicit.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-12-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dapm: Add missing SOC_DAPM_DOUBLE_R_TLV() helper
Charles Keepax [Mon, 3 Mar 2025 17:14:21 +0000 (17:14 +0000)]
ASoC: dapm: Add missing SOC_DAPM_DOUBLE_R_TLV() helper

A few drivers are open coding SOC_DAPM_DOUBLE_R_TLV() add a core
helper and use that instead.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-11-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: atmel: tse850-pcm5142: Use SOC_SINGLE_EXT() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:20 +0000 (17:14 +0000)]
ASoC: atmel: tse850-pcm5142: Use SOC_SINGLE_EXT() helper macro

The TSE850_DAPM_SINGLE_EXT() macro is an identical duplicate of the
core SOC_SINGLE_EXT() marco. Use the macro provided by the core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-10-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: wsa881x: Use SOC_SINGLE_EXT_TLV() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:19 +0000 (17:14 +0000)]
ASoC: wsa881x: Use SOC_SINGLE_EXT_TLV() helper macro

Rather than open coding use the helper macro provided by the ASoC core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-9-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: wm9713: Use SOC_DOUBLE_EXT() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:18 +0000 (17:14 +0000)]
ASoC: wm9713: Use SOC_DOUBLE_EXT() helper macro

Rather than open coding use the helper macro provided by the ASoC core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-8-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: wm9712: Use SOC_SINGLE_EXT() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:17 +0000 (17:14 +0000)]
ASoC: wm9712: Use SOC_SINGLE_EXT() helper macro

Rather than open coding use the helper macro provided by the ASoC core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: wcd938x: Use SOC_SINGLE_EXT_TLV() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:16 +0000 (17:14 +0000)]
ASoC: wcd938x: Use SOC_SINGLE_EXT_TLV() helper macro

Rather than open coding use the helper macro provided by the ASoC core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: tas2562: Use SOC_SINGLE_EXT_TLV() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:15 +0000 (17:14 +0000)]
ASoC: tas2562: Use SOC_SINGLE_EXT_TLV() helper macro

Rather than open coding use the helper macro provided by the ASoC core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: sma1307: Use SOC_SINGLE_EXT() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:14 +0000 (17:14 +0000)]
ASoC: sma1307: Use SOC_SINGLE_EXT() helper macro

Rather than open coding use the helper macro provided by the ASoC core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: rt715: Remove duplicate SOC_DOUBLE_R_EXT() helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:13 +0000 (17:14 +0000)]
ASoC: rt715: Remove duplicate SOC_DOUBLE_R_EXT() helper macro

The rt715 does not appear to use the SOC_DOUBLE_R_EXT() macro and even
if it did, the macro is defined identically in the ASoC headers.
Remove the redundant macro definitions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Remove unused helper macro
Charles Keepax [Mon, 3 Mar 2025 17:14:12 +0000 (17:14 +0000)]
ASoC: Remove unused helper macro

SOC_SINGLE_VALUE_EXT() has no users, so remove it.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoConvert sound drivers to use devm_kmemdup_array()
Mark Brown [Fri, 28 Feb 2025 16:33:23 +0000 (16:33 +0000)]
Convert sound drivers to use devm_kmemdup_array()

Merge series from Raag Jadav <raag.jadav@intel.com>:

This series converts sound drivers to use the newly introduced[1]
devm_kmemdup_array() helper.

[1] https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com

3 months agoASoC: uniphier: use devm_kmemdup_array()
Raag Jadav [Fri, 28 Feb 2025 06:28:12 +0000 (11:58 +0530)]
ASoC: uniphier: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-7-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
Raag Jadav [Fri, 28 Feb 2025 06:28:11 +0000 (11:58 +0530)]
ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-6-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: uda1380: use devm_kmemdup_array()
Raag Jadav [Fri, 28 Feb 2025 06:28:10 +0000 (11:58 +0530)]
ASoC: uda1380: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-5-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: tlv320dac33: use devm_kmemdup_array()
Raag Jadav [Fri, 28 Feb 2025 06:28:09 +0000 (11:58 +0530)]
ASoC: tlv320dac33: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-4-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: hdac_hdmi: use devm_kmemdup_array()
Raag Jadav [Fri, 28 Feb 2025 06:28:08 +0000 (11:58 +0530)]
ASoC: hdac_hdmi: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20250228062812.150004-3-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: use devm_kmemdup_array()
Raag Jadav [Fri, 28 Feb 2025 06:28:07 +0000 (11:58 +0530)]
ASoC: Intel: avs: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250228062812.150004-2-raag.jadav@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoAdd SDCA register map support
Mark Brown [Thu, 27 Feb 2025 16:44:41 +0000 (16:44 +0000)]
Add SDCA register map support

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

This series is the next step of adding SDCA support. Here we add
helper functions to allow drivers to easily use the SDCA DisCo
information to create a register map for the device.

The basic idea here is the code takes the list of SDCA controls parsed
from DisCo and uses primarily the Access Mode to determine if the
register should be marked as readable/writable etc. Further more
some additional concepts such as DisCo Constants and Defaults are
handled. There is some potential confusion, as DisCo Constants are
handled as an entry in the regmap defaults table, whereas a DisCo
Default is simply handled as a write to the register. Alas the naming
confusion is an unavoidable result of the slight impedance mismatch
between the two systems.

3 months agoASoC: mediatek: mt8188: avoid uninitialized variable use
Arnd Bergmann [Thu, 27 Feb 2025 13:19:01 +0000 (14:19 +0100)]
ASoC: mediatek: mt8188: avoid uninitialized variable use

The 'msk' variable has no initialization:

sound/soc/mediatek/mt8188/mt8188-dai-dmic.c:311:4: error: variable 'msk' is uninitialized when used here [-Werror,-Wuninitialized]
  311 |                         msk |= PWR2_TOP_CON1_DMIC_FIFO_SOFT_RST_EN(i);
      |                         ^~~

Set it to zero before the loop.

Fixes: c1e42ec04197 ("ASoC: mediatek: mt8188: Add support for DMIC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://patch.msgid.link/20250227131939.1040168-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SDCA: Add helper to write out defaults and fixed values
Charles Keepax [Mon, 17 Feb 2025 14:01:59 +0000 (14:01 +0000)]
ASoC: SDCA: Add helper to write out defaults and fixed values

The concept of an SDCA default value differs slightly from the regmap
usage of the term. An SDCA default is a value that is parsed from DisCo
and then written out to the hardware if no user value has superceded
it. Add a helper function that will iterate through all the SDCA
Controls and write out any default values. After these have been written
out once they will exist in the cache and that will take care of any
user values superceeding them. The code here also writes out any
Controls with a fixed value as there is only one available value for
these Controls there is no point in allowing the user to select them,
simply treat them similarly to a default.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250217140159.2288784-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SDCA: Add regmap helpers for parsing for DisCo Constant values
Charles Keepax [Mon, 17 Feb 2025 14:01:58 +0000 (14:01 +0000)]
ASoC: SDCA: Add regmap helpers for parsing for DisCo Constant values

Add helpers to parse the DisCo Constant values from ACPI and populate an
array of reg_defaults with these. This will allow drivers to access
these ACPI specified values through the same interface as other
registers that are physically present on the device, using the regmap
cache.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250217140159.2288784-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SDCA: Add generic regmap SDCA helpers
Charles Keepax [Mon, 17 Feb 2025 14:01:57 +0000 (14:01 +0000)]
ASoC: SDCA: Add generic regmap SDCA helpers

Add helper functions that SDCA drivers can use to calculate the
properties of SDCA Controls (registers) specified through DisCo.
Most of these are fairly obvious from the SDCA Access Modes.

DisCo Constants, values which are specified in the ACPI rather than on
the device, are handled as unreadable and unwritable registers. The
intention is these will be populated in the register defaults table
allowing drivers to read them normally. This means the drivers can be
agnostic as to which values are DisCo Constants.

Finally, support for SDCA Dual Ranked Controls is currently limited
here, at the moment the current value will be used directly. Writing
the current value directly is valid as per the specification
although the synchronicity of updates across multiple registers is
lost. Support for this will probably need to be added later. But its a
fairly hard problem and doesn't need to be solved immediately.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250217140159.2288784-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoregcache: Add support for sorting defaults arrays
Charles Keepax [Mon, 17 Feb 2025 14:01:56 +0000 (14:01 +0000)]
regcache: Add support for sorting defaults arrays

The defaults array in regcache must be sorted into ascending register
address order, because binary search is used to locate values in
the array. Add a helper to sort the register defaults array which
can be useful for systems that dynamically create a defaults array
based on external information.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250217140159.2288784-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoxlnx: dt-bindings: Convert to json-schema
Mark Brown [Wed, 26 Feb 2025 20:05:48 +0000 (20:05 +0000)]
xlnx: dt-bindings: Convert to json-schema

Merge series from Vincenzo Frascino <vincenzo.frascino@arm.com>:

This series converts the folling Xilinx device tree binding documentation:
 - xlnx,i2s
 - xlnx,audio-formatter
 - xlnx,spdif
to json-schema.

Note: These bindings are required for future work on the ARM Morello
Platforms device tree.

3 months agoASoC: tas2781: Clean up for some define
Baojun Xu [Wed, 26 Feb 2025 14:43:28 +0000 (22:43 +0800)]
ASoC: tas2781: Clean up for some define

Do some clean up for some define in header file.
Like change lower case in value, up case in define,
space add in recommends, change date of files and add author.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>
Link: https://patch.msgid.link/20250226144328.11645-1-baojun.xu@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoMAINTAINERS: Add Vincenzo Frascino as Xilinx Sound Driver Maintainer
Vincenzo Frascino [Wed, 26 Feb 2025 12:23:25 +0000 (12:23 +0000)]
MAINTAINERS: Add Vincenzo Frascino as Xilinx Sound Driver Maintainer

Add Vincenzo Frascino <vincenzo.frascino@arm.com> as Xilinx Sound Driver
Maintainer.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://patch.msgid.link/20250226122325.2014547-5-vincenzo.frascino@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: xlnx,spdif: Convert to json-schema
Vincenzo Frascino [Wed, 26 Feb 2025 12:23:24 +0000 (12:23 +0000)]
ASoC: dt-bindings: xlnx,spdif: Convert to json-schema

Convert the Xilinx SPDIF 2.0 device tree binding documentation to
json-schema.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://patch.msgid.link/20250226122325.2014547-4-vincenzo.frascino@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: xlnx,audio-formatter: Convert to json-schema
Vincenzo Frascino [Wed, 26 Feb 2025 12:23:23 +0000 (12:23 +0000)]
ASoC: dt-bindings: xlnx,audio-formatter: Convert to json-schema

Convert the Xilinx Audio Formatter 1.0  device tree binding documentation
to json-schema.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://patch.msgid.link/20250226122325.2014547-3-vincenzo.frascino@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: xlnx,i2s: Convert to json-schema
Vincenzo Frascino [Wed, 26 Feb 2025 12:23:22 +0000 (12:23 +0000)]
ASoC: dt-bindings: xlnx,i2s: Convert to json-schema

Convert the Xilinx I2S device tree binding documentation to json-schema.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://patch.msgid.link/20250226122325.2014547-2-vincenzo.frascino@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: rt712-sdca: Add FU05 playback switch control
Shuming Fan [Wed, 26 Feb 2025 08:47:28 +0000 (16:47 +0800)]
ASoC: rt712-sdca: Add FU05 playback switch control

Because there is no playback switch control for rt712-sdw headphone endpoint,
it causes there is no way to control HP on and off in ALSA UCM config.

Signed-off-by: derek.fang <derek.fang@realtek.com>
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20250226084728.1889082-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoEnable DMIC for Genio 700/510 EVK
Mark Brown [Tue, 25 Feb 2025 17:36:15 +0000 (17:36 +0000)]
Enable DMIC for Genio 700/510 EVK

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

This series enables the dual digital microphones present on the Genio
700 and 510 EVK boards.

3 months agoASoC: dt-bindings: fsl: Reference common DAI
Mark Brown [Tue, 25 Feb 2025 15:35:03 +0000 (15:35 +0000)]
ASoC: dt-bindings: fsl: Reference common DAI

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

Reference common DAI properties for fsl,easrc and fsl,imx-asrc

3 months agoASoC: Intel: avs: Mute and multi-channel controls
Mark Brown [Tue, 25 Feb 2025 15:23:45 +0000 (15:23 +0000)]
ASoC: Intel: avs: Mute and multi-channel controls

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

Note: the patchset DOES provide functional changes to the ASoC
framework.

Current kcontrols loaded with ASoC topology allow for mono or stereo
configuration only. To expand this and provide support to up to 8
channels, first address the limitations found within the ASoC core and
then update the user (avs-driver) so that it can utilize these new
functionality. The 8 channels max stems from SND_SOC_TPLG_MAX_CHAN
constant which is part of UAPI - asoc.h.

For the ASoC side, two changes are made:

- drop the ambiguous usage of ops.info when determining the kcontrol
  type
- save the num_channels value which is already part of the ALSA-topology
  but is currently skipped by ASoC core when loading mixer controls

For the avs-driver side, merge PEAKVOL IPCs as there is basically no
difference between the handles and then do the same with the control
operations. The merge for the latter is done is two steps: first provide
new implementation which honors the multi-channel controls and then move
to it while dropping the now-duplicated code.

Amadeusz Sławiński (2):
  ASoC: Intel: avs: Add volume control for GAIN module
  ASoC: Intel: avs: Add support for mute for PEAKVOL and GAIN

Cezary Rojewski (8):
  ASoC: topology: Create kcontrols based on their type
  ASoC: topology: Save num_channels value for mixer controls
  ASoC: Intel: avs: Make PEAKVOL configurable from topology
  ASoC: Intel: avs: Update VOLUME and add MUTE IPCs
  ASoC: Intel: avs: New volume control operations
  ASoC: Intel: avs: Move to the new control operations
  ASoC: Intel: avs: Honor the invert flag for mixer controls
  ASoC: Intel: avs: Support multi-channel PEAKVOL instantiation

 include/sound/soc.h                   |   1 +
 include/uapi/sound/intel/avs/tokens.h |   4 +
 sound/soc/intel/avs/control.c         | 180 ++++++++++++++++++++------
 sound/soc/intel/avs/control.h         |  12 +-
 sound/soc/intel/avs/messages.c        | 111 +++++++++++++++-
 sound/soc/intel/avs/messages.h        |  24 +++-
 sound/soc/intel/avs/path.c            | 108 ++++++++++++++--
 sound/soc/intel/avs/path.h            |   5 +
 sound/soc/intel/avs/topology.c        |  47 ++++++-
 sound/soc/intel/avs/topology.h        |   5 +
 sound/soc/soc-topology.c              |  55 +++-----
 11 files changed, 440 insertions(+), 112 deletions(-)

--
2.25.1

3 months agoASoC: imx-card: support playback or capture only
Mark Brown [Tue, 25 Feb 2025 15:23:41 +0000 (15:23 +0000)]
ASoC: imx-card: support playback or capture only

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

Be similar to audio graph card, support playback or capture only for
imx-audio-card.

imx-card can't directly refer to audio-graph-port.yaml, because it is
not based on 'ports'. Add playback-only and capture-only property
directly

3 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: Add DMIC backend to dai-link
Nícolas F. R. A. Prado [Tue, 25 Feb 2025 14:33:53 +0000 (11:33 -0300)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: Add DMIC backend to dai-link

MT8188 platforms also have DMIC DAIs, which were previously undescribed.
Add DMIC_BE as a possible backend for the dai-link property.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250225-genio700-dmic-v2-7-3076f5b50ef7@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: mediatek: mt8188-mt6359: Add DMIC support
Nícolas F. R. A. Prado [Tue, 25 Feb 2025 14:33:51 +0000 (11:33 -0300)]
ASoC: mediatek: mt8188-mt6359: Add DMIC support

Add the DMIC backend, which connects to the DMIC DAI in the platform
driver, as well as a "AP DMIC" mic widget. On the Genio 700 EVK board
the dual DMIC on-board are wired through that DMIC DAI.

Co-developed-by: parkeryang <Parker.Yang@mediatek.com>
Signed-off-by: parkeryang <Parker.Yang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://patch.msgid.link/20250225-genio700-dmic-v2-5-3076f5b50ef7@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: mediatek: mt8188: Add support for DMIC
parkeryang [Tue, 25 Feb 2025 14:33:50 +0000 (11:33 -0300)]
ASoC: mediatek: mt8188: Add support for DMIC

Add support for the DMIC DAIs present on the MT8188 SoC. To achieve
that, add a DAI driver for DMIC and register it during probe, and
describe the AFE routes that connect the DMIC (I004-I011) to the UL9
frontend (O002-O009).

Signed-off-by: parkeryang <Parker.Yang@mediatek.com>
Co-developed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250225-genio700-dmic-v2-4-3076f5b50ef7@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile
Nícolas F. R. A. Prado [Tue, 25 Feb 2025 14:33:49 +0000 (11:33 -0300)]
ASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile

The DMIC_GAINx_CUR registers contain the current (as in present) gain of
each DMIC. During capture, this gain will ramp up until a target value
is reached, and therefore the register is volatile since it is updated
automatically by hardware.

However, after capture the register's value returns to the value that
was written to it. So reading these registers returns the current gain,
and writing configures the initial gain for every capture.

>From an audio configuration perspective, reading the instantaneous gain
is not really useful. Instead, reading back the initial gain that was
configured is the desired behavior. For that reason, consider the
DMIC_GAINx_CUR registers as non-volatile, so the regmap's cache can be
used to retrieve the values, rather than requiring pm runtime resuming
the device.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250225-genio700-dmic-v2-3-3076f5b50ef7@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: mediatek: mt8188: Add reference for dmic clocks
Nícolas F. R. A. Prado [Tue, 25 Feb 2025 14:33:48 +0000 (11:33 -0300)]
ASoC: mediatek: mt8188: Add reference for dmic clocks

Add the names for the dmic clocks, aud_afe_dmic* and aud_dmic_hires*, so
they can be acquired and enabled by the platform driver.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250225-genio700-dmic-v2-2-3076f5b50ef7@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: mediatek: mt8188: Add audsys hires clocks
Nícolas F. R. A. Prado [Tue, 25 Feb 2025 14:33:47 +0000 (11:33 -0300)]
ASoC: mediatek: mt8188: Add audsys hires clocks

Describe and register the aud_dmic_hires audsys clocks, which are needed
when recording the DMIC at a sample rate of 96k.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250225-genio700-dmic-v2-1-3076f5b50ef7@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: fsl,imx-asrc: Reference common DAI properties
Shengjiu Wang [Mon, 24 Feb 2025 09:04:13 +0000 (17:04 +0800)]
ASoC: dt-bindings: fsl,imx-asrc: Reference common DAI properties

Reference the dai-common.yaml schema to allow '#sound-dai-cells' and
"sound-name-prefix' to be used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250224090413.727911-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: fsl,easrc: Reference common DAI properties
Shengjiu Wang [Mon, 24 Feb 2025 09:04:12 +0000 (17:04 +0800)]
ASoC: dt-bindings: fsl,easrc: Reference common DAI properties

Reference the dai-common.yaml schema to allow '#sound-dai-cells' and
"sound-name-prefix' to be used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250224090413.727911-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: acp70: Remove unnecessary if-check
Thorsten Blum [Mon, 24 Feb 2025 22:12:12 +0000 (23:12 +0100)]
ASoC: amd: acp: acp70: Remove unnecessary if-check

Since list_for_each_entry() expects the list to not be empty, the
iterator variable cannot be NULL and the unnecessary if-check can be
removed. Remove it and indent the code accordingly.

Compile-tested only.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250224221214.199849-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: q6dsp: q6apm: replace kzalloc() with kcalloc() in q6apm_map_memory_regions()
Ethan Carter Edwards [Sat, 22 Feb 2025 19:55:20 +0000 (14:55 -0500)]
ASoC: q6dsp: q6apm: replace kzalloc() with kcalloc() in q6apm_map_memory_regions()

We are trying to get rid of all multiplications from allocation
functions to prevent integer overflows[1]. Here the multiplication is
obviously safe, but using kcalloc() is more appropriate and improves
readability. This patch has no effect on runtime behavior.

Link: https://github.com/KSPP/linux/issues/162
Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20250222-q6apm-kcalloc-v1-1-6f09dae6c31c@ethancedwards.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: sh: migor: use inclusive language for SND_SOC_DAIFMT_CBx_CFx
Kuninori Morimoto [Wed, 19 Feb 2025 01:19:21 +0000 (01:19 +0000)]
ASoC: sh: migor: use inclusive language for SND_SOC_DAIFMT_CBx_CFx

In SND_SOC_DAIFMT_CBx_CFx, M/S are no longer used. use P/C.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87h64qvihz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: ti: rx51: use inclusive language for SND_SOC_DAIFMT_CBx_CFx
Kuninori Morimoto [Wed, 19 Feb 2025 01:19:31 +0000 (01:19 +0000)]
ASoC: ti: rx51: use inclusive language for SND_SOC_DAIFMT_CBx_CFx

In SND_SOC_DAIFMT_CBx_CFx, M/S are no longer used. use P/C.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87frkaviho.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: kirkwood: use inclusive language for SND_SOC_DAIFMT_CBx_CFx
Kuninori Morimoto [Wed, 19 Feb 2025 01:19:48 +0000 (01:19 +0000)]
ASoC: kirkwood: use inclusive language for SND_SOC_DAIFMT_CBx_CFx

In SND_SOC_DAIFMT_CBx_CFx, M/S are no longer used. use P/C.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87eczuvih7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Documentation: DPCM: use inclusive language for SND_SOC_DAIFMT_CBx_CFx
Kuninori Morimoto [Wed, 19 Feb 2025 01:19:10 +0000 (01:19 +0000)]
ASoC: Documentation: DPCM: use inclusive language for SND_SOC_DAIFMT_CBx_CFx

In SND_SOC_DAIFMT_CBx_CFx, M/S are no longer used. use P/C.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ikp6vii9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Support multi-channel PEAKVOL instantiation
Cezary Rojewski [Mon, 17 Feb 2025 10:21:15 +0000 (11:21 +0100)]
ASoC: Intel: avs: Support multi-channel PEAKVOL instantiation

The PEAKVOL module initialization procedure allows for specifying
default configuration for all individual channels. To reflect that in
the code, first update avs_get_module_control() to allow for selecting
Volume or Mute control based on needs and then apply the settings with
newly added avs_peakvol_set_volume() and avs_peakvol_set_mute().

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Honor the invert flag for mixer controls
Cezary Rojewski [Mon, 17 Feb 2025 10:21:14 +0000 (11:21 +0100)]
ASoC: Intel: avs: Honor the invert flag for mixer controls

Values for the mute flag represented on the AudioDSP side are inverted.
Check mixer control description and initialize default values
accordingly.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Add support for mute for PEAKVOL and GAIN
Amadeusz Sławiński [Mon, 17 Feb 2025 10:21:13 +0000 (11:21 +0100)]
ASoC: Intel: avs: Add support for mute for PEAKVOL and GAIN

With recent updates to AudioDSP firmware, mute functionality has been
added to PEAKVOL and GAIN modules. The operation occurs over IPC
similarly to how volume is configured. Wire it up to kcontrol
infrastructure present in the avs-driver.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Move to the new control operations
Cezary Rojewski [Mon, 17 Feb 2025 10:21:12 +0000 (11:21 +0100)]
ASoC: Intel: avs: Move to the new control operations

Allow for multi-channel volume controls to be utilized by an application
by moving over to the new implementation. Drop all unused code in the
process.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: New volume control operations
Cezary Rojewski [Mon, 17 Feb 2025 10:21:11 +0000 (11:21 +0100)]
ASoC: Intel: avs: New volume control operations

To provide multi-channel - more than 2 - capability to volume controls
implement operations that honor the num_channels of a mixer control. As
mc->num_channels can be 0 and is in fact the default behavior, the new
functions decide between ALL_CHANNELS_MASK and individual channels based
on the field value.

To avoid hard-to-review delta when refactoring the code, first implement
the new behavior with follow up changes cleaning things up.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Update VOLUME and add MUTE IPCs
Cezary Rojewski [Mon, 17 Feb 2025 10:21:10 +0000 (11:21 +0100)]
ASoC: Intel: avs: Update VOLUME and add MUTE IPCs

For mute kcontrols to have an effect add IPCs for triggering the mute
operation on the DSP side. On top of basic get/set, an aggregated
variant of the latter is provided for both MUTE and, to already present
VOLUME IPC. It allows for efficient transmission of multiple parameters
at once.

While at it, sort the functions - getters come before setters in the
AudioDSP firmware interface as well as in the kcontrol one.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Add volume control for GAIN module
Amadeusz Sławiński [Mon, 17 Feb 2025 10:21:09 +0000 (11:21 +0100)]
ASoC: Intel: avs: Add volume control for GAIN module

The AudioDSP firmware's GAIN module has same initialization payload as
PEAKVOL and user volume setting can be applied up-front. Update existing
code to account for PEAKVOL and GAIN both.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: avs: Make PEAKVOL configurable from topology
Cezary Rojewski [Mon, 17 Feb 2025 10:21:08 +0000 (11:21 +0100)]
ASoC: Intel: avs: Make PEAKVOL configurable from topology

The driver exposes volume kcontrols if PEAKVOL/GAIN module is present
in the streaming path. Currently there is no control over their default
values including the effect that may accompany the volume change event.

Add template for PEAKVOL/GAIN module which holds all the information
needed to address the limitation.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: topology: Save num_channels value for mixer controls
Cezary Rojewski [Mon, 17 Feb 2025 10:21:07 +0000 (11:21 +0100)]
ASoC: topology: Save num_channels value for mixer controls

To provide minimal support for multi-channel kcontrols i.e.: more than
stereo configuration, store the number of channels specified within the
SectionControlMixer. The field is part of the topology standard,
currently skipped by the ASoC core.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: topology: Create kcontrols based on their type
Cezary Rojewski [Mon, 17 Feb 2025 10:21:06 +0000 (11:21 +0100)]
ASoC: topology: Create kcontrols based on their type

Fields ->ops.info and ->type of struct snd_soc_tplg_ctl_hdr denote
info-operation type and control type respectively. These are two
different pieces of information. The info type is represented by
SND_SOC_TPLG_CTL_xxx and SND_SOC_TPLG_DAPM_CTL_xxx on UAPI side whereas
for control type it is SND_SOC_TPLG_TYPE_xxx (mixer, bytes or enum).

The type of the kcontrol to be created is currently guessed based on the
value of the ->ops.info. Use the ->type instead to correct and simplify
the code. With this change ops.info() can be customized by sound drivers
utilizing the ASoC-topology just like ops.get() and ops.put() can be.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: imx-card: Add playback_only or capture_only support
Shengjiu Wang [Mon, 17 Feb 2025 02:17:15 +0000 (10:17 +0800)]
ASoC: imx-card: Add playback_only or capture_only support

With the DPCM case, the backend only support capture or playback, then
the linked frontend can only support capture or playback, but frontend
can't automatically enable only capture or playback, it needs the input
from dt-binding.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://patch.msgid.link/20250217021715.284951-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: imx-card: Add playback-only and capture-only property
Shengjiu Wang [Mon, 17 Feb 2025 02:17:14 +0000 (10:17 +0800)]
ASoC: dt-bindings: imx-card: Add playback-only and capture-only property

Refer to audio graph card, add playback-only and capture-only property
for imx-audio-card.yaml for the case that only playback or capture is
supported.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250217021715.284951-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: cros_ec_codec: Use str_enable_disable() helper in wov_enable_put()
Thorsten Blum [Thu, 20 Feb 2025 12:01:01 +0000 (13:01 +0100)]
ASoC: cros_ec_codec: Use str_enable_disable() helper in wov_enable_put()

Remove hard-coded strings by using the str_enable_disable() helper
function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20250220120100.1530-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: atmel: atmel-classd: Use str_enabled_disabled() helper
Thorsten Blum [Sat, 22 Feb 2025 22:59:25 +0000 (23:59 +0100)]
ASoC: atmel: atmel-classd: Use str_enabled_disabled() helper

Remove hard-coded strings by using the str_enabled_disabled() helper
function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Andrei Simion <andrei.simion@microchip.com>
Link: https://patch.msgid.link/20250222225925.539840-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: amd: Move depends on AMD_NODE to consumers
Mario Limonciello [Fri, 21 Feb 2025 18:18:12 +0000 (12:18 -0600)]
ASoC: SOF: amd: Move depends on AMD_NODE to consumers

CONFIG_SND_SOC_SOF_AMD_COMMON is a hidden option that is only selected by
other options.  It can't have a direct depends on AMD_NODE because select
can't pick another option automatically.

This was attempted to be fixed in commit b47834ee4485b ("ASoC: SOF: amd:
Add depends on CPU_SUP_AMD") but this just masked the issue as it was found
in another config.

Instead move the `depends on AMD_NODE` out of SND_SOC_SOF_AMD_COMMON to
all the consumers and drop `depends on CPU_SUP_AMD`.

Fixes: b47834ee4485b ("ASoC: SOF: amd: Add depends on CPU_SUP_AMD")
Fixes: f120cf33d232 ("ASoC: SOF: amd: Use AMD_NODE")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202502220104.a8P6ApQN-lkp@intel.com/
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250221181840.2639793-1-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: fsl: fsl_qmc_audio: Remove unnecessary bool conversions
Thorsten Blum [Sun, 23 Feb 2025 20:27:41 +0000 (21:27 +0100)]
ASoC: fsl: fsl_qmc_audio: Remove unnecessary bool conversions

Remove unnecessary bool conversions and simplify the code.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20250223202741.1916-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agodevres: Introduce devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:05 +0000 (11:55 +0530)]
devres: Introduce devm_kmemdup_array()

Introduce '_array' variant of devm_kmemdup() which is more robust and
consistent with alloc family of helpers.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 months agoiio: imu: st_lsm9ds0: Replace device.h with what is needed
Andy Shevchenko [Wed, 12 Feb 2025 06:25:04 +0000 (11:55 +0530)]
iio: imu: st_lsm9ds0: Replace device.h with what is needed

Instead of including a huge device.h with tons of dependencies
include only what driver actually uses.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 months agodriver core: Split devres APIs to device/devres.h
Andy Shevchenko [Wed, 12 Feb 2025 06:25:03 +0000 (11:55 +0530)]
driver core: Split devres APIs to device/devres.h

device.h is a huge header which is hard to follow and easy to miss
something. Improve that by splitting devres APIs to device/devres.h.

In particular this helps to speedup the build of the code that includes
device.h solely for a devres APIs.

While at it, cast the error pointers to __iomem using IOMEM_ERR_PTR()
and fix sparse warnings.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 months agoerr.h: move IOMEM_ERR_PTR() to err.h
Raag Jadav [Wed, 12 Feb 2025 06:25:02 +0000 (11:55 +0530)]
err.h: move IOMEM_ERR_PTR() to err.h

Since IOMEM_ERR_PTR() macro deals with an error pointer, a better place
for it is err.h. This helps avoid dependency on io.h for the users that
don't need it.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agoASoC: SOF: amd: Add depends on CPU_SUP_AMD
Mario Limonciello [Thu, 20 Feb 2025 18:48:20 +0000 (12:48 -0600)]
ASoC: SOF: amd: Add depends on CPU_SUP_AMD

When SMN support was switched to the kernel wide AMD_NODE instead of
local implementation this broke compilation on the allyesconfig for
some architectures.  AMD_NODE is only supported on AMD platforms, so
modify all the AMD drivers that use it to also require CPU_SUP_AMD.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/linux-next/20250220160950.2cd64bdb@canb.auug.org.au/
Fixes: f120cf33d232 ("ASoC: SOF: amd: Use AMD_NODE")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250220184822.916090-1-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: soc-core: Use str_yes_no() in snd_soc_close_delayed_work()
Thorsten Blum [Thu, 20 Feb 2025 12:01:56 +0000 (13:01 +0100)]
ASoC: soc-core: Use str_yes_no() in snd_soc_close_delayed_work()

Remove hard-coded strings by using the str_yes_no() helper function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250220120156.1663-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agofirmware: cs_dsp: test_control_parse: null-terminate test strings
Thomas Weißschuh [Tue, 11 Feb 2025 15:00:02 +0000 (16:00 +0100)]
firmware: cs_dsp: test_control_parse: null-terminate test strings

The char pointers in 'struct cs_dsp_mock_coeff_def' are expected to
point to C strings. They need to be terminated by a null byte.
However the code does not allocate that trailing null byte and only
works if by chance the allocation is followed by such a null byte.

Refactor the repeated string allocation logic into a new helper which
makes sure the terminating null is always present.
It also makes the code more readable.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Fixes: 83baecd92e7c ("firmware: cs_dsp: Add KUnit testing of control parsing")
Cc: stable@vger.kernel.org
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Tested-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250211-cs_dsp-kunit-strings-v1-1-d9bc2035d154@linutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agofirmware: cs_dsp: test_bin_error: Use same test cases for adsp2 and Halo Core
Richard Fitzgerald [Wed, 19 Feb 2025 15:21:32 +0000 (15:21 +0000)]
firmware: cs_dsp: test_bin_error: Use same test cases for adsp2 and Halo Core

Re-use the adsp2 test cases for the Halo Core test run. Before this the
Halo Core kunit_case array was an empty placeholder.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250219152132.1285941-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: dt-bindings: atmel-at91sam9g20ek: convert to json-schema
Balakrishnan Sambath [Wed, 19 Feb 2025 05:52:27 +0000 (11:22 +0530)]
ASoC: dt-bindings: atmel-at91sam9g20ek: convert to json-schema

Convert atmel-at91sam9g20ek-wm8731-audio DT binding to yaml
based json-schema.Change file name to match json-scheme naming.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250219-sound-atmel-at91sam9g20ek-v3-1-d7c082af4e14@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoAdjust all AMD audio drivers to use AMD_NODE
Mark Brown [Wed, 19 Feb 2025 02:43:31 +0000 (02:43 +0000)]
Adjust all AMD audio drivers to use AMD_NODE

Merge series from Mario Limonciello <superm1@kernel.org>:

The various AMD audio drivers have self contained implementations
for SMN router communication that require hardcoding the bridge ID.

These implementations also don't prevent race conditions with other
drivers performing SMN communication.

A new centralized driver AMD_NODE is introduced and all drivers in
the kernel should use this instead. Adjust all AMD audio drivers to
use it.

4 months agoASoC: SOF: amd: Drop host bridge ID from struct
Mario Limonciello [Mon, 17 Feb 2025 23:17:47 +0000 (17:17 -0600)]
ASoC: SOF: amd: Drop host bridge ID from struct

host_bridge_id is no longer used by any of the SoCs as they
all use AMD_NODE to communicate with SMN routers.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250217231747.1656228-8-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: amd: acp: Drop local symbols for smn read/write
Mario Limonciello [Mon, 17 Feb 2025 23:17:46 +0000 (17:17 -0600)]
ASoC: amd: acp: Drop local symbols for smn read/write

As the ACP drivers use the AMD_NODE provided symbols, the local
ones are no longer necessary.

Tested by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250217231747.1656228-7-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: SOF: amd: Use AMD_NODE
Mario Limonciello [Mon, 17 Feb 2025 23:17:45 +0000 (17:17 -0600)]
ASoC: SOF: amd: Use AMD_NODE

All consumers of SMN in the kernel should be doing it through the
functions provided by AMD_NODE.

Stop using the local SMN read/write symbols and switch to the AMD_NODE
provided ones.

Tested by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250217231747.1656228-6-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: amd: acp: acp63: Use AMD_NODE
Mario Limonciello [Mon, 17 Feb 2025 23:17:44 +0000 (17:17 -0600)]
ASoC: amd: acp: acp63: Use AMD_NODE

All consumers of SMN in the kernel should be doing it through the
functions provided by AMD_NODE.

Stop using the local SMN read/write symbols and switch to the AMD_NODE
provided ones.

Tested by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250217231747.1656228-5-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: amd: acp: acp70: Use AMD_NODE
Mario Limonciello [Mon, 17 Feb 2025 23:17:43 +0000 (17:17 -0600)]
ASoC: amd: acp: acp70: Use AMD_NODE

All consumers of SMN in the kernel should be doing it through the
functions provided by AMD_NODE.

Stop using the local SMN read/write symbols and switch to the AMD_NODE
provided ones.

Tested by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250217231747.1656228-4-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: amd: acp: rembrandt: Use AMD_NODE
Mario Limonciello [Mon, 17 Feb 2025 23:17:42 +0000 (17:17 -0600)]
ASoC: amd: acp: rembrandt: Use AMD_NODE

All consumers of SMN in the kernel should be doing it through the
functions provided by AMD_NODE.

Stop using the local SMN read/write symbols and switch to the AMD_NODE
provided ones.

Tested by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250217231747.1656228-3-superm1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agox86/amd_node: Add a smn_read_register() helper
Mario Limonciello [Mon, 17 Feb 2025 23:17:41 +0000 (17:17 -0600)]
x86/amd_node: Add a smn_read_register() helper

Some of the ACP drivers will poll registers through SMN using
read_poll_timeout() which requires returning the result of the register read
as the argument.

Add a helper to do just that.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20250217231747.1656228-2-superm1@kernel.org
4 months agoASoC: amd: ps: fix inconsistent indenting warning in check_and_handle_sdw_dma_irq()
Vijendar Mukunda [Tue, 18 Feb 2025 05:10:00 +0000 (10:40 +0530)]
ASoC: amd: ps: fix inconsistent indenting warning in check_and_handle_sdw_dma_irq()

Fix below inconsistent indenting smatch warning.
smatch warnings:
sound/soc/amd/ps/pci-ps.c:68 check_and_handle_sdw_dma_irq() warn: inconsistent indenting

Fixes: 4516be370ced ("ASoC: amd: ps: refactor soundwire dma interrupt handling")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202502132134.BlkNw1Iq-lkp@intel.com/
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20250218051000.254265-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: SOF: imx: Fix error code in probe()
Dan Carpenter [Mon, 17 Feb 2025 07:32:51 +0000 (10:32 +0300)]
ASoC: SOF: imx: Fix error code in probe()

This accidentally returns "common->clk_num" instead of "ret".

Fixes: 651e0ed391b1 ("ASoC: SOF: imx: introduce more common structures and functions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/b30ffe7f-21fd-45f9-9528-d6d689e04003@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory()
Dan Carpenter [Mon, 17 Feb 2025 07:32:44 +0000 (10:32 +0300)]
ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory()

The devm_ioremap() function doesn't return error pointers, it returns
NULL on error.  Update the checking to match.

Fixes: 651e0ed391b1 ("ASoC: SOF: imx: introduce more common structures and functions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/68973636-eab8-4d82-8359-ae2c8f60f261@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: random cleanup
Mark Brown [Mon, 17 Feb 2025 13:38:51 +0000 (13:38 +0000)]
ASoC: random cleanup

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

These are random cleanup patch-set for ASoC

4 months agoASoC: tas2764: Random patches from the Asahi Linux
Mark Brown [Mon, 17 Feb 2025 13:38:46 +0000 (13:38 +0000)]
ASoC: tas2764: Random patches from the Asahi Linux

Merge series from broonie@kernel.org:

This is a random subset of the patches for the tas2764 driver that I
found in the Asahi Linux tree which seemed to be clear fixes and
improvements which apply easily to mainline without much effort, there's
a bunch more work on the driver that should also be applicable.

I've only build tested this.

4 months agoASoC: SOF: Intel: Use str_enable_disable() helper
Thorsten Blum [Mon, 10 Feb 2025 12:01:30 +0000 (13:01 +0100)]
ASoC: SOF: Intel: Use str_enable_disable() helper

Remove hard-coded strings by using the str_enable_disable() helper
function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250210120132.53831-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: wm_hubs: Use str_enable_disable() in wm_hubs_update_class_w()
Thorsten Blum [Mon, 10 Feb 2025 11:58:03 +0000 (12:58 +0100)]
ASoC: wm_hubs: Use str_enable_disable() in wm_hubs_update_class_w()

Remove hard-coded strings by using the str_enable_disable() helper
function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250210115804.53504-3-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: dt-bindings: wlf,wm8960: add 'port' property
Laurentiu Mihalcea [Fri, 7 Feb 2025 16:30:29 +0000 (11:30 -0500)]
ASoC: dt-bindings: wlf,wm8960: add 'port' property

The wm8960 codec may be used with audio graph card and thus may require an
additional property: 'port'. Add it.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250207163029.3365-1-laurentiumihalcea111@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: SOF: ipc3: Use str_enabled_disabled() helper function
Thorsten Blum [Mon, 10 Feb 2025 22:44:54 +0000 (23:44 +0100)]
ASoC: SOF: ipc3: Use str_enabled_disabled() helper function

Remove hard-coded strings by using the str_enabled_disabled() helper
function. Remove unnecessary curly braces.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250210224453.363638-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: SOF: Intel: Don't import non-existing module namespace
Uwe Kleine-König [Wed, 12 Feb 2025 17:29:47 +0000 (18:29 +0100)]
ASoC: SOF: Intel: Don't import non-existing module namespace

There is no module namespace "SND_SOC_SOF_INTEL_HIFI_EP_IPC", so don't
import it. Historically there was such a namespace, but it was dropped
in commit 97e22cbd0dc3 ("ASoC: SOF: Make Intel IPC stream ops generic").

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20250212172947.38970-2-u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: ops: Enforce platform maximum on initial value
Martin Povišer [Sat, 8 Feb 2025 00:57:22 +0000 (00:57 +0000)]
ASoC: ops: Enforce platform maximum on initial value

Lower the volume if it is violating the platform maximum at its initial
value (i.e. at the time of the 'snd_soc_limit_volume' call).

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
[Cherry picked from the Asahi kernel with fixups -- broonie]
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250208-asoc-volume-limit-v1-1-b98fcf4cdbad@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agox86/amd_node: Add support for debugfs access to SMN registers
Mario Limonciello [Thu, 30 Jan 2025 19:48:57 +0000 (19:48 +0000)]
x86/amd_node: Add support for debugfs access to SMN registers

There are certain registers on AMD Zen systems that can only be accessed
through SMN.

Introduce a new interface that provides debugfs files for accessing SMN.  As
this introduces the capability for userspace to manipulate the hardware in
unpredictable ways, taint the kernel when writing.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20250130-wip-x86-amd-nb-cleanup-v4-3-b5cc997e471b@amd.com
4 months agox86/amd_node: Add SMN offsets to exclusive region access
Mario Limonciello [Thu, 30 Jan 2025 19:48:56 +0000 (19:48 +0000)]
x86/amd_node: Add SMN offsets to exclusive region access

Offsets 0x60 and 0x64 are used internally by kernel drivers that call
the amd_smn_read() and amd_smn_write() functions. If userspace accesses
the regions at the same time as the kernel it may cause malfunctions in
drivers using the offsets.

Add these offsets to the exclusions so that the kernel is tainted if a
non locked down userspace tries to access them.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20250130-wip-x86-amd-nb-cleanup-v4-2-b5cc997e471b@amd.com
4 months agox86/amd_node, platform/x86/amd/hsmp: Have HSMP use SMN through AMD_NODE
Yazen Ghannam [Thu, 30 Jan 2025 19:48:55 +0000 (19:48 +0000)]
x86/amd_node, platform/x86/amd/hsmp: Have HSMP use SMN through AMD_NODE

The HSMP interface is just an SMN interface with different offsets.

Define an HSMP wrapper in the SMN code and have the HSMP platform driver
use that rather than a local solution.

Also, remove the "root" member from AMD_NB, since there are no more
users of it.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Carlos Bilbao <carlos.bilbao@kernel.org>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20250130-wip-x86-amd-nb-cleanup-v4-1-b5cc997e471b@amd.com
4 months agoASoC: tas2764: Add reg defaults for TAS2764_INT_CLK_CFG
Hector Martin [Sat, 8 Feb 2025 01:03:27 +0000 (01:03 +0000)]
ASoC: tas2764: Add reg defaults for TAS2764_INT_CLK_CFG

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250208-asoc-tas2764-v1-4-dbab892a69b5@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: tas2764: Mark SW_RESET as volatile
Hector Martin [Sat, 8 Feb 2025 01:03:26 +0000 (01:03 +0000)]
ASoC: tas2764: Mark SW_RESET as volatile

Since the bit is self-clearing.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250208-asoc-tas2764-v1-3-dbab892a69b5@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: tas2764: Wait for ramp-down after shutdown
Hector Martin [Sat, 8 Feb 2025 01:03:25 +0000 (01:03 +0000)]
ASoC: tas2764: Wait for ramp-down after shutdown

When we shut down the amp, we need to wait for the built-in ramp-down
before we can remove the TDM clocks. There is no documented status
regiter to poll, so the best we can do is a delay. Datasheet says 5.9ms
for ramp-down and 1.5ms between shutdown and next startup, so let's do
6ms after mute and 2ms after shutdown. That gives us a cumulative 8ms
for ramp-down and guaratees the required minimum shutdown time.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250208-asoc-tas2764-v1-2-dbab892a69b5@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 months agoASoC: tas2764: Power up/down amp on mute ops
Hector Martin [Sat, 8 Feb 2025 01:03:24 +0000 (01:03 +0000)]
ASoC: tas2764: Power up/down amp on mute ops

The ASoC convention is that clocks are removed after codec mute, and
power up/down is more about top level power management. For these chips,
the "mute" state still expects a TDM clock, and yanking the clock in
this state will trigger clock errors. So, do the full
shutdown<->mute<->active transition on the mute operation, so the amp is
in software shutdown by the time the clocks are removed.

This fixes TDM clock errors when streams are stopped.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250208-asoc-tas2764-v1-1-dbab892a69b5@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>