]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
3 months agoASoC: SDCA: Add SDCA Control Range data access helper
Charles Keepax [Wed, 12 Mar 2025 17:22:04 +0000 (17:22 +0000)] 
ASoC: SDCA: Add SDCA Control Range data access helper

SDCA Ranges are two dimensional arrays of data associated with controls,
add a helper to provide an x,y access mechanism to the data and a helper
to locate a specific value inside a range.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250312172205.4152686-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SDCA: Add type flag for Controls
Charles Keepax [Wed, 12 Mar 2025 17:22:03 +0000 (17:22 +0000)] 
ASoC: SDCA: Add type flag for Controls

SDCA Controls come in a variety of data formats, to simplify later
parsing work out this data type as the control is parsed and stash it
for later use.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250312172205.4152686-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SDCA: Allow naming of imp def controls
Charles Keepax [Wed, 12 Mar 2025 17:22:02 +0000 (17:22 +0000)] 
ASoC: SDCA: Allow naming of imp def controls

Implementation defined controls will not be present in the large list of
known controls for SDCA. The driver should not return an error for these,
because it is perfectly legal to have implementation defined controls.
Update the handling to instead generate a generic name.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250312172205.4152686-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SDCA: Use __free() to manage local buffers
Charles Keepax [Wed, 12 Mar 2025 17:22:01 +0000 (17:22 +0000)] 
ASoC: SDCA: Use __free() to manage local buffers

Use the cleanup.h helpers to manage some local buffers, this cleans up
the error paths a little.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250312172205.4152686-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SDCA: Tidy up initialization write parsing
Charles Keepax [Wed, 12 Mar 2025 17:22:00 +0000 (17:22 +0000)] 
ASoC: SDCA: Tidy up initialization write parsing

Slightly neaten up the initialization write code to overlay a struct
rather than shifting the pointer along manually. This also removes the
Sparse warning:

sound/soc/sdca/sdca_functions.c:233:36: warning: cast to restricted __le32

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250312172205.4152686-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: sun4i-codec: add headphone dectection for
Mark Brown [Fri, 14 Mar 2025 03:11:27 +0000 (03:11 +0000)] 
ASoC: sun4i-codec: add headphone dectection for

Merge series from Ryan Walklin <ryan@testtoast.com>:

Hi All,

V3 of this patch adding headphone jack detection support to the Anbernic RGnnXX series of handhelds. V3 corrects my misunderstanding of derivation of ALSA UCM file paths, and adds recieved Reviewed-by and Tested-by tags. Thanks to those that have reviewed and fed back on previous versions.

Original message below:

This series adds the required device tree bindings to describe GPIOs for jack detection in the sun4i-codec driver, adds support for jack detection to the codec machine driver, and describes the hardware configuration in the RG35XX DTS. The existing speaker amplifier GPIO pin can then be used in concert with jack detection to enable userspace sound servers (via an ALSA UCM configuration) to disable the speaker route when headphones are connected.

Thanks to Chris Morgan for his assistance putting this series together.

Regards,

Ryan

Chris Morgan (2):
  ASoC: dt-bindings: sun4i-a10-codec: add hp-det-gpios
  arm64: dts: allwinner: h700: Add hp-det-gpios for Anbernic RG35XX

Ryan Walklin (3):
  ASoC: sun4i-codec: correct dapm widgets and controls for h616
  ASoC: sun4i-codec: support hp-det-gpios property
  ASoC: sun4i-codec: add h616 card long_name

 .../sound/allwinner,sun4i-a10-codec.yaml      |  6 ++
 .../sun50i-h700-anbernic-rg35xx-2024.dts      |  5 +-
 sound/soc/sunxi/sun4i-codec.c                 | 57 ++++++++++++++++++-
 3 files changed, 66 insertions(+), 2 deletions(-)

--
2.48.1

3 months agoASoC: Merge up fixes
Mark Brown [Fri, 14 Mar 2025 02:31:06 +0000 (02:31 +0000)] 
ASoC: Merge up fixes

Merge the for-6.14 to resolve conflicts with simple-card-utils.c due to
parallel delveopment.

3 months agoASoC: sun4i-codec: add h616 card long_name
Ryan Walklin [Fri, 14 Feb 2025 22:02:27 +0000 (11:02 +1300)] 
ASoC: sun4i-codec: add h616 card long_name

Adding jack detection requires sound servers to act on the emitted
events, which are described by ALSA Use Case Manager configurations in
userspace. These configurations include the long card name in the file
path (falling back to card->name if this is not present), so add a long
card name for the H616 without spaces, making UCM referencing easier.

The corresponding ALSA UCM patch is here (now merged):
https://github.com/alsa-project/alsa-ucm-conf/pull/491

Signed-off-by: Ryan Walklin <ryan@testtoast.com>
--
Changelog v1..v2:
- Separate patch for card->long_name
- Note UCM patch link

Changelog v2..v3:
- Add card->long_name rather than change existing card->name

Link: https://patch.msgid.link/20250214220247.10810-6-ryan@testtoast.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: sun4i-codec: support hp-det-gpios property
Ryan Walklin [Fri, 14 Feb 2025 22:02:25 +0000 (11:02 +1300)] 
ASoC: sun4i-codec: support hp-det-gpios property

Add support for GPIO headphone detection with the hp-det-gpios
property. In order for this to properly disable the path upon
removal of headphones, the output must be labelled Headphone which
is a common sink in the driver.

Describe a headphone jack and detection GPIO in the driver, check for
a corresponding device tree node, and enable jack detection in a new
machine init function if described.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Ryan Walklin <ryan@testtoast.com>
--
Changelog v1..v2:
- Separate DAPM changes into separate patch and add rationale.

Tested-by: Philippe Simons <simons.philippe@gmail.com>
Link: https://patch.msgid.link/20250214220247.10810-4-ryan@testtoast.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: sun4i-codec: correct dapm widgets and controls for h616
Ryan Walklin [Fri, 14 Feb 2025 22:02:24 +0000 (11:02 +1300)] 
ASoC: sun4i-codec: correct dapm widgets and controls for h616

The previous H616 support patch added a single LINEOUT DAPM pin switch
to the card controls. As the codec in this SoC only has a single route,
this seemed reasonable at the time, however is redundant given the
existing DAPM codec widget definitions controlling the digital and
analog sides of the codec.

It is also insufficient to describe the scenario where separate
components (muxes, jack detection etc) are used to modify the audio
route external to the SoC. For example the Anbernic RG(##)XX series of
devices uses a headphone jack detection switch, GPIO-controlled speaker
amplifier and a passive external mux chip to route audio.

Remove the redundant LINEOUT card control, and add a Speaker pin switch
control and Headphone DAPM widget to allow control of the above
hardware.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Ryan Walklin <ryan@testtoast.com>
Tested-by: Philippe Simons <simons.philippe@gmail.com>
Link: https://patch.msgid.link/20250214220247.10810-3-ryan@testtoast.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: sun4i-a10-codec: add hp-det-gpios
Chris Morgan [Fri, 14 Feb 2025 22:02:23 +0000 (11:02 +1300)] 
ASoC: dt-bindings: sun4i-a10-codec: add hp-det-gpios

Devices integrating Allwinner SoCs may use line-out or headphone jacks
with jack detection circuits attached to a GPIO. Support defining these
in DTs.

A number of Anbernic devices featuring the H700 SoC use this mechanism
to switch between a headphone jack and an internal speaker, so add these
to the allowed routing items.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Ryan Walklin <ryan@testtoast.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
--

Changelog v1..v2:
- Remove vendor prefix from hp-det-gpios

Changelog v2..v3:
- Add Reviewed-by tag

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Tested-by: Philippe Simons <simons.philippe@gmail.com>
Link: https://patch.msgid.link/20250214220247.10810-2-ryan@testtoast.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: tas2770: Fix and redo I/V sense TDM slot setting logic
Martin Povišer [Thu, 27 Feb 2025 12:07:33 +0000 (22:07 +1000)] 
ASoC: tas2770: Fix and redo I/V sense TDM slot setting logic

The former code sets the V slot from inside set_bitwidth according to
the bitwidth of the PCM format. That's wrong, since:

 * It overrides the V slot parsed from DT binding.

 * The V slot is set shifted behind the I slot by the length of the PCM
   bitwidth, but the PCM bitwidth has no assured relation to the TDM
   slot width.

Replace the former logic by setting up the I/V sense transmission only
in case of both I/V slots being specified in devicetree, and never
override those values. In case the slots are left unspecified, disable
the transmission completely.

There's an improbable case someone is relying on the old behavior, but
if so, that's a setup that only works by accident, and cannot be sanely
supported going forward. There's no indication anyone is consuming the
I/V sense data up to today, so break the former behavior.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250227-apple-codec-changes-v3-6-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: tas2770: Factor out set_ivsense_slots
Martin Povišer [Thu, 27 Feb 2025 12:07:32 +0000 (22:07 +1000)] 
ASoC: tas2770: Factor out set_ivsense_slots

Add a new explicit function for the setting of I/V sense TDM slots.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250227-apple-codec-changes-v3-5-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: tas2764: Add control concerning overcurrent events
Martin Povišer [Thu, 27 Feb 2025 12:07:31 +0000 (22:07 +1000)] 
ASoC: tas2764: Add control concerning overcurrent events

Add control to expose the option of autoretry behavior on overcurrent
events in the codec.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250227-apple-codec-changes-v3-4-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: tas2764: Extend driver to SN012776
Martin Povišer [Thu, 27 Feb 2025 12:07:30 +0000 (22:07 +1000)] 
ASoC: tas2764: Extend driver to SN012776

SN012776 is a speaker amp chip found in Apple's 2021 laptops. It appears
similar and more-or-less compatible to TAS2764. Extend the TAS2764
driver with some SN012776 specifics and configure the chip assuming
it's in one of the Apple machines.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250227-apple-codec-changes-v3-3-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: tas2770: add compatible for TAS5770L
James Calligeros [Thu, 27 Feb 2025 12:07:29 +0000 (22:07 +1000)] 
ASoC: dt-bindings: tas2770: add compatible for TAS5770L

A variant of TAS2770 known as TAS5770L is found in Apple Silicon Macs.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250227-apple-codec-changes-v3-2-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: tas27xx: add compatible for SN012776
James Calligeros [Thu, 27 Feb 2025 12:07:28 +0000 (22:07 +1000)] 
ASoC: dt-bindings: tas27xx: add compatible for SN012776

The TI SN012776 is a variant of TAS2764 found in Apple Silicon Macs.
It continues Apple's long-standing policy of getting vendors to
spin out subtly incompatible and Apple-exclusive variants of their
publicly available parts.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250227-apple-codec-changes-v3-1-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: simple-card-utils: Don't use __free(device_node) at graph_util_parse_dai()
Kuninori Morimoto [Fri, 28 Feb 2025 00:29:30 +0000 (00:29 +0000)] 
ASoC: simple-card-utils: Don't use __free(device_node) at graph_util_parse_dai()

commit 419d1918105e ("ASoC: simple-card-utils: use __free(device_node) for
device node") uses __free(device_node) for dlc->of_node, but we need to
keep it while driver is in use.

Don't use __free(device_node) in graph_util_parse_dai().

Fixes: 419d1918105e ("ASoC: simple-card-utils: use __free(device_node) for device node")
Reported-by: Thuan Nguyen <thuan.nguyen-hong@banvien.com.vn>
Reported-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Thuan Nguyen <thuan.nguyen-hong@banvien.com.vn>
Tested-by: Detlev Casanova <detlev.casanova@collabora.com>
Link: https://patch.msgid.link/87eczisyhh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: ipc4-topology: Allocate ref_params on stack
Andy Shevchenko [Wed, 12 Mar 2025 16:05:16 +0000 (18:05 +0200)] 
ASoC: SOF: ipc4-topology: Allocate ref_params on stack

Currently the compiler (clang 19.1.7) is not happy about the size of
the stack frame in sof_ipc4_prepare_copier_module:

sound/soc/sof/ipc4-topology.c:1800:1: error: stack frame size (1288) exceeds limit (1024) in 'sof_ipc4_prepare_copier_module' [-Werror,-Wframe-larger-than]
 1800 | sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
      | ^

Work around this by allocating ref_params on stack, as it looks the biggest
variable on stack right now.

Note, this only happens when compile for 32-bit machines (x86_32 in my case).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250312160516.3864295-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: cs42l43: convert to SYSTEM_SLEEP_PM_OPS
Arnd Bergmann [Wed, 5 Mar 2025 17:27:32 +0000 (18:27 +0100)] 
ASoC: cs42l43: convert to SYSTEM_SLEEP_PM_OPS

The custom suspend function causes a build warning when CONFIG_PM_SLEEP
is disabled:

sound/soc/codecs/cs42l43.c:2405:12: error: unused function 'cs42l43_codec_runtime_force_suspend' [-Werror,-Wunused-function]

Change SET_SYSTEM_SLEEP_PM_OPS() to the newer SYSTEM_SLEEP_PM_OPS(),
to avoid this.

Fixes: 164b7dd4546b ("ASoC: cs42l43: Add jack delay debounce after suspend")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250305172738.3437513-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: speyside: Free gpiod table
Linus Walleij [Wed, 12 Mar 2025 10:02:25 +0000 (11:02 +0100)] 
ASoC: samsung: speyside: Free gpiod table

We create a gpio descriptor table but it needs to be free:ed
when the module is removed. Add a devm_ action to do the job.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: da9146c19b17 ("ASoC: samsung: speyside: Convert to GPIO descriptor")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250312-cleanup-table-v1-1-1d9a14464482@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Fix for enabling DMIC on acp platforms via _DSD entry
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:32:01 +0000 (00:02 +0530)] 
ASoC: amd: acp: Fix for enabling DMIC on acp platforms via _DSD entry

Add condition check to register ACP PDM sound card by reading
_WOV acpi entry.

Fixes: 09068d624c49 ("ASoC: amd: acp: fix for acp platform device creation failure")
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-15-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Refactor renoir platform resource structure
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:32:00 +0000 (00:02 +0530)] 
ASoC: amd: acp: Refactor renoir platform resource structure

Refactor renoir platform resource private structure to amd.h
header file.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-14-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Refactor rembrant platform resource structure
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:59 +0000 (00:01 +0530)] 
ASoC: amd: acp: Refactor rembrant platform resource structure

Refactor rembrandt platform resource private structure to amd.h
header fle.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-13-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Refactor acp63 platform resource structure
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:58 +0000 (00:01 +0530)] 
ASoC: amd: acp: Refactor acp63 platform resource structure

Refactor acp63 platform resource private structure to amd.h
header file.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-12-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Refactor acp70 platform resource structure
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:57 +0000 (00:01 +0530)] 
ASoC: amd: acp: Refactor acp70 platform resource structure

Refactor acp70 platform resource private structure to amd.h
header file.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-11-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Remove white line
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:56 +0000 (00:01 +0530)] 
ASoC: amd: acp: Remove white line

Remove white line in renoir platform driver.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-10-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Move spin_lock and list initialization to acp-pci driver
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:55 +0000 (00:01 +0530)] 
ASoC: amd: acp: Move spin_lock and list initialization to acp-pci driver

Move spin_lock and linked list initialization from platform driver to
acp-pci driver.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-9-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Remove redundant acp_dev_data structure
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:54 +0000 (00:01 +0530)] 
ASoC: amd: acp: Remove redundant acp_dev_data structure

Move acp_dev_data structure members to acp_chip_info structure
to avoid using common members in each structure and remove redundant
acp_dev_data structure.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-8-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Add new interrupt handle callbacks in acp_common_hw_ops
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:53 +0000 (00:01 +0530)] 
ASoC: amd: acp: Add new interrupt handle callbacks in acp_common_hw_ops

Add new interrupt handle callbacks in acp_common_hw_ops.
Refactor and move interrupt handler registration form platform
driver to pci driver.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-7-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Refactor acp machine select
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:52 +0000 (00:01 +0530)] 
ASoC: amd: acp: Refactor acp machine select

Refactor and move acp machine select function from acp platform
driver to acp pci driver and assign platform specific acpi machines
to chip->machines.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-6-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Refactor acp platform device creation
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:51 +0000 (00:01 +0530)] 
ASoC: amd: acp: Refactor acp platform device creation

Refactor acp platform device creation logic and remove unused
acp resource (acp_res) structure.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-5-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Refactor dmic-codec platform device creation
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:50 +0000 (00:01 +0530)] 
ASoC: amd: acp: Refactor dmic-codec platform device creation

Refactor dmic-codec platform driver creation using helper function.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Implement acp_common_hw_ops support for acp platforms
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:49 +0000 (00:01 +0530)] 
ASoC: amd: acp: Implement acp_common_hw_ops support for acp platforms

Implement acp common hardware ops for acp_init and acp_deinit
funcions to support commons ops for all platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: acp: Remove redundant acp70 chip->name
Venkata Prasad Potturu [Mon, 10 Mar 2025 18:31:48 +0000 (00:01 +0530)] 
ASoC: amd: acp: Remove redundant acp70 chip->name

As acp71 platform driver uses acp70 platform driver, remove the
redundant chip->name.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
Christophe JAILLET [Mon, 10 Mar 2025 17:45:36 +0000 (18:45 +0100)] 
ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()

Free some resources in the error handling path of the probe, as already
done in the remove function.

Fixes: e3523e01869d ("ASoC: wm0010: Add initial wm0010 DSP driver")
Fixes: fd8b96574456 ("ASoC: wm0010: Clear IRQ as wake source and include missing header")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/5139ba1ab8c4c157ce04e56096a0f54a1683195c.1741549792.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: soc-acpi-intel-ptl-match: Add cs42l43 support
Naveen Manohar [Tue, 11 Mar 2025 00:31:01 +0000 (08:31 +0800)] 
ASoC: Intel: soc-acpi-intel-ptl-match: Add cs42l43 support

Patch adds driver data & match table for cs42l43
multi-function codec on PTL-RVP at sdw link3.

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250311003101.80967-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: qcom: sm8250: explicitly set format in sm8250_be_hw_params_fixup()
Alexey Klimov [Fri, 28 Feb 2025 16:14:30 +0000 (16:14 +0000)] 
ASoC: qcom: sm8250: explicitly set format in sm8250_be_hw_params_fixup()

Setting format to s16le is required for compressed playback on compatible
soundcards.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Link: https://patch.msgid.link/20250228161430.373961-1-alexey.klimov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: cs35l41: check the return value from spi_setup()
Vitaliy Shevtsov [Tue, 4 Mar 2025 11:56:37 +0000 (16:56 +0500)] 
ASoC: cs35l41: check the return value from spi_setup()

Currently the return value from spi_setup() is not checked for a failure.
It is unlikely it will ever fail in this particular case but it is still
better to add this check for the sake of completeness and correctness. This
is cheap since it is performed once when the device is being probed.

Handle spi_setup() return value.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Fixes: 872fc0b6bde8 ("ASoC: cs35l41: Set the max SPI speed for the whole device")
Signed-off-by: Vitaliy Shevtsov <v.shevtsov@mt-integration.ru>
Link: https://patch.msgid.link/20250304115643.2748-1-v.shevtsov@mt-integration.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: rt722-sdca: add missing readable registers
Bard Liao [Mon, 10 Mar 2025 08:04:40 +0000 (16:04 +0800)] 
ASoC: rt722-sdca: add missing readable registers

SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_FU15,
RT722_SDCA_CTL_FU_CH_GAIN, CH_01) ... SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY,
RT722_SDCA_ENT_FU15, RT722_SDCA_CTL_FU_CH_GAIN, CH_04) are used by the
"FU15 Boost Volume" control, but not marked as readable.
And the mbq size are 2 for those registers.

Fixes: 7f5d6036ca005 ("ASoC: rt722-sdca: Add RT722 SDCA driver")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20250310080440.58797-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: Intel: Add support for ACE3+ mic privacy
Mark Brown [Sun, 9 Mar 2025 13:42:54 +0000 (13:42 +0000)] 
ASoC: SOF: Intel: Add support for ACE3+ mic privacy

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

ACE3 (Panther Lake) introduced support for microphone privacy feature which
can - in hardware - mute incoming audio data based on a state of a physical
switch.
The change in the privacy state is delivered through interface IP blocks
and can only be handled by the link owner.
In Intel platforms Soundwire is for example host owned, so the interrupt
can only be handled by the host.

Since the input stream is going to be muted by hardware, the host needs to
send a message to firmware about the change in privacy so it can execute a
fade out/in to enhance user experience.

The support for microphone privacy can be queried from the HW_CONFIG data
under the INTEL_MIC_PRIVACY_CAP tuple. This is Intel specific data, the
core will pass it to platform code if the intel_configure_mic_privacy()
callback is provided.

Platform code can call sof_ipc4_mic_privacy_state_change() to send the IPC
message to the firmware on state change.

3 months agoASoC: dmic: add regulator support
Mark Brown [Sun, 9 Mar 2025 13:42:47 +0000 (13:42 +0000)] 
ASoC: dmic: add regulator support

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

Digital microphones may be supplied by a regulator. Add regulator
support in dmic codec, to allow power management of the regulator
through the ASoC DAPM widgets.

3 months agoASoC: dt-bindings: fsl,imx-asrc: Document audio graph port
Shengjiu Wang [Thu, 6 Mar 2025 05:31:38 +0000 (13:31 +0800)] 
ASoC: dt-bindings: fsl,imx-asrc: Document audio graph port

This device can be used in conjunction with audio-graph-card to provide
an endpoint for binding with the other side of the audio link.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: "Rob Herring (Arm)" <robh@kernel.org>
Link: https://patch.msgid.link/20250306053138.1914956-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dmic: add regulator support
Olivier Moysan [Thu, 6 Mar 2025 17:18:40 +0000 (18:18 +0100)] 
ASoC: dmic: add regulator support

Allow management of the regulator that may be used to supply the
digital microphone.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20250306171840.593443-3-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: add regulator support to dmic codec
Olivier Moysan [Thu, 6 Mar 2025 17:18:39 +0000 (18:18 +0100)] 
ASoC: dt-bindings: add regulator support to dmic codec

Add optional vref-supply property to describe the regulator supplying
the digital microphones.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Acked-by: "Rob Herring (Arm)" <robh@kernel.org>
Link: https://patch.msgid.link/20250306171840.593443-2-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: Intel: ptl: Add support for mic privacy
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:16 +0000 (13:28 +0200)] 
ASoC: SOF: Intel: ptl: Add support for mic privacy

Implement the three callbacks that is needed to enable support for
reporting the mic privacy change via soundwire.

In PTL the mic privacy reporting is supported via soundwire and DMIC and
the soundwire is owned by the host, it's interrupt is routed there.

To enable the interrupt, the sublink mask needs to be passed to the
multilink layer, the check_mic_privacy_irq/process_mic_privacy callbacks
needs to be implemented to check and report the mic privacy change.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: hda/shim: Add callbacks to handle mic privacy change for sdw
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:15 +0000 (13:28 +0200)] 
ASoC: SOF: hda/shim: Add callbacks to handle mic privacy change for sdw

Add generic callback definitions for checking the mic privacy interrupt and
status.
Implement wrappers for mic privacy reported via the Soundwire interrupt and
its vendor specific SHIM registers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: Intel: hda-mlink: Add support for mic privacy in VS SHIM registers
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:14 +0000 (13:28 +0200)] 
ASoC: SOF: Intel: hda-mlink: Add support for mic privacy in VS SHIM registers

New register has been introduced with PTL in the vendor specific SHIM
registers, outside of the IPs itself for microphone privacy status handling.

Via the PVCCS register the current microphone privacy status can be checked
and the interrupt generation on status change can be enabled/disabled.
The status change interrupt is routed to the owner of the interface
(DSP/host).

The PVCCS is provided for each sublink under the IP to make it possible to
control the interrupt generation per sublink.
On status change the MDSTSCHG bit needs to be cleared for all sublink of
the interface to be able to detect future changes in privacy.

The status bit (MDSTS) is volatile in all PVCCS register, it reflects the
current state of the GPIO signal.

Microphone privacy is a hardware feature (if enabled and configured that
way), the host has only passive, monitoring role.

The added functions are generic to be future proof if the mic privacy
support is extended beyond Soundwire and DMIC links.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: ipc4: Add support for Intel HW managed mic privacy messaging
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:13 +0000 (13:28 +0200)] 
ASoC: SOF: ipc4: Add support for Intel HW managed mic privacy messaging

ACE3 (Panther Lake) introduced support for microphone privacy feature which
can - in hardware - mute incoming audio data based on a state of a physical
switch.
The change in the privacy state is delivered through interface IP blocks
and can only be handled by the link owner.
In Intel platforms Soundwire is for example host owned, so the interrupt
can only be handled by the host.

Since the input stream is going to be muted by hardware, the host needs to
send a message to firmware about the change in privacy so it can execute a
fade out/in to enhance user experience.

The support for microphone privacy can be queried from the HW_CONFIG data
under the INTEL_MIC_PRIVACY_CAP tuple. This is Intel specific data, the
core will pass it to platform code if the intel_configure_mic_privacy()
callback is provided.

Platform code can call sof_ipc4_mic_privacy_state_change() to send the IPC
message to the firmware on state change.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: Intel: Create ptl.c as placeholder for Panther Lake features
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:12 +0000 (13:28 +0200)] 
ASoC: SOF: Intel: Create ptl.c as placeholder for Panther Lake features

Create a minimal placeholder to make it possible to add code to handle
the new features of Panther Lake compared to MTL/LNL.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: Intel: mtl: Stop exporting dsp_ops callback functions
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:11 +0000 (13:28 +0200)] 
ASoC: SOF: Intel: mtl: Stop exporting dsp_ops callback functions

There is no need to export individual dsp_ops functions anymore as the
callbacks are filled now by sof_mtl_set_ops()

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: Intel: lnl/ptl: Only set dsp_ops which differs from MTL
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:10 +0000 (13:28 +0200)] 
ASoC: SOF: Intel: lnl/ptl: Only set dsp_ops which differs from MTL

LunarLake is a next generation in ACE architecture and most of the dsp_ops
are the same as it is in previous generation.
Use the sof_mtl_set_ops() to get the ops used for mtl and update the ones
that needs different functions for LNL.

Update pci-ptl at the same time to use the LNL dsp_ops as before.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: SOF: Intel: mtl: Split up dsp_ops setup code
Peter Ujfalusi [Fri, 7 Mar 2025 11:28:09 +0000 (13:28 +0200)] 
ASoC: SOF: Intel: mtl: Split up dsp_ops setup code

Move the sof_mtl_ops and sof_mtl_ops_init() to pci-mtl.c as local static
and add a 'generic' sof_mtl_set_ops() function as replacement exported
function to fill the dsp_ops structure.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20250307112816.1495-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: amd: yc: Support mic on another Lenovo ThinkPad E16 Gen 2 model
Thomas Mizrahi [Sat, 8 Mar 2025 04:06:28 +0000 (01:06 -0300)] 
ASoC: amd: yc: Support mic on another Lenovo ThinkPad E16 Gen 2 model

The internal microphone on the Lenovo ThinkPad E16 model requires a
quirk entry to work properly. This was fixed in a previous patch (linked
below), but depending on the specific variant of the model, the product
name may be "21M5" or "21M6".

The following patch fixed this issue for the 21M5 variant:
  https://lore.kernel.org/all/20240725065442.9293-1-tiwai@suse.de/

This patch adds support for the microphone on the 21M6 variant.

Link: https://github.com/ramaureirac/thinkpad-e14-linux/issues/31
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Mizrahi <thomasmizra@gmail.com>
Link: https://patch.msgid.link/20250308041303.198765-1-thomasmizra@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: soc-dai: add snd_soc_dai_mute_is_ctrled_at_trigger()
Kuninori Morimoto [Thu, 6 Mar 2025 01:59:25 +0000 (01:59 +0000)] 
ASoC: soc-dai: add snd_soc_dai_mute_is_ctrled_at_trigger()

Adds snd_soc_dai_mute_is_ctrled_at_trigger() to judge
dai->driver->ops->mute_unmute_on_trigger flags

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/871pva6hs2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: soc-pcm: reuse dpcm_state_string()
Kuninori Morimoto [Thu, 6 Mar 2025 02:06:27 +0000 (02:06 +0000)] 
ASoC: soc-pcm: reuse dpcm_state_string()

We already have dpcm_state_string(). Let's reuse it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87y0xi52vx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: cs42l43: Fix maximum ADC Volume
Charles Keepax [Thu, 6 Mar 2025 13:32:54 +0000 (13:32 +0000)] 
ASoC: cs42l43: Fix maximum ADC Volume

The range of ADC volume is -1 -> 3 (-6 to 18dB) so the number of levels
should actually be 4.

Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250306133254.1861046-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: cs42l43: convert to SYSTEM_SLEEP_PM_OPS
Arnd Bergmann [Wed, 5 Mar 2025 17:27:32 +0000 (18:27 +0100)] 
ASoC: cs42l43: convert to SYSTEM_SLEEP_PM_OPS

The custom suspend function causes a build warning when CONFIG_PM_SLEEP
is disabled:

sound/soc/codecs/cs42l43.c:2405:12: error: unused function 'cs42l43_codec_runtime_force_suspend' [-Werror,-Wunused-function]

Change SET_SYSTEM_SLEEP_PM_OPS() to the newer SYSTEM_SLEEP_PM_OPS(),
to avoid this.

Fixes: 164b7dd4546b ("ASoC: cs42l43: Add jack delay debounce after suspend")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250305172738.3437513-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dapm: Fix changes to DECLARE_ADAU17X1_DSP_MUX_CTRL
Charles Keepax [Thu, 6 Mar 2025 10:42:33 +0000 (10:42 +0000)] 
ASoC: dapm: Fix changes to DECLARE_ADAU17X1_DSP_MUX_CTRL

The changes to DECLARE_ADAU17X1_DSP_MUX_CTRL did avoid the issue with a
compiler not liking all the macro indirection. However it introduced a
new issue with respect to the mux not being declared static:

sound/soc/codecs/adau17x1.c:275:8: sparse: sparse: symbol
'adau17x1_dac_mux' was not declared. Should it be static?
sound/soc/codecs/adau17x1.c:278:8: sparse: sparse: symbol
'adau17x1_capture_mux' was not declared. Should it be static?

Fix this up by going back to the inline declaration of the soc_enum, but
just call SOC_ENUM_EXT directly rather than indirecting through
SOC_DAPM_ENUM_EXT.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503061119.4QGlnOi6-lkp@intel.com/
Fixes: c951b20766f0 ("ASoC: dapm: Use ASoC control macros where possible")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250306104233.1638625-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Merge up fixes
Mark Brown [Wed, 5 Mar 2025 19:10:50 +0000 (19:10 +0000)] 
ASoC: Merge up fixes

Merge branch 'for-6.14' of
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into
asoc-6.15 to avoid a bunch of add/add conflicts.

3 months agoASoC: Intel: boards: updates for 6.15
Mark Brown [Wed, 5 Mar 2025 17:57:38 +0000 (17:57 +0000)] 
ASoC: Intel: boards: updates for 6.15

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

1. Add multi-function SDW mockup codec match.
2. Add couple of new codec configurations for ADL, LNL, and PTL boards.

3 months agoASoC: ops: Consistently treat platform_max as control value
Charles Keepax [Fri, 28 Feb 2025 15:14:56 +0000 (15:14 +0000)] 
ASoC: ops: Consistently treat platform_max as control value

This reverts commit 9bdd10d57a88 ("ASoC: ops: Shift tested values in
snd_soc_put_volsw() by +min"), and makes some additional related
updates.

There are two ways the platform_max could be interpreted; the maximum
register value, or the maximum value the control can be set to. The
patch moved from treating the value as a control value to a register
one. When the patch was applied it was technically correct as
snd_soc_limit_volume() also used the register interpretation. However,
even then most of the other usages treated platform_max as a
control value, and snd_soc_limit_volume() has since been updated to
also do so in commit fb9ad24485087 ("ASoC: ops: add correct range
check for limiting volume"). That patch however, missed updating
snd_soc_put_volsw() back to the control interpretation, and fixing
snd_soc_info_volsw_range(). The control interpretation makes more
sense as limiting is typically done from the machine driver, so it is
appropriate to use the customer facing representation rather than the
internal codec representation. Update all the code to consistently use
this interpretation of platform_max.

Finally, also add some comments to the soc_mixer_control struct to
hopefully avoid further patches switching between the two approaches.

Fixes: fb9ad24485087 ("ASoC: ops: add correct range check for limiting volume")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250228151456.3703342-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: soc-acpi-intel-ptl-match: add cs42l43 6x cs35l56 support
Bard Liao [Wed, 5 Mar 2025 13:54:43 +0000 (21:54 +0800)] 
ASoC: Intel: soc-acpi-intel-ptl-match: add cs42l43 6x cs35l56 support

This add a match for cs42l43 on sdw link 2, 3 cs35l56 on sdw link 1 and
3. All speakers are aggregated.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20250305135443.201884-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: soc-acpi-intel-lnl-match: add cs42l43 6x cs35l56 support
Bard Liao [Wed, 5 Mar 2025 13:54:42 +0000 (21:54 +0800)] 
ASoC: Intel: soc-acpi-intel-lnl-match: add cs42l43 6x cs35l56 support

This add a match for cs42l43 on sdw link 2, 3 cs35l56 on sdw link 1 and
3. All speakers are aggregated.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20250305135443.201884-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: soc-acpi-intel-ptl-match: add sdw multi function mockup codec
Bard Liao [Wed, 5 Mar 2025 13:54:41 +0000 (21:54 +0800)] 
ASoC: Intel: soc-acpi-intel-ptl-match: add sdw multi function mockup codec

Add a SoundWire multi function mockup codec support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250305135443.201884-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: soc-acpi-intel-lnl-match: add sdw multi function mockup codec
Bard Liao [Wed, 5 Mar 2025 13:54:40 +0000 (21:54 +0800)] 
ASoC: Intel: soc-acpi-intel-lnl-match: add sdw multi function mockup codec

Add a SoundWire multi function mockup codec support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250305135443.201884-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: add multi-function SDW mockup codec match
Bard Liao [Wed, 5 Mar 2025 13:54:39 +0000 (21:54 +0800)] 
ASoC: Intel: add multi-function SDW mockup codec match

SoundWire multi function codecs are common used in recent platforms.
Add a multi function mockup codec to test without real codec.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250305135443.201884-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: sdw_utils: add mic and amp dais to 0xaaaa codec
Bard Liao [Wed, 5 Mar 2025 13:54:38 +0000 (21:54 +0800)] 
ASoC: sdw_utils: add mic and amp dais to 0xaaaa codec

part id 0xaaaa codec is a mockup codec. Make it be a multi function
codec. So that we can test multi function with a mockup codec.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250305135443.201884-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: soc-acpi-intel-ptl-match: add rt713_vb_l3_rt1320_l12 support
Peter Ujfalusi [Wed, 5 Mar 2025 13:54:37 +0000 (21:54 +0800)] 
ASoC: Intel: soc-acpi-intel-ptl-match: add rt713_vb_l3_rt1320_l12 support

Add rt713_vb on SDW link 3 and 2 rt1320 on SDW link 1 and 2 configuration
support.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250305135443.201884-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: soc-acpi-intel-ptl-match: add rt712_vb_l3_rt1320_l2 support
Peter Ujfalusi [Wed, 5 Mar 2025 13:54:36 +0000 (21:54 +0800)] 
ASoC: Intel: soc-acpi-intel-ptl-match: add rt712_vb_l3_rt1320_l2 support

Add rt712_vb on SDW link 3 and 1 rt1320 on SDW link 2 configuration
support.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250305135443.201884-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Intel: adl: add 2xrt1316 audio configuration
Bard Liao [Wed, 5 Mar 2025 13:54:35 +0000 (21:54 +0800)] 
ASoC: Intel: adl: add 2xrt1316 audio configuration

That is a speaker only configuration and 2 rt1316 are on link 0 and 2.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250305135443.201884-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: rt1320: set wake_capable = 0 explicitly
Bard Liao [Wed, 5 Mar 2025 13:41:13 +0000 (21:41 +0800)] 
ASoC: rt1320: set wake_capable = 0 explicitly

"generic_new_peripheral_assigned: invalid dev_num 1, wake supported 1"
is reported by our internal CI test.

Rt1320's wake feature is not used in Linux and that's why it is not in
the wake_capable_list[] list in intel_auxdevice.c.
However, BIOS may set it as wake-capable. Overwrite wake_capable to 0
in the codec driver to align with wake_capable_list[].

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20250305134113.201326-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: soc-pcm: merge soc_pcm_hw_update_format/subformat()
Kuninori Morimoto [Wed, 5 Mar 2025 00:12:52 +0000 (00:12 +0000)] 
ASoC: soc-pcm: merge soc_pcm_hw_update_format/subformat()

format() and subformat() should be handled in the same time, no need to
have each functions. Let's merge these

soc_pcm_hw_update_format()
soc_pcm_hw_update_subformat()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/87v7soz664.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: doc: use SND_SOC_DAILINK_xxx() macro
Kuninori Morimoto [Wed, 5 Mar 2025 00:24:06 +0000 (00:24 +0000)] 
ASoC: doc: use SND_SOC_DAILINK_xxx() macro

We can use SND_SOC_DAILINK_xxx() macro to define CPU/Codec/Platform.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87tt88z5nd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: fsl_audmix: support audio graph card for audmix
Mark Brown [Tue, 4 Mar 2025 18:38:42 +0000 (18:38 +0000)] 
ASoC: fsl_audmix: support audio graph card for audmix

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

Change 'dais' property to be optional, that fsl_audmix device can be
linked with SAI device by audio graph card.

3 months agoASoC: Tidy up SOC_DOUBLE_* and SOC_SINGLE_* helpers
Charles Keepax [Tue, 4 Mar 2025 14:05:00 +0000 (14:05 +0000)] 
ASoC: Tidy up SOC_DOUBLE_* and SOC_SINGLE_* helpers

Re-implement SOC_DOUBLE_VALUE() in terms of SOC_DOUBLE_S_VALUE().
SOC_DOUBLE_S_VALUE() already had a minimum value so add this to
SOC_DOUBLE_VALUE as well, this allows replacement of several hard coded
value entries. Likewise update SOC_SINGLE_VALUE to match, which allows
replacement of even more hard coded values.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250304140500.976127-14-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoTidy up ASoC VALUE control macros
Mark Brown [Tue, 4 Mar 2025 15:47:02 +0000 (15:47 +0000)] 
Tidy up ASoC VALUE control macros

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

Tidy up the ASoC control value macros. Fix some drivers that should be
using core macros that aren't, combine the existing core macros to be
a little more consistent in style, and update the core macros to use
each other where possible.

3 months agoASoC: samsung: GPIO descriptor conversion
Mark Brown [Tue, 4 Mar 2025 14:43:59 +0000 (14:43 +0000)] 
ASoC: samsung: GPIO descriptor conversion

Merge series from Linus Walleij <linus.walleij@linaro.org>:

This drops unused includes and converts one Samsung
codec to use GPIO descriptors.

3 months agoASoC: codecs: Update device_id tables for Realtek
Mark Brown [Tue, 4 Mar 2025 14:43:55 +0000 (14:43 +0000)] 
ASoC: codecs: Update device_id tables for Realtek

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

The series aims to streamline the formatting for ACPI IDs so that a
single pattern can be used to identify the device.

Work implicitly suggested by Andy Shevchenko - reading and learning from
number of his reviews on the Linux mailing lists.

Several formats do exists, however, after technical discussion PCI-based
format has been selected as the recommended one. For Realtek devices, it
is going to be 10ECxxxx where 10EC unambiguously identifies Realtek
company whereas the following 4 hexes specify the PART_ID i.e.: the
device.

While at it, there shall be no comma after the terminator entry and
initializing fields with 0 for statically defined structs is redundant.

3 months agoASoC: use inclusive language for
Mark Brown [Tue, 4 Mar 2025 14:43:50 +0000 (14:43 +0000)] 
ASoC: use inclusive language for

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

We have both

(A) SND_SOC_DAIFMT_CB{M/S}_CF{M/S} : Master/Slave.
(B) SND_SOC_DAIFMT_CB{P/C}_CF{P/S} : Provider/Consumer

We should use (B), and want to remove (A). This patch-set do it.

3 months agoASoC: audio-graph-card2-custom-sample: Separate Sample
Mark Brown [Tue, 4 Mar 2025 14:43:46 +0000 (14:43 +0000)] 
ASoC: audio-graph-card2-custom-sample: Separate Sample

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

audio-graph-card2-custom-sample has many sample connections, but because
ALSA card has number limition for links, it is impossible to have all
samples into 1 ASoC card.

This patch-set separate sample DT into 2 parts, and remove original sample.
Because of this separation, we can see all sample connection via multi Card.

- for normal
- for DPCM/Codec2Codec

3 months agoASoC: cs42l43: Add jack delay debounce after suspend
Maciej Strozek [Tue, 4 Mar 2025 14:05:04 +0000 (14:05 +0000)] 
ASoC: cs42l43: Add jack delay debounce after suspend

Hardware reports jack absent after reset/suspension regardless of jack
state, so introduce an additional delay only in suspension case to allow
proper detection to take place after a short delay.

Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250304140504.139245-1-mstrozek@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: tm2_wm5110: Drop unused include
Linus Walleij [Mon, 3 Mar 2025 08:41:46 +0000 (09:41 +0100)] 
ASoC: samsung: tm2_wm5110: Drop unused include

This file does not use the symbols from the legacy
<linux/gpio.h> header, so let's drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250303-samsung-codecs-v1-6-56a2299dd928@linaro.org
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: tobermory: Drop unused include
Linus Walleij [Mon, 3 Mar 2025 08:41:45 +0000 (09:41 +0100)] 
ASoC: samsung: tobermory: Drop unused include

This file does not use the symbols from the legacy
<linux/gpio.h> header, so let's drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250303-samsung-codecs-v1-5-56a2299dd928@linaro.org
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: speyside: Convert to GPIO descriptor
Linus Walleij [Mon, 3 Mar 2025 08:41:44 +0000 (09:41 +0100)] 
ASoC: samsung: speyside: Convert to GPIO descriptor

The Speyside ASoC uses a single GPIO from the WM8996
that we can provide from the local offset on that chip
rather than from the global GPIO numberspace as is being
done currently.

The offset 2 was done by calculating the base offset
for the CODEC (i.e. wm8996) GPIOs to 212, by reading
arch/arm/mach-s3c/gpio-samsung-s3c64xx.h and
arch/arm/mach-s3c/crag6410.h and adding up all the
offsets that were occasionally adding a +1 blank GPIO
between each GPIO provider.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250303-samsung-codecs-v1-4-56a2299dd928@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: lowland: Drop unused include
Linus Walleij [Mon, 3 Mar 2025 08:41:43 +0000 (09:41 +0100)] 
ASoC: samsung: lowland: Drop unused include

This file does not use the symbols from the legacy
<linux/gpio.h> header, so let's drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250303-samsung-codecs-v1-3-56a2299dd928@linaro.org
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: littlemill: Drop unused include
Linus Walleij [Mon, 3 Mar 2025 08:41:42 +0000 (09:41 +0100)] 
ASoC: samsung: littlemill: Drop unused include

This file does not use the symbols from the legacy
<linux/gpio.h> header, so let's drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250303-samsung-codecs-v1-2-56a2299dd928@linaro.org
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: samsung: bells: Drop unused include
Linus Walleij [Mon, 3 Mar 2025 08:41:41 +0000 (09:41 +0100)] 
ASoC: samsung: bells: Drop unused include

This file does not use the symbols from the legacy
<linux/gpio.h> header, so let's drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250303-samsung-codecs-v1-1-56a2299dd928@linaro.org
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: everest,es8328: Require reg property
Krzysztof Kozlowski [Tue, 4 Mar 2025 10:38:08 +0000 (11:38 +0100)] 
ASoC: dt-bindings: everest,es8328: Require reg property

ES8328 and ES8388 codecs are I2C or SPI devices, thus they are
addressable on their bus and 'reg' property should be always provided.
Requiring 'reg' is pretty close to redundant, because the I2C and SPI
controller/bus bindings require it already, but the convention is to
mention 'reg' also in the device schemas.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250304103808.75236-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: dt-bindings: everest,es8328: Mark ES8388 compatible with ES8328
Krzysztof Kozlowski [Tue, 4 Mar 2025 10:38:07 +0000 (11:38 +0100)] 
ASoC: dt-bindings: everest,es8328: Mark ES8388 compatible with ES8328

Based on Linux driver, the ES8388 looks fully compatible with ES8328.
One upstream DTS (ARM rk3288-rock2-square.dts) already uses ES8328
fallback, so mark the devices as compatible in the binding.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250304103808.75236-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name
Louis-Alexis Eyraud [Fri, 28 Feb 2025 10:32:19 +0000 (11:32 +0100)] 
ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name

A recent dtbs_check error fix in mt6359.dtsi file changed a node name
(from "mt6359codec" to "audio-codec") without modifying the mt6539
codec code that uses it.
It leads to a probe failure after devicetree parsing returns in error:
```
[    1.354025] mt6359-sound mt6359-sound: mt6359_platform_driver_probe() failed to parse dts
[    1.355066] mt6359-sound mt6359-sound: probe with driver mt6359-sound failed with error -22
```

So, add the child node retrieval with the new name and if not found,
try with the older one for backward compatibility.

Fixes: 76b35f59bbe6 ("arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec")
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://patch.msgid.link/20250228-mt6359-fix-probe-failed-v1-1-64941d387b2c@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 months agoASoC: Tidy up SOC_DOUBLE_R_* helpers
Charles Keepax [Mon, 3 Mar 2025 17:14:23 +0000 (17:14 +0000)] 
ASoC: Tidy up SOC_DOUBLE_R_* helpers

Re-implement SOC_DOUBLE_R_VALUE() in terms of SOC_DOUBLE_R_S_VALUE().
SOC_DOUBLE_R_S_VALUE() already had a minimum value so add this to
SOC_DOUBLE_R_VALUE() as well, which makes SOC_DOUBLE_R_RANGE_VALUE()
redundant, so its usage is replaced.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250303171424.444556-13-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
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>