]> www.infradead.org Git - users/dwmw2/linux.git/log
users/dwmw2/linux.git
5 months agoASoC: SOF: ipc4-topology: remove redundant assignment to variable ret
Colin Ian King [Wed, 13 Nov 2024 13:08:07 +0000 (13:08 +0000)]
ASoC: SOF: ipc4-topology: remove redundant assignment to variable ret

The variable ret is being assigned a zero value however the value is
never read because ret is being re-assigned later after the end of
the switch statement. The assignment is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20241113130807.1386754-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: simple-card-utils: care simple_util_dai for dummy DAI
Kuninori Morimoto [Tue, 12 Nov 2024 02:39:44 +0000 (02:39 +0000)]
ASoC: simple-card-utils: care simple_util_dai for dummy DAI

Simple Card Utils has simple_util_dai which is paired to snd_soc_dai,
and assmus that CPU/Codec DAI and its paired simple_util_dai are same
order for CPU/Codec

simple_util_dai[0] <--> snd_soc_dai[0]
simple_util_dai[1] <--> snd_soc_dai[1]
...

So, it is using same index in for_each loop.

(X) gets simple_util_dai
(Y) gets snd_soc_dai

(Y) for_each_rtd_cpu_dais(.., i, ..) {
(X)(A) udai = simple_props_to_dai_cpu(.., i);
}

(X) for_each_prop_dai_cpu(.., i, ...) {
(Y) dai = snd_soc_rtd_to_cpu(.., i);
...
}

But current Simple Card Utils didn't have simple_util_dai for
dummy DAI. So above (A) will get NULL pointer in such case.
This patch cares simple_util_dai for dummy DAI.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87msi5maz3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: test-component: Support continuous rates for test component
John Watts [Tue, 12 Nov 2024 10:34:00 +0000 (21:34 +1100)]
ASoC: test-component: Support continuous rates for test component

There's no reason to limit the supported rates of the test component
to specific ones as if it's a real piece of hardware. Set the rates to
continuous to aid in testing different rates.

Signed-off-by: John Watts <contact@jookia.org>
Link: https://patch.msgid.link/20241112-alsa_test_rates-v1-1-95cf529db871@jookia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: max98088: Add headphone mixer switch
Marek Vasut [Mon, 11 Nov 2024 16:55:04 +0000 (17:55 +0100)]
ASoC: max98088: Add headphone mixer switch

Add enable/disable headphone output mixers knob.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20241111165523.113142-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: max98088: Add left/right DAC volume control
Marek Vasut [Mon, 11 Nov 2024 16:54:04 +0000 (17:54 +0100)]
ASoC: max98088: Add left/right DAC volume control

Add left/right DAC digital volume control knob.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20241111165435.113086-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoc: SOF: ipc4-pcm: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
Suraj Sonawane [Thu, 7 Nov 2024 06:36:09 +0000 (12:06 +0530)]
ASoc: SOF: ipc4-pcm: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate

Fix an issue detected by the Smatch tool:

sound/soc/sof/ipc4-pcm.c: sof_ipc4_pcm_dai_link_fixup_rate()
error: uninitialized symbol 'be_rate'.

The warning highlights a case where `be_rate` could remain uninitialized
if `num_input_formats` is zero, which would cause undefined behavior
when setting `rate->min` and `rate->max` based on `be_rate`.

To address this issue, a `WARN_ON_ONCE(!num_input_formats)` check was
added to ensure `num_input_formats` is greater than zero. If this
condition fails, the function returns `-EINVAL`, preventing the use of
an uninitialized `be_rate`.

This change improves the robustness of the function by catching an
invalid state early and providing better feedback during development.

Signed-off-by: Suraj Sonawane <surajsonawane0215@gmail.com>
Link: https://patch.msgid.link/20241107063609.11627-1-surajsonawane0215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: stm32: add missing port property
Olivier Moysan [Tue, 5 Nov 2024 13:59:41 +0000 (14:59 +0100)]
ASoC: dt-bindings: stm32: add missing port property

Add missing port property in STM32 SPDIFRX binding.
This will prevent potential warning:
Unevaluated properties are not allowed ('port' was unexpected)

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20241105135942.526624-1-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: add symmetric_ prefix for dai->rate/channels/sample_bits
Kuninori Morimoto [Wed, 6 Nov 2024 00:10:44 +0000 (00:10 +0000)]
ASoC: add symmetric_ prefix for dai->rate/channels/sample_bits

snd_soc_dai has rate/channels/sample_bits parameter, but it is only valid
if symmetry is being enforced by symmetric_xxx flag on driver.

It is very difficult to know about it from current naming, and easy to
misunderstand it. add symmetric_ prefix for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87zfmd8bnf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: max98088: Remove duplicate DACs
Marek Vasut [Fri, 8 Nov 2024 23:53:47 +0000 (00:53 +0100)]
ASoC: max98088: Remove duplicate DACs

This codec only has one set of left and right DACs, remove the duplicate
DACs with duplicated bits controlling them as the userspace can set those
controls to mismatched value. This most likely does break userspace ABI,
but there seem to be no in-kernel users.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20241108235453.196289-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: machine: update documentation
anish kumar [Sat, 9 Nov 2024 19:22:31 +0000 (11:22 -0800)]
ASoC: machine: update documentation

1. Added clocking details.
2. Updated ways to register the dai's
3. Bit more detail about card registration details.

Signed-off-by: anish kumar <yesanishhere@gmail.com>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Link: https://patch.msgid.link/20241109192231.11623-1-yesanishhere@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: stm32: i2s: add stm32mp25 support
Mark Brown [Sat, 9 Nov 2024 01:49:05 +0000 (01:49 +0000)]
ASoC: stm32: i2s: add stm32mp25 support

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

Update STM32 I2S driver and binding to support STM32MP25 SoCs.

5 months agoASoC: stm32: sai: add stm32mp25 support
Mark Brown [Sat, 9 Nov 2024 01:48:58 +0000 (01:48 +0000)]
ASoC: stm32: sai: add stm32mp25 support

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

Update STM32 SAI driver and binding to support STM32MP25 SoCs.

5 months agoASoC: Intel: Fix Kconfig for ACPI=n
Mark Brown [Sat, 9 Nov 2024 01:48:51 +0000 (01:48 +0000)]
ASoC: Intel: Fix Kconfig for ACPI=n

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

Hi,

A recent attempt to fix a missing symbol when
CONFIG_SND_SOC_SDCA=m and CONFIG_SND_SOC_ACPI_INTEL_SDCA_QUIRKS=y
caused unmet direct dependency warning with randconig.

The reason is that SND_SOC_ACPI_INTEL_MATCH is needed to be compilable
even if ACPI is not selected, modules have dependency on exported
symbols from it.

The only solution for these kconfig dependencies seams to be to
only select SND_SOC_SDCA if ACPI is enabled  from
SND_SOC_ACPI_INTEL_SDCA_QUIRKS.

Regards,
Peter
---
Peter Ujfalusi (2):
  ASoC: Intel: Kconfig: Only select SND_SOC_SDCA if ACPI is enabled
  ASoC: Intel: Kconfig: Revert make SND_SOC_ACPI_INTEL_MATCH depend on
    ACPI

 sound/soc/intel/Kconfig | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--
2.47.0

5 months agoASoC: qcom: sm8250: add handling of secondary MI2S clock
Alexey Klimov [Fri, 18 Oct 2024 02:54:47 +0000 (03:54 +0100)]
ASoC: qcom: sm8250: add handling of secondary MI2S clock

Add handling of clock related to secondary MI2S_RX in
sm8250_snd_startup().

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Link: https://patch.msgid.link/20241018025452.1362293-2-alexey.klimov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: Kconfig: Revert make SND_SOC_ACPI_INTEL_MATCH depend on ACPI
Peter Ujfalusi [Thu, 7 Nov 2024 10:02:04 +0000 (12:02 +0200)]
ASoC: Intel: Kconfig: Revert make SND_SOC_ACPI_INTEL_MATCH depend on ACPI

The acpi-intel-match should be compiled even if ACPI is not selected.
The ACPI is not compile time requirement, but the exported symbols are
needed for other modules.

Fixes: b6bd3f3b6357 ("ASoC: Intel: Kconfig: make SND_SOC_ACPI_INTEL_MATCH depend on ACPI")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411070806.UhCRpZok-lkp@intel.com/
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241107100204.24952-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: Kconfig: Only select SND_SOC_SDCA if ACPI is enabled
Peter Ujfalusi [Thu, 7 Nov 2024 10:02:03 +0000 (12:02 +0200)]
ASoC: Intel: Kconfig: Only select SND_SOC_SDCA if ACPI is enabled

The SDCA module have hard dependency to compile on ACPI, it can only be
selected if ACPI is also enabled.
The SDCA header provides inline prototypes for other modules to compile in
case SND_SOC_SDCA is not enabled.

Fixes: 845cb1ddf1fc ("ASoC: Intel: Kconfig: select SND_SOC_SDCA by SND_SOC_ACPI_INTEL_SDCA_QUIRKS")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411070806.UhCRpZok-lkp@intel.com/
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241107100204.24952-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sma1307: Fix invalid logical judgement
Tang Bin [Fri, 8 Nov 2024 01:16:17 +0000 (09:16 +0800)]
ASoC: sma1307: Fix invalid logical judgement

In the function sma1307_dai_hw_params_amp, the variable
'ret' has not been assigned a value, so the logical judgement
is invalid, thus fix it.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241108011617.2284-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: mediatek: mt8183: Remove unnecessary variable assignments
Tang Bin [Fri, 25 Oct 2024 09:09:38 +0000 (17:09 +0800)]
ASoC: mediatek: mt8183: Remove unnecessary variable assignments

In the function mt8183_dai_i2s_register, the variable
'ret' is redundant, thus remove it.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241025090938.3480-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: stm32: i2s: add stm32mp25 support
Olivier Moysan [Thu, 7 Nov 2024 14:47:12 +0000 (15:47 +0100)]
ASoC: stm32: i2s: add stm32mp25 support

Add STM32MP25 support for STM32 I2S.

On STM32MP25 the I2S driver does not manage I2S kernel clock rate
by choosing its parent clock, depending on audio stream rate.

The driver requests a rate change on I2S kernel clock instead.
It tries to set the higher possible rate, which is a multiple of
the audio stream rate and which gives an accuracy of at least 1000 ppm.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20241107144712.1305638-3-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: add stm32mp25 support for i2s
Olivier Moysan [Thu, 7 Nov 2024 14:47:11 +0000 (15:47 +0100)]
ASoC: dt-bindings: add stm32mp25 support for i2s

Add STM32MP25 support for STM32 I2S peripheral,
through "st,stm32mp25-i2s" compatible.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241107144712.1305638-2-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: stm32: sai: add stm32mp25 support
Olivier Moysan [Thu, 7 Nov 2024 15:51:42 +0000 (16:51 +0100)]
ASoC: stm32: sai: add stm32mp25 support

Add STM32MP25 support for STM32 SAI.

On STM32MP25 the SAI driver does not manage SAI kernel clock rate
by chosing its parent clock, dependending on audio stream rate.

The driver requests a rate change on SAI kernel clock instead.
This rate change is performed with the following guidelines:
- Chose highest rate multiple of the audio stream
  (Try to get clock accuracy within 1000 ppm)
- Ensure clock rate compatibility between SAI sub-blocks A&B
  and between instances sharing the same flexgen.
  Use clk_rate_exclusive API to fulfill this requirement.

The STM32 SAI peripheral does not support the DMA burst mode
on STM32MP25. Add a field in compatible structure to manage DMA
burst support capability.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20241107155143.1340523-3-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: add stm32mp25 support for sai
Olivier Moysan [Thu, 7 Nov 2024 15:51:41 +0000 (16:51 +0100)]
ASoC: dt-bindings: add stm32mp25 support for sai

Add STM32MP25 support for STM32 SAI peripheral,
through "st,stm32mp25-sai" compatible.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241107155143.1340523-2-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoAdd a driver for the Iron Device SMA1307 Amp
Mark Brown [Thu, 7 Nov 2024 20:37:31 +0000 (20:37 +0000)]
Add a driver for the Iron Device SMA1307 Amp

Merge series from Kiseok Jo <kiseok.jo@irondevice.com>:

This adds basic audio support for the Iron Device SMA1307 amplifier

5 months agoASoC: SOF: ipc3-loader: Handle PROBE_INFO ext_manifest
Mark Brown [Thu, 7 Nov 2024 20:37:24 +0000 (20:37 +0000)]
ASoC: SOF: ipc3-loader: Handle PROBE_INFO ext_manifest

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

The PROBE_INFO (ext_manifest type 3) is not used by the kernel, but
at every tiem the firmware is loaded the following is printed in
info level (user visible):
unknown sof_ext_man header type 3 size 0x30

The type is known, but it is not handled, the print is misleading.

5 months agoASoC: ux500: Remove redundant casts
Tang Bin [Thu, 7 Nov 2024 07:54:40 +0000 (15:54 +0800)]
ASoC: ux500: Remove redundant casts

In the function ux500_msp_drv_probe, the 'int' type cast
in front of the PTR_ERR() macro is redundant, thus remove
it.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241107075440.2770-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: handle only paused streams in hda_dai_suspend()
Ranjani Sridharan [Thu, 7 Nov 2024 13:49:57 +0000 (15:49 +0200)]
ASoC: SOF: Intel: hda: handle only paused streams in hda_dai_suspend()

hda_dai_suspend() was added to handle paused stream during system
suspend. But as a side effect, it also ends up cleaning up the DMA
data for those streams that were prepared but not triggered before a
system suspend. Since these streams will not receive the prepare
callback after resuming, we need to preserve the DMA data during suspend.
So, add the check to handle only those streams that are in the paused
state to avoid losing the DMA data for all other streams.

Link: https://github.com/thesofproject/linux/issues/5080
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Fred Oh <fred.oh@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20241107134957.25160-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: Add support for persistent Code Loader DMA buffers
Peter Ujfalusi [Thu, 7 Nov 2024 12:14:40 +0000 (14:14 +0200)]
ASoC: SOF: Intel: hda: Add support for persistent Code Loader DMA buffers

It has been reported that the DMA memory allocation for firmware download
can fail after extended period of uptime on systems with relatively small
amount of RAM when the system memory becomes fragmented.

The issue primarily happens  when the system is waking up from system
suspend, swap might not be available and the MM system cannot move things
around to allow for successful allocation.

If the IMR boot is not supported then for each DSP boot we would need to
allocate the DMA buffer for firmware transfer, which can increase the
chances of the issue to be hit.

This patch adds support for allocating the DMA buffers once at first boot
time and keep it until the system is shut down, rebooted or the drivers
re-loaded and makes this as the default operation.

With persistent_cl_buffer module parameter the persistent Code Loader
DMA buffer can be disabled to fall back to on demand allocation.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@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/20241107121440.1472-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-stream: Always use at least two BDLE for transfers
Peter Ujfalusi [Thu, 7 Nov 2024 12:15:32 +0000 (14:15 +0200)]
ASoC: SOF: Intel: hda-stream: Always use at least two BDLE for transfers

The HDA specification states that the SDnLVI (Last Valid Index) must be at
least 1 (two BDLE entry).

Update the debug prints as well to provide better information.

While the LVI=0 worked so far without issues, it is better to align with
the specification to avoid unforeseen issues with FW loading.

Notes:
- The LVI > 0 rules is valid and honored for audio use cases
- LVI == 0 is used with software controlled (SPIB) transfers only for
  firmware and library loading, which is permitted by the hardware
- This is not spelled out in the specification and it is better to avoid
  cases

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241107121532.3241-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: ipc3-loader: 'Handle' PROBE_INFO ext_manifest type when parsing
Peter Ujfalusi [Thu, 7 Nov 2024 12:03:06 +0000 (14:03 +0200)]
ASoC: SOF: ipc3-loader: 'Handle' PROBE_INFO ext_manifest type when parsing

Every time when the firmware is loaded we see the following printed in
info level:
unknown sof_ext_man header type 3 size 0x30

This is the PROBE_INFO element, which is not parsed, but it is not
something that we should treat as surprise, aka unknown type.

Add an empty case with a debug print to 'handle' this ext_manifest type and
silence the confusing print in kernel log.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241107120306.30680-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: ext_manifest: Add missing ext_manifest type for PROBE_INFO
Peter Ujfalusi [Thu, 7 Nov 2024 12:03:05 +0000 (14:03 +0200)]
ASoC: SOF: ext_manifest: Add missing ext_manifest type for PROBE_INFO

Elem type 3 is PROBE_INFO in ext_manifest, add it to the list.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241107120306.30680-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: Kconfig: fix undefined symbol:
Mark Brown [Thu, 7 Nov 2024 00:22:05 +0000 (00:22 +0000)]
ASoC: Intel: Kconfig: fix undefined symbol:

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

Fix the ld.lld: error: undefined symbol: sdca_device_quirk_match issue
when CONFIG_SND_SOC_SDCA=m and CONFIG_SND_SOC_ACPI_INTEL_SDCA_QUIRKS=y.

5 months agoASoC: da7213: Extend support for the MCK in range [2, 50] MHz
Hao Bui [Wed, 6 Nov 2024 08:18:21 +0000 (10:18 +0200)]
ASoC: da7213: Extend support for the MCK in range [2, 50] MHz

According to DA7212 HW manual, the codec's PLL input divider can operate
with MCLK range from 2MHz to 50MHz but current driver only set the
minimum supported MCLK frequency to 5MHz. That cause 11.025kHz audio
which is corresponding to MCLK of 2.8224MHz (11.025kHz * 256) unable to
play in case audio-simple-card is used.

Signed-off-by: Hao Bui <hao.bui.yg@renesas.com>
Co-developed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241106081826.1211088-27-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: da7213: Avoid setting PLL when closing audio stream
Hao Bui [Wed, 6 Nov 2024 08:18:20 +0000 (10:18 +0200)]
ASoC: da7213: Avoid setting PLL when closing audio stream

When audio stream is closing, audio frequency is set to 0 by ALSA but
codec driver DA7213 does not handle properly in this case. This patch
adds checking of 0Hz frequency to da7213_set_component_sysclk() and avoid
unnecessary PLL settings.

Signed-off-by: Hao Bui <hao.bui.yg@renesas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241106081826.1211088-26-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: da7213: Add suspend to RAM support
Claudiu Beznea [Wed, 6 Nov 2024 08:18:19 +0000 (10:18 +0200)]
ASoC: da7213: Add suspend to RAM support

Add suspend to RAM support. This uses the already available runtime PM
support.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241106081826.1211088-25-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: da7213: Return directly the value of regcache_sync()
Claudiu Beznea [Wed, 6 Nov 2024 08:18:18 +0000 (10:18 +0200)]
ASoC: da7213: Return directly the value of regcache_sync()

Return directly the value of the regcache_sync() in
da7213_runtime_resume(). In case of any failures this will inform the
runtime resume process.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241106081826.1211088-24-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: da7213: Populate max_register to regmap_config
Claudiu Beznea [Wed, 6 Nov 2024 08:18:17 +0000 (10:18 +0200)]
ASoC: da7213: Populate max_register to regmap_config

On the Renesas RZ/G3S SMARC Carrier II board having a DA7212 codec (using
da7213 driver) connected to one SSIF-2 available on the Renesas RZ/G3S SoC
it has been discovered that using the runtime PM API for suspend/resume
(as will be proposed in the following commits) leads to the codec not
being propertly initialized after resume. This is because w/o
max_register populated to regmap_config the regcache_rbtree_sync()
breaks on base_reg > max condition and the regcache_sync_block() call is
skipped.

Fixes: ef5c2eba2412 ("ASoC: codecs: Add da7213 codec")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241106081826.1211088-23-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: maxim,max98390: Reference common DAI properties
Fei Shao [Tue, 5 Nov 2024 09:14:31 +0000 (17:14 +0800)]
ASoC: dt-bindings: maxim,max98390: Reference common DAI properties

MAX98390 is a smart amplifier and exposes one DAI, so '#sound-dai-cells'
property is needed for describing the DAI links.

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

This fixes dtbs_check error:
  '#sound-dai-cells' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241105091513.3963102-1-fshao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sma1307: Add driver for Iron Device SMA1307
Kiseok Jo [Wed, 6 Nov 2024 00:58:00 +0000 (09:58 +0900)]
ASoC: sma1307: Add driver for Iron Device SMA1307

The Iron Device SMA1307 is a boosted digital speaker amplifier

Signed-off-by: Kiseok Jo <kiseok.jo@irondevice.com>
Link: https://patch.msgid.link/20241106005800.7520-3-kiseok.jo@irondevice.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: irondevice,sma1307: Add initial DT
Kiseok Jo [Wed, 6 Nov 2024 00:57:59 +0000 (09:57 +0900)]
ASoC: dt-bindings: irondevice,sma1307: Add initial DT

This adds the schema binding for the Iron Device SMA1307 Amp

Signed-off-by: Kiseok Jo <kiseok.jo@irondevice.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241106005800.7520-2-kiseok.jo@irondevice.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: Kconfig: select SND_SOC_SDCA by SND_SOC_ACPI_INTEL_SDCA_QUIRKS
Bard Liao [Wed, 6 Nov 2024 05:58:10 +0000 (13:58 +0800)]
ASoC: Intel: Kconfig: select SND_SOC_SDCA by SND_SOC_ACPI_INTEL_SDCA_QUIRKS

SND_SOC_SDCA can't be optional when SND_SOC_ACPI_INTEL_SDCA_QUIRKS is
selected. IS_REACHABLE can prevent the link error. However it is not
suitable for this case. When CONFIG_SND_SOC_ACPI_INTEL_SDCA_QUIRKS is
Y and CONFIG_SND_SOC_SDCA is M, the SDCA helpers will be empty and
return false. But we need the helpers to do their jobs whenSND_SOC_SDCA
is M.
IOW, the SDCA library is not optional for Intel platforms where the
SDCA_QUIRK is selected.
Also, make SND_SOC_SDCA invisible. SND_SOC_SDCA should be selected if
a device supports SDCA. User should not unselect it.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411021722.DiX1Y5sf-lkp@intel.com/
Suggested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241106055810.10123-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: Kconfig: make SND_SOC_ACPI_INTEL_MATCH depend on ACPI
Bard Liao [Wed, 6 Nov 2024 05:58:09 +0000 (13:58 +0800)]
ASoC: Intel: Kconfig: make SND_SOC_ACPI_INTEL_MATCH depend on ACPI

SND_SOC_ACPI_INTEL_MATCH relies on ACPI functions. It will not work
if ACPI is not selected.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241106055810.10123-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: Add aw88081 amplifier driver
Mark Brown [Tue, 5 Nov 2024 18:15:53 +0000 (18:15 +0000)]
ASoC: codecs: Add aw88081 amplifier driver

Merge series from wangweidong.a@awinic.com:

Add the awinic,aw88081 property to support the aw88081 chip.

The driver is for amplifiers aw88081 of Awinic Technology
Corporation. The awinic AW88081 is an I2S/TDM input,
high efficiency digital Smart K audio amplifier

5 months agoSoundwire dai link init logic refactor
Mark Brown [Tue, 5 Nov 2024 18:15:46 +0000 (18:15 +0000)]
Soundwire dai link init logic refactor

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

This patch series refactors the SoundWire dai link init logic for Intel
and AMD generic SoundWire machine driver and also updates the stream_name
in dai_links structure.

Link: https://github.com/thesofproject/linux/pull/5218
5 months agoASoC: cleasnup rtd and its ID
Mark Brown [Tue, 5 Nov 2024 18:15:39 +0000 (18:15 +0000)]
ASoC: cleasnup rtd and its ID

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

rtd has own ID, but it is naming "num" for it. The naming is confusable.
This patch rename it to "id".
And many functions request both "rtd" and its "id" as function parameter,
but rtd itself has rtd->id. This patch cleanup it.

And, Qcom driver want to use irregular rtd ID because of its topology,
and thus, soc-core need irregular calculation. I'm not sure why only Qcom
needs such calculation, but this patch also cleanup it.
But I guess we want to cleanup is not soc-core but Qcom side (?)

5 months agoASoC: dt-bindings: everest,es8326: Document interrupt property
Fei Shao [Tue, 5 Nov 2024 09:18:11 +0000 (17:18 +0800)]
ASoC: dt-bindings: everest,es8326: Document interrupt property

The ES8326 audio codec has one interrupt pin for headset detection
according to the datasheet. Document that in the binding.

This fixes dtbs_check error:
  'interrupts-extended' does not match any of the regexes:
  'pinctrl-[0-9]+'

Signed-off-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20241105091910.3984381-1-fshao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt721-sdca: change interrupt mask from XU to GE
Jack Yu [Tue, 5 Nov 2024 08:51:32 +0000 (08:51 +0000)]
ASoC: rt721-sdca: change interrupt mask from XU to GE

Change interrupt mask from XU to GE to fix jack detection
interrupt issue.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://patch.msgid.link/cbc81e324673467a96b70e4e219766b5@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: Add mediatek,adsp property
Fei Shao [Tue, 5 Nov 2024 09:11:36 +0000 (17:11 +0800)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: Add mediatek,adsp property

On some MediaTek SoCs, an Audio DSP (ADSP) is integrated as a separate
hardware block that leverages Sound Open Firmware (SOF) and provides
additional audio functionalities. This hardware is optional, and the
audio subsystem will still function normally when it's not present.

To enable ADSP support, a 'mediatek,adsp' property is required in the
sound card node to pass the ADSP phandle. This allows AFE to link to
ADSP when the sound card is probed.

MT8188 has ADSP integrated, so add the 'mediatek,adsp' property to
allow using it in the audio subsystem.

This fixes dtbs_check error:
  Unevaluated properties are not allowed ('mediatek,adsp' was
  unexpected)

Signed-off-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20241105091246.3944946-1-fshao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Add missing quirks from some new Dell
Deep Harsora [Tue, 5 Nov 2024 11:10:56 +0000 (19:10 +0800)]
ASoC: Intel: sof_sdw: Add missing quirks from some new Dell

Add missing quirks for some new Dell laptops using cs42l43's speaker
outputs.

Signed-off-by: Deep Harsora <deep_harsora@dell.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20241105111057.182076-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt722: change the interrupt mask for jack type detection
Shuming Fan [Tue, 5 Nov 2024 10:05:57 +0000 (18:05 +0800)]
ASoC: rt722: change the interrupt mask for jack type detection

This patch changed the interrupt mask from XU to GE.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20241105100557.1987917-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl-esai: allow fsl,imx8qm-esai fallback to fsl,imx6ull-esai
Frank Li [Mon, 28 Oct 2024 19:49:31 +0000 (15:49 -0400)]
ASoC: dt-bindings: fsl-esai: allow fsl,imx8qm-esai fallback to fsl,imx6ull-esai

The ESAI of i.MX8QM is the same as i.MX6ULL. So allow fsl,imx8qm-esai
fallback to fsl,imx6ull-esai.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20241028-esai_fix-v1-1-3c1432a5613c@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: qcom: sc8280xp Add SM8750 sound card
Krzysztof Kozlowski [Fri, 1 Nov 2024 16:51:59 +0000 (17:51 +0100)]
ASoC: qcom: sc8280xp Add SM8750 sound card

Add OF device ID entry for SM8750 sound card with its own model name,
used to load proper Audioreach topology file.  The sound card is
compatible with SM8450 and newer family.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241101165159.370619-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: qcom,sm8250: Add SM8750 sound card
Krzysztof Kozlowski [Fri, 1 Nov 2024 16:51:58 +0000 (17:51 +0100)]
ASoC: dt-bindings: qcom,sm8250: Add SM8750 sound card

Add bindings for SM8750 sound card, compatible with older SM8450
variant.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241101165159.370619-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: sprd,sc9860-mcdt: convert to YAML
Stanislav Jakubek [Wed, 30 Oct 2024 17:49:22 +0000 (18:49 +0100)]
ASoC: dt-bindings: sprd,sc9860-mcdt: convert to YAML

Convert the Spreadtrum Multi-Channel Data Transfer controller bindings
to DT schema. Adjust filename to match compatible.

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/140ee384c1c351ffa3abefa8dd3246d1625dda8d.1730310275.git.stano.jakubek@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: sprd,pcm-platform: convert to YAML
Stanislav Jakubek [Wed, 30 Oct 2024 17:48:38 +0000 (18:48 +0100)]
ASoC: dt-bindings: sprd,pcm-platform: convert to YAML

Convert the Spreadtrum DMA platform bindings to DT schema.
Adjust filename to match compatible.

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/9fc646b70a73e7a6c513771d69b0edcd140f09d7.1730310275.git.stano.jakubek@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl_mqs: Support accessing registers by scmi interface
Shengjiu Wang [Fri, 25 Oct 2024 06:29:35 +0000 (14:29 +0800)]
ASoC: fsl_mqs: Support accessing registers by scmi interface

On i.MX95, the MQS module in Always-on (AON) domain only can
be accessed by System Controller Management Interface (SCMI)
MISC Protocol. So define a specific regmap_config for the case.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20241025062935.1071408-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: bcm63xx-pcm-whistler: fix uninit-value in i2s_dma_isr
Suraj Sonawane [Sat, 2 Nov 2024 12:36:30 +0000 (18:06 +0530)]
ASoC: bcm63xx-pcm-whistler: fix uninit-value in i2s_dma_isr

Fix an issue detected by the Smatch tool:

sound/soc/bcm/bcm63xx-pcm-whistler.c:264 i2s_dma_isr()
error: uninitialized symbol 'val_1'.
sound/soc/bcm/bcm63xx-pcm-whistler.c:264 i2s_dma_isr()
error: uninitialized symbol 'val_2'.

These errors were triggered because the variables 'val_1' and 'val_2'
could remain uninitialized if 'offlevel' is zero, meaning the loop
that assigns values to them does not execute. In this case,
'dma_addr_next' would use uninitialized data, potentially leading
to undefined behavior.

To resolve this, a conditional update for 'dma_addr_next' is added,
ensuring it is assigned only when 'val_1' and 'val_2' are read.
A new boolean variable 'val_read' flags when the values have been
retrieved, setting 'dma_addr_next' only if valid data is available.

This solution prevents the use of uninitialized data, maintaining
defined behavior for 'dma_addr_next' in all cases, and aligns with
expected usage of I2S RX descriptor data.

Signed-off-by: Suraj Sonawane <surajsonawane0215@gmail.com>
Link: https://patch.msgid.link/20241102123630.25446-1-surajsonawane0215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata()
Qiu-ji Chen [Mon, 30 Sep 2024 10:12:16 +0000 (18:12 +0800)]
ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata()

An atomicity violation occurs when the validity of the variables
da7219->clk_src and da7219->mclk_rate is being assessed. Since the entire
assessment is not protected by a lock, the da7219 variable might still be
in flux during the assessment, rendering this check invalid.

To fix this issue, we recommend adding a lock before the block
if ((da7219->clk_src == clk_id) && (da7219->mclk_rate == freq)) so that
the legitimacy check for da7219->clk_src and da7219->mclk_rate is
protected by the lock, ensuring the validity of the check.

This possible bug is found by an experimental static analysis tool
developed by our team. This tool analyzes the locking APIs
to extract function pairs that can be concurrently executed, and then
analyzes the instructions in the paired functions to identify possible
concurrency bugs including data races and atomicity violations.

Fixes: 6d817c0e9fd7 ("ASoC: codecs: Add da7219 codec driver")
Cc: stable@vger.kernel.org
Signed-off-by: Qiu-ji Chen <chenqiuji666@gmail.com>
Link: https://patch.msgid.link/20240930101216.23723-1-chenqiuji666@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: qcom: x1e80100: Support boards with two speakers
Krzysztof Kozlowski [Wed, 23 Oct 2024 12:41:52 +0000 (14:41 +0200)]
ASoC: qcom: x1e80100: Support boards with two speakers

Some Qualcomm X1E laptops have only two speakers.  Regardless whether
this sound card driver is suitable for them (we could re-use one for
some older SoC), we should set reasonable channel map depending on the
number of channels, not always 4-speaker setup.

This change is necessary for bringing audio support on Lenovo Thinkpad
T14s with Qualcomm X1E78100 and only two speakers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241023124152.130706-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: ES8326: Reduce pop noise
Zhang Yi [Thu, 31 Oct 2024 06:02:53 +0000 (14:02 +0800)]
ASoC: codecs: ES8326: Reduce pop noise

We modify the value of ES8326_ANA_MICBIAS to reduce the pop noise

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20241031060253.21001-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl_spdif: Document imx6sl/sx compatible fallback
Fabio Estevam [Mon, 28 Oct 2024 02:07:49 +0000 (23:07 -0300)]
ASoC: dt-bindings: fsl_spdif: Document imx6sl/sx compatible fallback

i.MX6SL and i.MX6SX SPDIF blocks are compatible with i.MX35.

Document 'fsl,imx35-spdif' as a fallback compatible for these two
chip variants.

This fixes the following dt-schema warnings:

compatible: ['fsl,imx6sl-spdif', 'fsl,imx35-spdif'] is too long
compatible: ['fsl,imx6sx-spdif', 'fsl,imx35-spdif'] is too long

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20241028020749.36972-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: amd: acp: Fix for ACP SOF dmic tplg component load failure
Venkata Prasad Potturu [Mon, 4 Nov 2024 09:13:10 +0000 (14:43 +0530)]
ASoC: amd: acp: Fix for ACP SOF dmic tplg component load failure

Stream name mismatch with topology file causes tplg load failure.

As SOF framework assigns dailink->stream name, overriding stream name
other than link name causes SOF dmic component load failure.

[   35.474995] snd_sof_amd_acp70 0000:c4:00.5: error: can't connect DAI ACPDMIC0.IN stream acp-dmic-codec
[   35.475001] snd_sof_amd_acp70 0000:c4:00.5: failed to add widget type 28 name : ACPDMIC0.IN stream acp-dmic-codec
[   35.475013] sof_mach acp70-dsp: ASoC: failed to load widget ACPDMIC0.IN
[   35.475018] sof_mach acp70-dsp: ASoC: topology: could not load header: -22
[   35.475072] snd_sof_amd_acp70 0000:c4:00.5: error: tplg component load failed -22
[   35.475083] snd_sof_amd_acp70 0000:c4:00.5: error: failed to load DSP topology -22
[   35.475090] snd_sof_amd_acp70 0000:c4:00.5: ASoC: error at snd_soc_component_probe on 0000:c4:00.5: -22
[   35.475117] sof_mach acp70-dsp: ASoC: failed to instantiate card -22
[   35.475254] sof_mach acp70-dsp: error -EINVAL: Failed to register card(sof-acp70-dsp)
[   35.475261] sof_mach acp70-dsp: probe with driver sof_mach failed with error -22

Fixes: b2385de2ae11 ("ASoC: amd: acp: Add stream name to ACP PDM DMIC devices")
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20241104091312.1108299-1-venkataprasad.potturu@amd.com
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: cleanup function parameter for rtd and its id
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:58 +0000 (01:29 +0000)]
ASoC: cleanup function parameter for rtd and its id

some functions had parameter like below

xxx(..., rtd, ..., id);

This "id" is rtd->id. We don't need to have "id" on each functions
because we can get it from "rtd". Let's cleanup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plnqb84p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: soc-core: do rtd->id trick at snd_soc_add_pcm_runtime()
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:52 +0000 (01:29 +0000)]
ASoC: soc-core: do rtd->id trick at snd_soc_add_pcm_runtime()

qcom/qdsp6 want to use irregular rtd->id because of its topology.
Current code is calculating it at soc_init_pcm_runtime() which calls
soc_new_pcm(), and it doesn't save it to rtd->id.

Let's calculate and save it to rtd at snd_soc_add_pcm_runtime()
which create rtd and connect related components.

But, this feature should be implemented by using "dai_link" instead
of "component". Add FIXME as comment.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87r086b84w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: remove rtd->num
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:45 +0000 (01:29 +0000)]
ASoC: remove rtd->num

No one is using rtd->num. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87sesmb852.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: generic: switch to use rtd->id from rtd->num
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:39 +0000 (01:29 +0000)]
ASoC: generic: switch to use rtd->id from rtd->num

Now rtd->num is renamed to rtd->id. Let's switch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ttd2b858.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sh: switch to use rtd->id from rtd->num
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:34 +0000 (01:29 +0000)]
ASoC: sh: switch to use rtd->id from rtd->num

Now rtd->num is renamed to rtd->id. Let's switch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v7xib85e.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: meson: switch to use rtd->id from rtd->num
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:27 +0000 (01:29 +0000)]
ASoC: meson: switch to use rtd->id from rtd->num

Now rtd->num is renamed to rtd->id. Let's switch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/87wmhyb85l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: switch to use rtd->id from rtd->num
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:20 +0000 (01:29 +0000)]
ASoC: fsl: switch to use rtd->id from rtd->num

Now rtd->num is renamed to rtd->id. Let's switch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87y12eb85r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rename rtd->num to rtd->id
Kuninori Morimoto [Thu, 24 Oct 2024 01:29:13 +0000 (01:29 +0000)]
ASoC: rename rtd->num to rtd->id

Current rtd has "num". It sounds/looks like size of rtd or something,
but it will be mainly used at snd_pcm_new() as "device index".
This naming is confusable. Let's rename it to "id"

Some drivers are using rtd->num, so let's keep it so far, and remove
it if all user was switched.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87zfmub85z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: Add aw88081 amplifier driver
Weidong Wang [Thu, 24 Oct 2024 09:03:24 +0000 (17:03 +0800)]
ASoC: codecs: Add aw88081 amplifier driver

The driver is for amplifiers aw88081 of Awinic Technology
Corporation. The awinic AW88081 is an I2S/TDM input,
high efficiency digital Smart K audio amplifier

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Reviewed-by: anish kumar <yesanishhere@gmail.com>
Link: https://patch.msgid.link/20241024090324.131731-3-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: Add schema for "awinic,aw88081"
Weidong Wang [Thu, 24 Oct 2024 09:03:23 +0000 (17:03 +0800)]
ASoC: dt-bindings: Add schema for "awinic,aw88081"

Add the awinic,aw88081 property to support the aw88081 chip,
which is an I2S/TDM input, high efficiency digital
Smart K audio amplifie.

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20241024090324.131731-2-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sdw_utils: Update stream_name in dai_links structure
Vijendar Mukunda [Fri, 1 Nov 2024 02:08:02 +0000 (07:38 +0530)]
ASoC: sdw_utils: Update stream_name in dai_links structure

For sof stack, dai_link->stream name will be assigned.
For legacy(No DSP enabled) stack, dai_link->stream name should be updated
explicitly. Update the stream_name in dai_link structure.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241101020802.1103181-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sdw_utils/intel/amd: refactor dai link init logic
Vijendar Mukunda [Fri, 1 Nov 2024 02:08:01 +0000 (07:38 +0530)]
ASoC: sdw_utils/intel/amd: refactor dai link init logic

Add 'no_pcm' as parameter for asoc_sdw_init_dai_link() so that
same function can be used for SOF and legacy(No DSP) stack.
Pass 'no_pcm' as 1 for Intel and AMD SOF based machine drivers.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241101020802.1103181-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: doc: update clock api details
anish kumar [Thu, 31 Oct 2024 03:58:29 +0000 (20:58 -0700)]
ASoC: doc: update clock api details

Added ASoC clock api kernel doc in this
document.

Signed-off-by: anish kumar <yesanishhere@gmail.com>
Link: https://patch.msgid.link/20241031035829.54852-1-yesanishhere@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: wcd937x: Remove unused of_gpio.h
Andy Shevchenko [Thu, 31 Oct 2024 10:33:02 +0000 (12:33 +0200)]
ASoC: codecs: wcd937x: Remove unused of_gpio.h

of_gpio.h is deprecated and subject to remove. The drivers in question
don't use it, simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241031103302.2450830-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Rename "sh" to "renesas"
Mark Brown [Wed, 30 Oct 2024 16:02:48 +0000 (16:02 +0000)]
ASoC: Rename "sh" to "renesas"

Merge series from Prabhakar <prabhakar.csengg@gmail.com>:

This patch series aims to rename "sh" to "renesas", along with this
the references to this path have been updated.

5 months agoASoC: cs42l84: Remove unused including <linux/version.h>
Jiapeng Chong [Wed, 30 Oct 2024 02:10:47 +0000 (10:10 +0800)]
ASoC: cs42l84: Remove unused including <linux/version.h>

./sound/soc/codecs/cs42l84.c: 15 linux/version.h not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11570
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://patch.msgid.link/20241030021047.70543-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoMAINTAINERS: Add entry for Renesas RZ ASoC driver
Lad Prabhakar [Fri, 25 Oct 2024 15:05:11 +0000 (16:05 +0100)]
MAINTAINERS: Add entry for Renesas RZ ASoC driver

Add a new entry to the MAINTAINERS file for Renesas RZ ASoC driver.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20241025150511.722040-6-prabhakar.mahadev-lad.rj@bp.renesas.com
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoMAINTAINERS: Add entry for Renesas R-Car and FSI ASoC drivers
Lad Prabhakar [Fri, 25 Oct 2024 15:05:10 +0000 (16:05 +0100)]
MAINTAINERS: Add entry for Renesas R-Car and FSI ASoC drivers

Add a new entry to the MAINTAINERS file for Renesas R-CAR and FSI ASoC
drivers.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20241025150511.722040-5-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: audio-graph-card2: Update comment with renamed file path
Lad Prabhakar [Fri, 25 Oct 2024 15:05:09 +0000 (16:05 +0100)]
ASoC: audio-graph-card2: Update comment with renamed file path

The "sound/soc/sh" directory has been renamed to "sound/soc/renesas".
Update the comment in audio-graph-card2.c to reflect the new file path
for better accuracy.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20241025150511.722040-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: renesas, rsnd: Update file path
Lad Prabhakar [Fri, 25 Oct 2024 15:05:08 +0000 (16:05 +0100)]
ASoC: renesas, rsnd: Update file path

The "sound/soc/sh" directory has been renamed to "sound/soc/renesas".
Update the reference in renesas,rsnd.txt to reflect the new file path
for consistency.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20241025150511.722040-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Rename "sh" to "renesas"
Lad Prabhakar [Fri, 25 Oct 2024 15:05:07 +0000 (16:05 +0100)]
ASoC: Rename "sh" to "renesas"

Rename the "sh" folder to "renesas" to better reflect the Renesas-specific
drivers.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20241025150511.722040-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: adau1373: drop platform data
Mark Brown [Tue, 29 Oct 2024 18:56:55 +0000 (18:56 +0000)]
ASoC: codecs: adau1373: drop platform data

Merge series from Nuno Sa <nuno.sa@analog.com>:

Support the powerdown GPIO on ADAU1373.

5 months agoASoC: codecs: adau1373: add powerdown gpio
Nuno Sa [Mon, 28 Oct 2024 15:43:41 +0000 (16:43 +0100)]
ASoC: codecs: adau1373: add powerdown gpio

If the powerdown GPIO is specified, we use it for reset. Otherwise,
fallback to a software reset.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241028-adau1373-shutdown-v2-4-647f56bbd182@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: adau1373: drop patform_data
Nuno Sa [Mon, 28 Oct 2024 15:43:40 +0000 (16:43 +0100)]
ASoC: codecs: adau1373: drop patform_data

struct adau1373_platform_data" was not being used by any platform.
Hence, drop it and move to firmware based support. All the
configurations quirks present in the platform_data are now supported as
firmware properties.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241028-adau1373-shutdown-v2-3-647f56bbd182@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: document the adau1373 Codec
Nuno Sa [Mon, 28 Oct 2024 15:43:39 +0000 (16:43 +0100)]
ASoC: dt-bindings: document the adau1373 Codec

Describe the adau1373 Low Power Codec with Speaker and
Headphone Amplifier.

While at it, properly add a MAINTAINERS entry for ADI sound bindings.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241028-adau1373-shutdown-v2-2-647f56bbd182@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: adau1373: add some kconfig text
Nuno Sa [Mon, 28 Oct 2024 15:43:38 +0000 (16:43 +0100)]
ASoC: codecs: adau1373: add some kconfig text

Add some text to 'tristate' so that we can actually enable the driver
when using things like menuconfig.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241028-adau1373-shutdown-v2-1-647f56bbd182@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: cs42l84: remove incorrect of_match_ptr()
Arnd Bergmann [Tue, 29 Oct 2024 09:23:55 +0000 (09:23 +0000)]
ASoC: cs42l84: remove incorrect of_match_ptr()

The use of of_match_ptr() is incorrect here and just causes
a warning:

sound/soc/codecs/cs42l84.c:1084:34: error: unused variable 'cs42l84_of_match' [-Werror,-Wunused-const-variable]

Fixes: 250304a0fb34 ("ASoC: cs42l84: Add new codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20241029092404.3874040-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: Intel: add rt722 and rt1320 support
Mark Brown [Mon, 28 Oct 2024 16:33:39 +0000 (16:33 +0000)]
ASoC: Intel: add rt722 and rt1320 support

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

This series add rt722 and rt1320 support for a new Dell SKU.

6 months agoASoC: Intel: soc-acpi-intel-arl-match: Add rt722 and rt1320 support
Mac Chiang [Mon, 28 Oct 2024 07:26:31 +0000 (15:26 +0800)]
ASoC: Intel: soc-acpi-intel-arl-match: Add rt722 and rt1320 support

This patch adds support for the rt722 multi-function codec and the
rt1320 amplifier in the ARL board configuration.

Link 0: RT722 codec with three endpoints: Headset, Speaker, and DMIC.
Link 2: RT1320 amplifier.

Note:
The Speaker endpoint on the RT722 codec is not used.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241028072631.15536-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: intel: sof_sdw: add quirk for Dell SKU
Mac Chiang [Mon, 28 Oct 2024 07:26:30 +0000 (15:26 +0800)]
ASoC: intel: sof_sdw: add quirk for Dell SKU

This patch adds a quirk to include the codec amplifier
function for this Dell SKU.

Note: In this SKU '0CF0', the RT722 codec amplifier is
excluded, and an external amplifier is used instead.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241028072631.15536-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: sdw_utils: Add quirk to exclude amplifier function
Mac Chiang [Mon, 28 Oct 2024 07:26:29 +0000 (15:26 +0800)]
ASoC: sdw_utils: Add quirk to exclude amplifier function

When SKUs use the multi-function codec, which integrates
Headset, Amplifier and DMIC. The corresponding quirks provide
options to support internal amplifier/DMIC or not.

In the case of RT722, this SKU excludes the internal amplifier and
use an additional amplifier instead.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241028072631.15536-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: codecs: ES8326: Modify the configuration of and micbias
Zhang Yi [Mon, 28 Oct 2024 06:05:29 +0000 (14:05 +0800)]
ASoC: codecs: ES8326: Modify the configuration of and micbias

Because we designed a new version of ES8326, the configuration of
micbias needed to be modified.We tested the new driver,
on both the new version and the old one. It works well.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20241028060529.3359-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: soc-devres: Remove unused devm_snd_soc_register_dai
Dr. David Alan Gilbert [Mon, 28 Oct 2024 02:12:26 +0000 (02:12 +0000)]
ASoC: soc-devres: Remove unused devm_snd_soc_register_dai

The last use of devm_snd_soc_register_dai() was removed by
commit fc4cb1e15f0c ("ASoC: topology: Properly unregister DAI on removal")
in 2021.

Remove it, and the helper it used.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20241028021226.477909-1-linux@treblig.org
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: rt1320: add mic function
Shuming Fan [Fri, 25 Oct 2024 08:12:59 +0000 (16:12 +0800)]
ASoC: rt1320: add mic function

This patch adds the mic function.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20241025081259.1419518-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: add CS42L84 codec driver
Mark Brown [Thu, 24 Oct 2024 18:21:16 +0000 (19:21 +0100)]
ASoC: add CS42L84 codec driver

Merge series from James Calligeros <jcalligeros99@gmail.com>:

This patch set adds a driver for the Cirrus Logic CS42L84 codec. This chip
is (so far) found only on Apple Silicon Macs. In keeping with proud Apple
tradition, the CS42L84 is essentially just a CS42L42 with a different
regmap and no publicly available datasheet. It may also be missing its
parent's S/PDIF capabilities as none of Apple's devices support S/PDIF out,
however this cannot be positively confirmed.

This driver has lived in the downstream Asahi tree for quite a while now,
and gained some refinements along the way. I have squashed most of these
into the initial driver commit as they were small changes like tweaking
msleep()s or filling out TLVs, but left seperate a larger change to
tip/ring sense IRQ handling as it differs significantly from what is found
in the CS42L42 driver.

6 months agoASoC: add Allwinner H616 audio codec support
Mark Brown [Thu, 24 Oct 2024 18:21:06 +0000 (19:21 +0100)]
ASoC: add Allwinner H616 audio codec support

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

The Allwinner H616 has a playback-only audio codec, with a single stereo
or differential-mono line output.  This patch series adds support for
the H616 (and H313/H618/H700/T507) SoC.  Based on the Allwinner kernel
SDK driver, and tested on the H700.

6 months agoASoC: dt-bindings: Add CS42L84 codec
Martin Povišer [Sat, 19 Oct 2024 14:47:31 +0000 (00:47 +1000)]
ASoC: dt-bindings: Add CS42L84 codec

CS42L84 is a headphone jack codec made by Cirrus Logic and seen in Apple
computer models starting with 2021 Macbook Pros. It is not a publicly
documented part. To a degree the part is similar to the public CS42L42.
(The L84 superseded L83 seen in earlier Apple models, and the L83 was
pretty much the same as L42.)

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20241020-cs42l84-v2-1-37ba2b6721d9@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: cs42l84: leverage ring sense IRQs to correctly detect headsets
James Calligeros [Sat, 19 Oct 2024 14:47:33 +0000 (00:47 +1000)]
ASoC: cs42l84: leverage ring sense IRQs to correctly detect headsets

Some jacks integrated on devices with this codec, such as certain
Apple Silicon Macs, have quite trigger-happy tip sense switches that
cause a tip sense IRQ before the plug is fully seated. If users are
unfortunate with their timing, this can lead to headsets being detected
as mic-less headphones among other issues with the codec's device
detection routines.

Introduce some rudimentary ring sense interrupt handling so that we
can re-trigger the codec's detection routines when we are certain
that the plug is fully seated.

This seems to differ from what other Cirrus drivers do, but is
necessary for devices to be reliably detected properly here.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Link: https://patch.msgid.link/20241020-cs42l84-v2-3-37ba2b6721d9@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
6 months agoASoC: cs42l84: Add new codec driver
Martin Povišer [Sat, 19 Oct 2024 14:47:32 +0000 (00:47 +1000)]
ASoC: cs42l84: Add new codec driver

The CS42L84 is a codec from Cirrus Logic found in Apple Silicon Macs.
The chip continues Apple's long tradition of compelling vendors to
spin out bespoke SKUs that are based on existing IP but made subtly
incompatible with the publicly available part. CS42L84 is very similar
to CS42L42, but has a different regmap.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Link: https://patch.msgid.link/20241020-cs42l84-v2-2-37ba2b6721d9@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>