32152 Commits

Author SHA1 Message Date
Bard Liao
41f91a884f
ASoC: Intel: sof_sdw: improve the log of DAI link numbers
The log shows the number for different type of DAIs. Add "DAI link
numbers:" to make the log be more explicit.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@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/20241206075903.195730-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:02 +00:00
Bard Liao
90a73807fd
ASoC: Intel: sof_sdw: reduce log level for not using internal dmic
ctx->ignore_internal_dmic is set when there is a dedicated SoundWire
DMIC is in the system. In other words, ignoring internal DMIC is
expected, not an error.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@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/20241206075903.195730-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:01 +00:00
Bard Liao
4ab80a2961
ASoC: Intel: sof_sdw: correct mach_params->dmic_num
mach_params->dmic_num will be used to set the cfg-mics value of
card->components string which should be the dmic channels. However
dmic_num is dmic link number and could be set due to the SOC_SDW_PCH_DMIC
quirk. Set mach_params->dmic_num to the default value if the dmic link
is created due to the SOC_SDW_PCH_DMIC quirk.

Fixes: 7db9f6361170 ("ASoC: Intel: sof_sdw: overwrite mach_params->dmic_num")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@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/20241206075903.195730-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:00 +00:00
Kuninori Morimoto
bd4a5c8d53
ASoC: simple-card-utils: use for_each_of_graph_port() on graph_get_dai_id()
Because DT check when compiling become very strict in these days,
we need to add reg = <x> if it has multi port/endpoint, otherwise
it will get error or warning. But it was not so strict and/or
mandatry before.

Current code is counting "endpoint" to get DAI ID, but it should count
"port" instead, otherwise strange ID will be used for DAI if it was multi
connected case (A). There is no issue if it was not multi connected (B).

One note is that this code will be used if neither port/endpoint doesn't
have reg = <x> property on DT.

case (A)

	/* This should be handled as DAI-0 */
	port@0 {
		endpoint@0 {  }	/* It will be DAI-0 by endpoint count */
		endpoint@1 {  }	/* It will be DAI-1 by endpoint count */
	};
	/* This should be handled as DAI-1 */
	port@1 {
		endpoint {  }	/* It will be DAI-2 by endpoint count */
	};

case (B)
	/* both endpoint cound and port count are same */
	port@0 {
		endpoint { ... }
	};
	port@1 {
		endpoint { ... }
	};

It will be issue if Audio-Graph-Card is used with Multi Connection.
No issue will be happen with Audio-Graph-Card2 / Simple-Card.

This patch uses for_each_of_graph_port() instead of
for_each_endpoint_of_node(), and thus, we can use "break" to quit
from loop. Because for_each_of_graph_port() uses __free(device_node)
inside.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o71tfrdz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:11:45 +00:00
Kuninori Morimoto
76deee2915
ASoC: simple-card-utils: check port reg first on graph_get_dai_id()
Because DT check when compiling become very strict in these days,
we need to add reg = <x> if it has multi port/endpoint, otherwise
it will get error or warning. But it was not so strict and/or
mandatry before.

Current code uses reg number as DAI ID, but it will use "endpoint"
reg first and use "port" reg 2nd. But it should use port number as 1st (A)
if it was used for multi connected case. There is no priority for
port/endpoint if it was not multi connected (B).

case (A)
	port {
		/*
		 * "port" and "endpoint" are using different reg number.
		 * It should use <x> as DAI ID, not <y> not <z>
		 */
		reg = <x>;
		endpoint@y { reg = <y>; ... };
		endpoint@z { reg = <z>; ... };
	};

case (B)
	port {
		/*
		 * Both port/endpoint are using same reg numer <x>.
		 */
		reg = <x>;
		endpoint { reg = <x>; ... };
	};

It will be issue if Audio-Graph-Card is used with Multi Connection.
No issue will be happen with Audio-Graph-Card2 / Simple-Card.

This patch swtich port/endpoint priority.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plm9fre3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:11:44 +00:00
Kuninori Morimoto
419d191810
ASoC: simple-card-utils: use __free(device_node) for device node
simple-card-utils handles many type of device_node, thus need to
use of_node_put() in many place. Let's use __free(device_node)
and avoid it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87r06pfre8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:11:43 +00:00
Chancel Liu
4edc98598b
ASoC: fsl_sai: Add sample rate constraint
Platforms like i.MX93/91 only have one audio PLL. Some sample rates are
not supported. If the PLL source is used for 8kHz series rates, then
11kHz series rates can't be supported. Use fsl_asoc_constrain_rates()
to constrain rates according to PLL sources.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-5-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:11:11 +00:00
Chancel Liu
b622b677d2
ASoC: fsl_xcvr: Add sample rate constraint
Platforms like i.MX93/91 only have one audio PLL. Some sample rates are
not supported. If the PLL source is used for 8kHz series rates, then
11kHz series rates can't be supported. Use fsl_asoc_constrain_rates()
to constrain rates according to PLL sources. This constraint is merely
applicable to playback cases on SPDIF only platforms.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-4-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:11:11 +00:00
Chancel Liu
daf7a173fc
ASoC: fsl_micfil: Switch to common sample rate constraint function
fsl_asoc_constrain_rates() is a common function to constrain rates.
Let's switch to this function.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-3-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:11:10 +00:00
Chancel Liu
820bcaeb1f
ASoC: fsl_utils: Add function to constrain rates
Platforms like i.MX93/91 only have one audio PLL. Some sample rates are
not supported. Add common function to constrain rates according to
different clock sources.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-2-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:11:09 +00:00
Mark Brown
5757b31666 Linux 6.13-rc2
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmdWF7seHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG8jEH/R7kPMXdtnJspp3V
 iSFB7GAAWJmeXVCKwcAD9wrH6CcMbPS1W9ZPLgAuWZ/nKsf0Dgxo6EZBdsVlmkiY
 diQaX94Lv4zfselG56gpZNwVQ2YwAqVqt2vP+fMfF2T3+BKSTLkpvt9BprgLYR2J
 W83A2BaLUvhDa/bsx9QxTa3xthYa7BTALFwVOQbtelHprKzeA00sPK7sv3PBJIQ0
 G7mPYZ0pPHtZksHsI2lWNgBDklPW5EfcpSHWgMKxMSBMfDHAzQBM3IL7SjRxlKzW
 a/OsW1JeZEVBGUDmd9RNPf5jhHmjJdOUI0faW6j3iivWBPX5oGxMDA+YdXr54Xcs
 GT9KJew=
 =hVrA
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmdW56MACgkQJNaLcl1U
 h9DU7Af/deHVqlU2eYpZg0hNEk9Zo4ecKY0xd0kowT6OIY5NMNgiHvlrDskXEq5W
 4gJ11rmEULNaIsyB5csInhHhjOjul50wneyUMpxzUZUN/3ayZA9/h2I8FnFFfYDn
 Wq/mvSftnYhs46rXphyDDOWxdpcuydM1LyYuzOwqV9gFwEqkkDdc8KZNr6VJvVRX
 +hyPaOQGV48lmmYqxazWzYfyW4QHjZYXFMZByZf3MAr8biVzUEAmnf26nd4m+WYf
 NUwWUsqCwgqjEX0o0vkQlJbfQR40DERtaAZR/hvMlAMxhD3z6KaAotr/p5H4+OiE
 Krc3MKnGx76med3RKz0yrQQwgFkX6A==
 =jkEF
 -----END PGP SIGNATURE-----

ASoC: Merge up v6.12-rc2

This has fixes for several boards which help my testing a lot.
2024-12-09 12:50:19 +00:00
Linus Torvalds
2b90dcd599 sound fixes for 6.13-rc2
A collection of small fixes that have been gathered in the week.
 
 - Fix the missing XRUN handling in USB-audio low latency mode
 - Fix regression by the previous USB-audio hadening change
 - Clean up old SH sound driver to use the standard helpers
 - A few further fixes for MIDI 2.0 UMP handling
 - Various HD-audio and USB-audio quirks
 - Fix jack handling at PM on ASoC Intel AVS
 - Misc small fixes for ASoC SOF and Mediatek
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmdSvZQOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/R6xAAuDTfqNz2IAQiyb6E66z8r8v/syPH9cipHN7e
 N7weUK664FDdyDN5WUsUTLqMI+ugn/h0djGZTzCBNFiypdkg6xwkRTk9ENWQoK2G
 4u/hyFYAsqxWGghD3clPtV8N+0KbeREV0dUYTqsZGGFP1TRaqopOo5SUNLBXEHhV
 ksd9toyhNaCWkNKNLVReHkCXCJgNzu2GsxVjj9o4JvBroxkBGhdk/Yn4jvLpx7Aq
 w2JBDCMnAUvpb96dQFuxsj0qC2trUyDmmBNeqyyR5jfLl8zHL3OxN9b5X6XlgVZZ
 5doWQGpy77frOykzCxZ3r6Y2Wrmzs98Yhi6oJBO564WiL1mqhh4zipx+Epud6SSl
 fa7sgfeVkBeHmQX/kmF/njINJfeNqyrE4ebfvZzFR/1/OwppSgxzYZFl860Yr7Rr
 0nezAGkvwaq199PFlLc9mIJUycdL9xg82u5TMO1CfWacGEXl/e/glLMqV000pXYj
 9wZgo0ehu+0sJyI/2rznHMCy+NOBp1/LyYhp5yY919PhLCEpB1QRrGDvTvoxy6IL
 Npoxz26levTrRTb4VCi9/VAWgav/LnyoqnUoRBWiiub/SWp1SiDME3o8v8B0qLx0
 Ai3Ws85UO0JpSku2oAPOUWFlTinBDYGcOWRd+mu6lGwwJfOf7bog3luj2Mfa43xX
 bG20yrM=
 =WExA
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes that have been gathered in the week.

   - Fix the missing XRUN handling in USB-audio low latency mode

   - Fix regression by the previous USB-audio hadening change

   - Clean up old SH sound driver to use the standard helpers

   - A few further fixes for MIDI 2.0 UMP handling

   - Various HD-audio and USB-audio quirks

   - Fix jack handling at PM on ASoC Intel AVS

   - Misc small fixes for ASoC SOF and Mediatek"

* tag 'sound-6.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek: Fix spelling mistake "Firelfy" -> "Firefly"
  ASoC: mediatek: mt8188-mt6359: Remove hardcoded dmic codec
  ALSA: hda/realtek: fix micmute LEDs don't work on HP Laptops
  ALSA: usb-audio: Add extra PID for RME Digiface USB
  ALSA: usb-audio: Fix a DMA to stack memory bug
  ASoC: SOF: ipc3-topology: fix resource leaks in sof_ipc3_widget_setup_comp_dai()
  ALSA: hda/realtek: Add support for Samsung Galaxy Book3 360 (NP730QFG)
  ASoC: Intel: avs: da7219: Remove suspend_pre() and resume_post()
  ALSA: hda/tas2781: Fix error code tas2781_read_acpi()
  ALSA: hda/realtek: Enable mute and micmute LED on HP ProBook 430 G8
  ALSA: usb-audio: add mixer mapping for Corsair HS80
  ALSA: ump: Shut up truncated string warning
  ALSA: sh: Use standard helper for buffer accesses
  ALSA: usb-audio: Notify xrun for low-latency mode
  ALSA: hda/conexant: fix Z60MR100 startup pop issue
  ALSA: ump: Update legacy substream names upon FB info update
  ALSA: ump: Indicate the inactive group in legacy substream names
  ALSA: ump: Don't open legacy substream for an inactive group
  ALSA: seq: ump: Fix seq port updates per FB info notify
2024-12-06 11:46:39 -08:00
Nícolas F. R. A. Prado
ec16a3cdf3
ASoC: mediatek: mt8188-mt6359: Remove hardcoded dmic codec
Remove hardcoded dmic codec from the UL_SRC dai link to avoid requiring
a dmic codec to be present for the driver to probe, as not every
MT8188-based platform might need a dmic codec. The codec can be assigned
to the dai link through the dai-link property in Devicetree on the
platforms where it is needed.

No Devicetree currently relies on it so it is safe to remove without
worrying about backward compatibility.

Fixes: 9f08dcbddeb3 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20241203-mt8188-6359-unhardcode-dmic-v1-1-346e3e5cbe6d@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-05 13:39:58 +00:00
Mark Brown
c41da3a620
ASoC: Merge up origin to resolve interaction with manline symbol changes
Commit cdd30ebb1b9f ("module: Convert symbol namespace to string
literal") changes the arguments for various module symbol macros
including some that we've aded new uses for.  Merge the commit up to
avoid problems in -next.

Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 22:04:07 +00:00
Mark Brown
31823f27f8
ASoC: Splitting cs35l56 SoundWire DAI into separate
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

This series prepares for dissimilar aggregation of CS42L43 + CS35L56
speaker playback. The CS35L56 SoundWire DAI is split into separate
DAIs for playback and capture so they can be routed and aggregated
differently.

The cs_amp driver is also updated to enable different TX (capture)
slots on each CS35L56 on a bus, so that the captures can be aggregated.
2024-12-03 16:57:11 +00:00
Mark Brown
9d6aacda3a
Add support for codec of F1C100s
Merge series from "Csókás, Bence" <csokas.bence@prolan.hu>:

Support for Allwinner F1C100s/200s series audio was
submitted in 2018 as an RFC series, but was not merged,
despite having only minor errors. However, this is
essential for having audio on these SoCs.
This series was forward-ported/rebased to the best of
my abilities, on top of Linus' tree as of now:
commit 28eb75e178d3 ("Merge tag 'drm-next-2024-11-21' of https://gitlab.freedesktop.org/drm/kernel")

Link: https://lore.kernel.org/all/cover.1543782328.git.mesihkilinc@gmail.com/

As requested by many, this series will now be split in 2, the DMA and the
ALSA/ASoC codec driver. This is the codec part of the series.
The first part (DMA) is at the link below. The first 3 patches of this
series can be applied and built without the former series, but for working
audio you need them both, plus the last 2 Device Tree patches in this series.
Link: https://lore.kernel.org/linux-kernel/20241122161128.2619172-1-csokas.bence@prolan.hu/
2024-12-03 16:57:02 +00:00
Mark Brown
d59f0196e9
ASoC: Correct *-objs usages
Merge series from Takashi Iwai <tiwai@suse.de>:

I stumbled upon the use of *-objs in Makefile in a few places in
ASoC.  Here are trivial patches to correct those.
2024-12-03 16:56:56 +00:00
Mark Brown
297711ba02
ASoC: fsl_xcvr: Add suspend and resume support
Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

Define regmap for PHY and PLL registers, the PHY and PLL
registers are accessed by AI interface in controller.
Then  driver can use regcache to recover registers
after suspend and resume.
2024-12-03 16:56:49 +00:00
Takashi Iwai
582057d223
ASoC: wcd937x: Use *-y for Makefile
We should use *-y instead of *-objs in Makefile for the module
objects.  *-objs is used rather for host programs.

Fixes: 313e978df7fc ("ASoC: codecs: wcd937x: add audio routing and Kconfig")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241203141823.22393-6-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:47:01 +00:00
Takashi Iwai
7916a8d878
ASoC: cs42l84: Use *-y for Makefile
We should use *-y instead of *-objs in Makefile for the module
objects.  *-objs is used rather for host programs.

Fixes: 250304a0fb34 ("ASoC: cs42l84: Add new codec driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241203141823.22393-5-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:47:00 +00:00
Takashi Iwai
f60646d9c3
ASoC: SDCA: Use *-y for Makefile
We should use *-y instead of *-objs in Makefile for the module
objects.  *-objs is used rather for host programs.

Fixes: 3a513da1ae33 ("ASoC: SDCA: add initial module")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241203141823.22393-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:46:59 +00:00
Takashi Iwai
e9d2a2f492
ASoC: mediatek: mt8365: Use *-y for Makefile
We should use *-y instead of *-objs in Makefile for the module
objects.  *-objs is used rather for host programs.

Fixes: 5bbfdad8cf8d ("ASoC: mediatek: Add MT8365 support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241203141823.22393-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:46:58 +00:00
Takashi Iwai
3f0b8d367d
ASoC: cs40l50: Use *-y for Makefile
We should use *-y instead of *-objs in Makefile for the module
objects.  *-objs is used rather for host programs.

Fixes: c486def5b3ba ("ASoC: cs40l50: Support I2S streaming to CS40L50")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241203141823.22393-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:46:58 +00:00
Vijendar Mukunda
25cd677636
ASoC: amd: ps: add ZSC control register programming sequence
Add ZSC Control register programming sequence for ACP D0 and D3 state
transitions for ACP6.3 platform. This will allow ACP to enter low power
state when ACP enters D3 state. When ACP enters D0 State, ZSC control
should be disabled.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20241203081940.3390281-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:40:59 +00:00
Vijendar Mukunda
bcbf421d21
ASoC: amd: ps: update mach params subsystem_rev variable
Update mach_params subsystem_rev with acp_rev variable for ACP6.3
platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20241203081940.3390281-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:40:58 +00:00
Bard Liao
569922b82c
ASoC: SOF: Intel: hda-dai: Ensure DAI widget is valid during params
Each cpu DAI should associate with a widget. However, the topology might
not create the right number of DAI widgets for aggregated amps. And it
will cause NULL pointer deference.
Check that the DAI widget associated with the CPU DAI is valid to prevent
NULL pointer deference due to missing DAI widgets in topologies with
aggregated amps.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241203104853.56956-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 14:40:57 +00:00
Richard Fitzgerald
484c997e03
ASoC: sdw_utils: cs_amp: Assign non-overlapping TDM masks for each codec on a bus
Use snd_soc_dai_set_tdm_slot() on capture DAIs to prevent multiple
aggregated amps from trying to send data at the same time.

When the capture DAIs of multiple amps on a bus are aggregated they will
all be sharing the same bit slots for transmitted audio. This would lead
to bus errors if all channels on all amps were enabled, because multiple
amps would be trying to send data at the same time.

To prevent this, the available channels are divided between the amps on a
bus so that only one amp will be sending data for each channel position.

A CS35L56 has 4 TX channels, which must be split between all the amps on a
bus so that no two amps are using the same channel. This is done simply by
dividing by the number of amps on the bus, so that 1 amp can use all
4 channels, 2 amps can use 2 channels each, and 3 or 4 amps can only use
1 channel each.

The amps are usually aggregated across multiple SoundWire buses. In this
case there will be multiple cpu DAIs in the dailink. The channel mapping
is used to determine which amps are on each bus. The allocation of the
4 channels is done separately for each bus (only amps on the same bus can
interfere with each other).

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.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>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241203104534.56719-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 12:36:28 +00:00
Richard Fitzgerald
5547e7ca12
ASoC: cs35l56: Split SoundWire DAI into separate playback and capture
This patch splits the SoundWire capture DP into a separate DAI so that
it can be independently routed and/or aggregated. It also makes
corresponding changes to the SOF SoundWire machine driver.

The playback and capture over SoundWire are separate DPs so don't have to
route to the same place. They could also be aggregated differently - for
example the playback DP could be aggregated with a playback-only DAI on
a codec.

No production device currently uses the capture path and their topologies
do not connect it. So there is no need to change the machine driver match
table entries for these. They will simply drop the unused capture DAI.

There is one hookup used for a non-production development board that was
added by commit 05fe62842804 ("ASoC: Intel: soc-acpi-intel-mtl-match: add
acpi match table for cdb35l56-eight-c") This is the only hookup using a
topology that connects the SoundWire DP for capture, so this hookup has
been changed to include an aggregated endpoint for the capture DAI.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.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>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241203104534.56719-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-03 12:36:27 +00:00
Peter Zijlstra
cdd30ebb1b module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.

Scripted using

  git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
  do
    awk -i inplace '
      /^#define EXPORT_SYMBOL_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /^#define MODULE_IMPORT_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /MODULE_IMPORT_NS/ {
        $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
      }
      /EXPORT_SYMBOL_NS/ {
        if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
  	if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
  	    $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
  	    $0 !~ /^my/) {
  	  getline line;
  	  gsub(/[[:space:]]*\\$/, "");
  	  gsub(/[[:space:]]/, "", line);
  	  $0 = $0 " " line;
  	}

  	$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
  		    "\\1(\\2, \"\\3\")", "g");
        }
      }
      { print }' $file;
  done

Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 11:34:44 -08:00
Uwe Kleine-König
8359ea9c11
ASoC: Drop explicit initialization of struct i2c_device_id::driver_data to 0
These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20241202113641.1003836-2-u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 17:58:37 +00:00
Dan Carpenter
6d544ea21d
ASoC: SOF: ipc3-topology: fix resource leaks in sof_ipc3_widget_setup_comp_dai()
These error paths should free comp_dai before returning.

Fixes: 909dadf21aae ("ASoC: SOF: topology: Make DAI widget parsing IPC agnostic")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/67d185cf-d139-4f8c-970a-dbf0542246a8@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 13:30:43 +00:00
Mesih Kilinc
2198deb823
ASoC: sun4i-codec: Add support for Allwinner suniv F1C100s
Allwinner suniv F1C100s has similar but primitive audio codec
comparared to sun4i. Add support for it.

Signed-off-by: Mesih Kilinc <mesihkilinc@gmail.com>
[ csokas.bence: Remove `non_legacy_dai_naming`, add `reg_dac_fifoc` ]
Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
Link: https://github.com/mricon/b4/issues/50
Link: https://patch.msgid.link/20241123123900.2656837-4-csokas.bence@prolan.hu
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 13:27:01 +00:00
Mesih Kilinc
cabd4ac290
ASoC: sun4i-codec: Add DMA Max Burst field
Allwinner suniv F1C100s has similar DMA engine to sun4i but it has
smaller max burst size compared to sun4i. Add a quirk field to
differantitate between them.

Signed-off-by: Mesih Kilinc <mesihkilinc@gmail.com>
[ csokas.bence: Rebased on current master ]
Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
Link: https://patch.msgid.link/20241123123900.2656837-2-csokas.bence@prolan.hu
Link: https://github.com/mricon/b4/issues/50
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 13:26:59 +00:00
Christophe JAILLET
3787255c96
ASoC: cs42l51: Constify struct i2c_device_id
'struct i2c_device_id' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security.

While at it, also add some space to be consistent with cs42l51_of_match a
few lines below.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   1551	    384	     16	   1951	    79f	sound/soc/codecs/cs42l51-i2c.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   1631	    304	     16	   1951	    79f	sound/soc/codecs/cs42l51-i2c.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/d5e686f47eddb14245d0fde693ff77ae749f7a08.1731689646.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:30:40 +00:00
Tang Bin
dc9f2312ac
ASoC: tas2781: Fix redundant logical jump
In these functions, some logical jump of "goto" and variable
are redundant, thus remove them.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241025082042.2872-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:30:39 +00:00
Dheeraj Reddy Jonnalagadda
42c7af046a
ASoC: rockchip: i2s-tdm: Fix a useless call issue
This commit fixes a useless call issue detected by Coverity
(CID 1507978). The call to rockchip_i2s_ch_to_io is unnecessary as its
return value is never checked or used. As a result, the function
definition and call is removed.

Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Link: https://patch.msgid.link/20241118045605.48440-1-dheeraj.linuxdev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:30:38 +00:00
Andy Shevchenko
509544d1b6
ASoc: mediatek: mt8365: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use)
principle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241031102725.2447711-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:30:37 +00:00
Tang Bin
01981565c7
ASoC: mediatek: mt8192-afe-pcm: Simplify probe() with local dev variable
Simplify the function mt8192_afe_pcm_dev_probe() by
using local 'dev' instead of '&pdev->dev'.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241025080026.2393-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:30:36 +00:00
Shengjiu Wang
e6a9750a34
ASoC: fsl_xcvr: Add suspend and resume support
Use regcache_sync() to recover the registers of controller,
PHY and PLL after suspend and resume.
In order to recover the registers need to avoid use the
*_SET, *_CLR and *_TOG registers.

Recovery of the registers should be done before loading
XCVR firmware otherwise some registers set by firmware
are overwritten. Besides only in eARC mode is it necessary
to load XCVR firmware.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241127030035.649219-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:30:20 +00:00
Shengjiu Wang
5a8b4785cd
ASoC: fsl_xcvr: Use regmap for PHY and PLL registers
Define regmap for PHY and PLL registers, the PHY and PLL
registers are accessed by AI interface in controller.

So that driver can use regcache to recover registers
after suspend and resume.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20241127030035.649219-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:30:19 +00:00
Marek Maslanka
04c319e05d
ASoC: Intel: avs: da7219: Remove suspend_pre() and resume_post()
The presence of a plugged jack is not detected after resuming the device
if the jack was plugged before the device was suspended. This problem is
caused by calling the
sound/soc/codecs/da7219-aad.c:da7219_aad_jack_det() function on resume,
which forces the jack insertion state to be unplugged.

Signed-off-by: Marek Maslanka <mmaslanka@google.com>
Link: https://patch.msgid.link/20241128205215.2435485-1-mmaslanka@google.com
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-02 00:29:25 +00:00
Linus Torvalds
517363b494 sound fixes for 6.13-rc1
A collection of small fixes.  Majority of changes are device-specific
 fixes and quirks, while there are a few core fixes to address
 regressions and corner cases spotted by fuzzers.
 
 - Fix of spinlock range that wrongly covered kvfree() call in rawmidi
 - Fix potential NULL dereference at PCM mmap
 - Fix incorrectly advertised MIDI 2.0 UMP Function Block info
 - Various ASoC AMD quirks and fixes
 - ASoC SOF Intel, Mediatek, HDMI-codec fixes
 - A few more quirks and TAS2781 codec fix for HD-audio
 - A couple of fixes for USB-audio for malicious USB descriptors
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmdIeZUOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9YNQ/+IHvY0LmY+7Xd1ZGWtf+Sucsn8FXcE5K654q5
 RQwMbNNniSjXf8zyGfd05y/hVLWinaxYpM2m8DdGhIe/Fk2FYnU4itsChjv7TKW4
 blqYoer1HHMUaXF03uiJGfBxadNtKS/y+b2RagNkirPDO9cpTnc8ITKmJkqeFc/I
 flxCoGdKGew2OybZnFjVbEvTP1rhO1kODI3wkgr85ru8zMcLYC/FSbs7prEnZ7LO
 gy88Km7/SVcAYIHgSFjSdRHuz0ZRdCekIObP94QuxTbJ1/7Js2pDX/JFtHOMUqgG
 p7GGaDofT6u6Ut+fUCqLC8D3f1uift+O+vn98+5KvnABO4z9sdhNBXabGE0vv/4U
 tw9jllXI97ylK0o6HSVIwYsRb5IOhjlxOO+rlAZDE6Y0ii2uhCCp0vVFr4xVQOh1
 NeRqq1f4+TDxJSADzCUE/h1Hi9zepoK4GUQLasxGVCSxuIyiG8EW8U2/QZxhRSKP
 pYigpAIGbFHEzYEF+J+PXrfxgCEycv6jMq/RgkKbdbBiIYmnN6Q5lbSLpnDhTwjd
 qG0dBVX2KywHBlQm0nT2tKmyhoZu4c0gt0FnMWo9RAjyZON6YDXypc4KXon5a1kL
 kkgcDYQTccn4Klzvk1a3A+8Piz6B9UbJJ0fNjZiL0cp+awLQHg1GV+4bLp/iLQhm
 EivYr/U=
 =FLBb
 -----END PGP SIGNATURE-----

Merge tag 'sound-fix-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes. Majority of changes are device-specific
  fixes and quirks, while there are a few core fixes to address
  regressions and corner cases spotted by fuzzers.

   - Fix of spinlock range that wrongly covered kvfree() call in rawmidi

   - Fix potential NULL dereference at PCM mmap

   - Fix incorrectly advertised MIDI 2.0 UMP Function Block info

   - Various ASoC AMD quirks and fixes

   - ASoC SOF Intel, Mediatek, HDMI-codec fixes

   - A few more quirks and TAS2781 codec fix for HD-audio

   - A couple of fixes for USB-audio for malicious USB descriptors"

* tag 'sound-fix-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (30 commits)
  ALSA: hda: improve bass speaker support for ASUS Zenbook UM5606WA
  ALSA: hda/realtek: Apply quirk for Medion E15433
  ASoC: amd: yc: Add a quirk for microfone on Lenovo ThinkPad P14s Gen 5 21MES00B00
  ASoC: SOF: ipc3-topology: Convert the topology pin index to ALH dai index
  ASoC: mediatek: Check num_codecs is not zero to avoid panic during probe
  ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
  ALSA: ump: Fix evaluation of MIDI 1.0 FB info
  ALSA: core: Fix possible NULL dereference caused by kunit_kzalloc()
  ALSA: hda: Show the codec quirk info at probing
  ALSA: asihpi: Remove unused variable
  ALSA: hda/realtek: Set PCBeep to default value for ALC274
  ALSA: hda/tas2781: Add speaker id check for ASUS projects
  ALSA: hda/realtek: Update ALC225 depop procedure
  ALSA: hda/realtek: Enable speaker pins for Medion E15443 platform
  ALSA: hda/realtek: fix mute/micmute LEDs don't work for EliteBook X G1i
  ALSA: usb-audio: Fix out of bounds reads when finding clock sources
  ALSA: rawmidi: Fix kvfree() call in spinlock
  ALSA: hda/realtek: Fix Internal Speaker and Mic boost of Infinix Y4 Max
  ASoC: amd: yc: Add quirk for microphone on Lenovo Thinkpad T14s Gen 6 21M1CTO1WW
  ASoC: doc: dapm: Add location information for dapm-graph tool
  ...
2024-11-29 13:01:05 -08:00
Linus Torvalds
9ad55a67a7 soundwire updates for 6.13
- structure optimization of few bus structures and header updates
  - support for 2.0 disco spec
  - amd driver updates for acp revision, refactoring code and support for
    acp6.3
  - soft reset support for cadence driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmdEgiMACgkQfBQHDyUj
 g0dVBA/+MWwHs+Sl7LMSmkpGsfAsmSbD2il+v+9WcVnaQpl/dgv8EXPGbafBBgK/
 AlVUvLCNdbwY93wCb/2xdGPOJS699D7AtdJnUEppcL2VsMtEbgQxyG0OSekRVH0c
 NxVLNPVLQFQnZayh7MNflQNVrXJyEqUJg8n0G9G1KT7jTeMavejYhqmhN7TKNtLD
 vJzF79QFC2n7+f7jK9+d2pJlhW5V3XUyQCRF6FipftKbuZN+ciVh9kjnAf1GjPsi
 qpv7kRZ3ttZiYW+/8FjJxqChnT10b/ahRDwJTXE+uGhqxHD9Cjo/GYrzUtQQbDR2
 uvZ6+o0UxhN3HR5Dq09FJYPluHpt8S/s/wZ0dj+dXlvPR82qT6LA9LP16BFwYj3S
 36/DpGwJBYg3tsmwECKbY08t3aI1d8nXNKG0tXbkEU3RUWVeOJOLAyXbwYQ9DRGN
 k3RbTTEZiw223FlgAk9dzCI6mMuekdh20UWVH7iZwUl8ZvJhWNdWiZOV4uaUcGZS
 fmJ6JE7cM1ntv5rXjKIhhnTnoL5Z+3es3PjLxj8PE7VNC8Dlln67FF1NuoDd0uF0
 jWA13iNUOKgytsx2jxAxWnU8S3SAPjB1+GD65ovMxH+b9xtgwhtmCcpySJaG4/Pn
 P7F7dx1+bK8gbmc5xJf8ZddYeDF/Nb/493trk+Sf+zZSs+hevRY=
 =3Ob7
 -----END PGP SIGNATURE-----

Merge tag 'soundwire-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire

Pull soundwire updates from Vinod Koul:

 - structure optimization of few bus structures and header updates

 - support for 2.0 disco spec

 - amd driver updates for acp revision, refactoring code and support for
   acp6.3

 - soft reset support for cadence driver

* tag 'soundwire-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (24 commits)
  soundwire: Minor formatting fixups in sdw.h header
  soundwire: Update the includes on the sdw.h header
  soundwire: cadence: clear MCP BLOCK_WAKEUP in init
  soundwire: cadence: add soft-reset on startup
  soundwire: intel_auxdevice: add kernel parameter for mclk divider
  soundwire: mipi-disco: add support for DP0/DPn 'lane-list' property
  soundwire: mipi-disco: add new properties from 2.0 spec
  soundwire: mipi-disco: add comment on DP0-supported property
  soundwire: mipi-disco: add support for peripheral channelprepare timeout
  soundwire: mipi_disco: add support for clock-scales property
  soundwire: mipi-disco: add error handling for property array read
  soundwire: mipi-disco: remove DPn audio-modes
  soundwire: optimize sdw_dpn_prop
  soundwire: optimize sdw_dp0_prop
  soundwire: optimize sdw_slave_prop
  soundwire: optimize sdw_bus structure
  soundwire: optimize sdw_master_prop
  soundwire: optimize sdw_stream_runtime memory layout
  soundwire: mipi_disco: add MIPI-specific property_read_bool() helpers
  soundwire: Correct some typos in comments
  ...
2024-11-27 13:38:09 -08:00
Ilya Zverev
b682aa788e
ASoC: amd: yc: Add a quirk for microfone on Lenovo ThinkPad P14s Gen 5 21MES00B00
New ThinkPads need new quirk entries. Ilya has tested this one.
Laptop product id is 21MES00B00, though the shorthand 21ME works.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219533
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Zverev <ilya@zverev.info>
Link: https://patch.msgid.link/20241127134420.14471-1-ilya@zverev.info
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-27 13:45:45 +00:00
Bard Liao
e9db1b5517
ASoC: SOF: ipc3-topology: Convert the topology pin index to ALH dai index
Intel SoundWire machine driver always uses Pin number 2 and above.
Currently, the pin number is used as the FW DAI index directly. As a
result, FW DAI 0 and 1 are never used. That worked fine because we use
up to 2 DAIs in a SDW link. Convert the topology pin index to ALH dai
index, the mapping is using 2-off indexing, iow, pin #2 is ALH dai #0.

The issue exists since beginning. And the Fixes tag is the first commit
that this commit can be applied.

Fixes: b66bfc3a9810 ("ASoC: SOF: sof-audio: Fix broken early bclk feature for SSP")
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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241127092955.20026-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-27 11:28:27 +00:00
Nícolas F. R. A. Prado
2f2020327c
ASoC: mediatek: Check num_codecs is not zero to avoid panic during probe
Following commit 13f58267cda3 ("ASoC: soc.h: don't create dummy
Component via COMP_DUMMY()"), COMP_DUMMY() became an array with zero
length, and only gets populated with the dummy struct after the card is
registered. Since the sound card driver's probe happens before the card
registration, accessing any of the members of a dummy component during
probe will result in undefined behavior.

This can be observed in the mt8188 and mt8195 machine sound drivers. By
omitting a dai link subnode in the sound card's node in the Devicetree,
the default uninitialized dummy codec is used, and when its dai_name
pointer gets passed to strcmp() it results in a null pointer dereference
and a kernel panic.

In addition to that, set_card_codec_info() in the generic helpers file,
mtk-soundcard-driver.c, will populate a dai link with a dummy codec when
a dai link node is present in DT but with no codec property.

The result is that at probe time, a dummy codec can either be
uninitialized with num_codecs = 0, or be an initialized dummy codec,
with num_codecs = 1 and dai_name = "snd-soc-dummy-dai". In order to
accommodate for both situations, check that num_codecs is not zero
before accessing the codecs' fields but still check for the codec's dai
name against "snd-soc-dummy-dai" as needed.

While at it, also drop the check that dai_name is not null in the mt8192
driver, introduced in commit 4d4e1b6319e5 ("ASoC: mediatek: mt8192:
Check existence of dai_name before dereferencing"), as it is actually
redundant given the preceding num_codecs != 0 check.

Fixes: 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Acked-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://patch.msgid.link/20241126-asoc-mtk-dummy-panic-v1-1-42d53e168d2e@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-27 11:28:25 +00:00
Venkata Prasad Potturu
4095cf8720
ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
Add condition check to register ACP PDM sound card by reading
_WOV acpi entry.

Fixes: 5426f506b584 ("ASoC: amd: Add support for enabling DMIC on acp6x via _DSD")

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20241127112227.227106-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-27 11:28:24 +00:00
Uwe Kleine-König
cbc86dd0a4
ASoC: amd: yc: Add quirk for microphone on Lenovo Thinkpad T14s Gen 6 21M1CTO1WW
Add a quirk for Tova's Lenovo Thinkpad T14s with product name 21M1.

Suggested-by: Tova <blueaddagio@laposte.net>
Link: https://bugs.debian.org/1087673
Signed-off-by: Uwe Kleine-König <ukleinek@debian.org>
Link: https://patch.msgid.link/20241122075606.213132-2-ukleinek@debian.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-25 12:42:53 +00:00
Linus Torvalds
80739fd00c - Several drivers, including atmel-flexcom/rk8xx-core, palmas, and
tps65010, have undergone minor code improvements to enhance consistency and
   fix race conditions.
 
 - The syscon driver now utilizes the regmap max_register_is_0 capability
   for consistent register map configuration across syscons of all sizes.
 
 - New device support has been added for QCS8300, qcs615, SA8255p, and
   samsung,s2dos05, expanding the range of compatible hardware.
 
 - The cros_ec driver now supports loading cros_ec_ucsi on supported ECs
   and avoids loading the charger with UCSI, streamlining functionality.
 
 - The bd96801 driver now utilizes the more modern maple tree register
   cache, improving performance.
 
 - The da9052-spi driver has undergone a fix to change the read-mask to
   write-mask, preventing potential issues.
 
 - Unused declarations in max77693 have been removed, and support for
   samsung,s2dos05 has been added, enhancing code clarity and device compatibility.
 
 - Error handling in cs42l43 has been fixed to avoid unbalanced regulator
   put and ensure proper synchronization during driver removal.
 
 - The wcd934x driver now uses MODULE_DEVICE_TABLE() instead of
   MODULE_ALIAS(), improving code consistency.
 
 - Documentation for qcom,tcsr, syscon, and atmel-smc has been updated
   and reorganized for better clarity and maintainability.
 
 - The intel_soc_pmic_bxtwc driver has undergone significant improvements,
   including the use of IRQ domains for various devices, fixing IRQ domain names
   duplication, and code refactoring for better consistency and maintainability.
 
 - The ipaq-micro driver has received a fix for a missing break statement in
   the default case, enhancing code robustness.
 
 - Support for the AXP323 PMIC has been added to the axp20x driver, along
   with ensuring a clear relationship between IDs and model names, and allowing
   multiple regulators, broadening hardware compatibility.
 
 - The cs42l43 driver now disables IRQs during suspend for improved power
   management.
 
 - The adp5585 driver has reduced its dependencies by dropping the obsolete
   dependency on COMPILE_TEST.
 
 - Initial support for the MT6328 PMIC has been added to the mt6397 driver,
   expanding the range of supported hardware.
 
 - The rtc-bd70528 driver has been simplified by dropping the IC name from
   IRQ, improving code readability.
 
 - Documentation for qcom,spmi-pmic, ti,twl, and zii,rave-sp has been
   updated to enhance clarity and incorporate new features.
 
 - The rt5033 driver has received a fix for a missing regmap_del_irq_chip()
   in the error handling path.
 
 - New device support has been added for MSM8917, and the
   intel_soc_pmic_crc driver now supports non-ACPI instantiated i2c_client.
 
 - The 88pm886 driver has added support for the RTC cell, and the tqmx86
   driver has improved its GPIO IRQ setup and added I2C IRQ support,
   increasing functionality.
 
 - The sprd,sc2731 DT schema has been updated and converted to YAML format
   for better readability and maintainability.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmc/KQQACgkQUa+KL4f8
 d2E0Gg//blIYrtUgGy5xEwR8WIobYtAxBo+AMX1tSgh4Hs4u/SFhy4cE7no+M3J2
 Id5gQJscuz3k4sH0raoUMp2NRFyI8lD8Y9xRBTDE+KV/FbdL1KHfmTun2NY1zG7U
 LIop39HsJkJ0Z06lnyBf61QK6SmlzT8vXbJmK4mYf8wgBX7iFDZ0FMZHP2uW5k/Z
 UV8nyQalwerG+jOGXfQkVDXF8YKToqPtqsFWTJ1Yn5gs1SCd6dyusDNYqUDuW4Ng
 dbu/4wt3mspliTOnBTPnXlcVsCNefhtbCWxyBpaA3luK9ciMdX7cZ8wei1xkFcwK
 5bXPjXsFiiUbDX0l/6eS1h676k1JQl5iABlhGXHJm/GMcN9fdNFCQL/2rtJ4iSfW
 0CoYjERfm6OyHF0Wiuk3I8x/AARWKXtDEjktGXUL0do7NBqJgB3ISme8x8b5hW4l
 HO6MmsFmHxHbIlb+kCTTCtXa5R1Sdca/8qrPxMb+B89X3eOtF7sjVgS9dwkLNCGp
 hqP0K2IGNaRw+EDlXCBaWrbq7x0kpup6o+nooViU0Pj9fFjEdZlCLyu22+kjl04V
 Lfe3x9wMXBrHVrPynoaQp6+57QlWfpM0uuKJWoaKlCoJTh8UbFcWWkDqr6I/pDur
 EtfSwOO8uVuS8m/FMAs0m/+zrWfHAvjAbAHFCKBu/vKaD5DvxeI=
 =YP3r
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:

 - Several drivers, including atmel-flexcom/rk8xx-core, palmas, and
   tps65010, have undergone minor code improvements to enhance
   consistency and fix race conditions.

 - The syscon driver now utilizes the regmap max_register_is_0
   capability for consistent register map configuration across syscons
   of all sizes.

 - New device support has been added for QCS8300, qcs615, SA8255p, and
   samsung,s2dos05, expanding the range of compatible hardware.

 - The cros_ec driver now supports loading cros_ec_ucsi on supported ECs
   and avoids loading the charger with UCSI, streamlining functionality.

 - The bd96801 driver now utilizes the more modern maple tree register
   cache, improving performance.

 - The da9052-spi driver has undergone a fix to change the read-mask to
   write-mask, preventing potential issues.

 - Unused declarations in max77693 have been removed, and support for
   samsung,s2dos05 has been added, enhancing code clarity and device
   compatibility.

 - Error handling in cs42l43 has been fixed to avoid unbalanced
   regulator put and ensure proper synchronization during driver
   removal.

 - The wcd934x driver now uses MODULE_DEVICE_TABLE() instead of
   MODULE_ALIAS(), improving code consistency.

 - Documentation for qcom,tcsr, syscon, and atmel-smc has been updated
   and reorganized for better clarity and maintainability.

 - The intel_soc_pmic_bxtwc driver has undergone significant
   improvements, including the use of IRQ domains for various devices,
   fixing IRQ domain names duplication, and code refactoring for better
   consistency and maintainability.

 - The ipaq-micro driver has received a fix for a missing break
   statement in the default case, enhancing code robustness.

 - Support for the AXP323 PMIC has been added to the axp20x driver,
   along with ensuring a clear relationship between IDs and model names,
   and allowing multiple regulators, broadening hardware compatibility.

 - The cs42l43 driver now disables IRQs during suspend for improved
   power management.

 - The adp5585 driver has reduced its dependencies by dropping the
   obsolete dependency on COMPILE_TEST.

 - Initial support for the MT6328 PMIC has been added to the mt6397
   driver, expanding the range of supported hardware.

 - The rtc-bd70528 driver has been simplified by dropping the IC name
   from IRQ, improving code readability.

 - Documentation for qcom,spmi-pmic, ti,twl, and zii,rave-sp has been
   updated to enhance clarity and incorporate new features.

 - The rt5033 driver has received a fix for a missing
   regmap_del_irq_chip() in the error handling path.

 - New device support has been added for MSM8917, and the
   intel_soc_pmic_crc driver now supports non-ACPI instantiated
   i2c_client.

 - The 88pm886 driver has added support for the RTC cell, and the tqmx86
   driver has improved its GPIO IRQ setup and added I2C IRQ support,
   increasing functionality.

 - The sprd,sc2731 DT schema has been updated and converted to YAML
   format for better readability and maintainability.

* tag 'mfd-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (62 commits)
  dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
  dt-bindings: mfd: sprd,sc2731: Convert to YAML
  mfd: tqmx86: Add I2C IRQ support
  mfd: tqmx86: Make IRQ setup errors non-fatal
  mfd: tqmx86: Refactor GPIO IRQ setup
  mfd: tqmx86: Improve gpio_irq module parameter description
  mfd: tqmx86: Add board definitions for TQMx120UC, TQMx130UC and TQMxE41S
  mfd: 88pm886: Add the RTC cell
  dt-bindings: mfd: Add Realtek RTL9300 switch peripherals
  mfd: intel_soc_pmic_crc: Add support for non ACPI instantiated i2c_client
  mfd: intel_soc_pmic_*: Consistently use filename as driver name
  dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8917
  mfd: rt5033: Fix missing regmap_del_irq_chip()
  mfd: cgbc-core: Fix error handling paths in cgbc_init_device()
  dt-bindings: mfd: aspeed: Support for AST2700
  mfd: Switch back to struct platform_driver::remove()
  dt-bindings: mfd: qcom,spmi-pmic: Document PMICs added in SM8750
  mfd: rtc: bd7xxxx Drop IC name from IRQ
  mfd: mt6397: Add initial support for MT6328
  mfd: adp5585: Drop obsolete dependency on COMPILE_TEST
  ...
2024-11-22 16:19:47 -08:00
Linus Torvalds
071b34dcf7 sound updates for 6.13-rc1
This is a relatively calm cycle, and majority of changes are about
 ASoC.  There are little changes in the core side but we received
 lots of new drivers for new vendors.
 
 * ALSA Core:
 - The new accel operation mode for compress-offload API;
   only the core part, and the actual user will follow at next
 
 * ASoC:
 - Continued API simplification works
 - Renaming of the sh directory to Renesas
 - Factoring out of some of the common code for Realtek devices
 - Ussal ASoC Intel SOF, AMD and SoundWire updates
 - Support for Allwinner H616, AMD ACP 6.3 systems, AWInic AW88081,
   Cirrus Logic CS32L84, Everest ES8328, Iron Devices SMA1307,
   Longsoon I2S, NeoFidelity NTP8918 and NTP8835, Philips UDA1342,
   Qualcomm SM8750, RealTek RT721, and ST Microelectronics STM32MP25
 
 * HD- and USB-audio:
 - Clean up of IRQ handling in legacy HD-audio driver
 - Fix soft lockup at disconnection of non-standard USB drivers
 - Scarlett2 mixer improvements
 - New quirks and cleanups in HD- and USB-audio
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmc9yFUOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8IMxAAoagGD3lQXQl6c7yoe0BATApiW71itLHP05SA
 KzVCeWtMMeROov9cWgzIJMqbj4d6fs/zxomYjYHzb+3IlTtMVkV+PWEIgtr0xck4
 WRPj9V3vb68+S6tFlVrmsv4LwdWfwPwUgLJpvXZM/aFUxa+8i0lb2/g8yKPYvser
 dfqU1Uwi7fn3txTQiFiI61Hx7Nn3ISUhVpY3DwZTHYuLaRNfJOR0HdJTrlehnYZG
 KmvTg2WnYud687yEMC5AV1WTItoUUhMkuPGbpxWxGwk8bOfkbxKNh/EgNOO2Hubz
 E8RgYtCaq2TA0OS5YdY6Mk9blG7snOZW3pMULm1kFuLr1BD7JGz2Q5duoX6NyrrS
 gqzXPxPYCCCkLLkS672HMy9UzhM3j03LrgT1JxV3wbUMZoJWjD0zn1Tfv6WJ1M7g
 CZsjaZrqATK8bexM8QrdKSZcZOB7B3ZX0hNyx/SKXycuvg8jC8evm/qfAPKvU79O
 B3vivSs/YgquR62R8dp6OJQ75C3IVLv9PrLbS/RXrOgzx2hRZFG5/PWKr+pC5zIp
 T8qdBPuQ/f/gzbIgGkL2sRYYWGL+tg+hlD2CA5jP47DoUwcdxm15AK4Gv1qqJgFr
 QCmg3WuipUumJqyMcSKdyVqUytIeCBFTZqM1PUsehfdueeRkp0ZgV6hDDc+jSjWm
 fjycRuw=
 =gOHc
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "This is a relatively calm cycle, and majority of changes are about
  ASoC. There are little changes in the core side but we received lots
  of new drivers for new vendors.

  ALSA Core:
   - The new accel operation mode for compress-offload API; only the
     core part, the actual user will follow later

  ASoC:
   - Continued API simplification works
   - Renaming of the sh directory to Renesas
   - Factoring out of some of the common code for Realtek devices
   - Ussal ASoC Intel SOF, AMD and SoundWire updates
   - Support for Allwinner H616, AMD ACP 6.3 systems, AWInic AW88081,
     Cirrus Logic CS32L84, Everest ES8328, Iron Devices SMA1307,
     Longsoon I2S, NeoFidelity NTP8918 and NTP8835, Philips UDA1342,
     Qualcomm SM8750, RealTek RT721, and ST Microelectronics STM32MP25

  HD- and USB-audio:
   - Clean up of IRQ handling in legacy HD-audio driver
   - Fix soft lockup at disconnection of non-standard USB drivers
   - Scarlett2 mixer improvements
   - New quirks and cleanups in HD- and USB-audio"

* tag 'sound-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (278 commits)
  ALSA: hda: Poll jack events for LS7A HD-Audio
  ASoC: hdmi-codec: reorder channel allocation list
  ALSA: ump: Fix the wrong format specifier
  ASoC: Intel: soc-acpi-intel-lnl-match: add rt712_vb + rt1320 support
  ASoC: stm32: dfsdm: change rate upper limits
  ASoC: sma1307: fix uninitialized variable refence
  ASoC: dt-bindings: simple-mux: add idle-state property
  ASoc: simple-mux: add idle-state support
  ASoC: sdca: test adev before calling acpi_dev_for_each_child
  ASoC: SOF: ipc4-topology: remove redundant assignment to variable ret
  ASoC: amd: ps: fix the pcm device numbering for acp 6.3 platform
  ASoC: amd: acp: add soundwire machine driver for legacy stack
  ASoC: amd: acp: move get_acp63_cpu_pin_id() to common file
  ASoC: amd: ps: add soundwire machines for acp6.3 platform
  ASoC: amd: acp: add RT711, RT714 & RT1316 support for acp 6.3 platform
  ASoC: amd: acp: add rt722 based soundwire machines
  ALSA: compress_offload: Add missing descriptions in structs
  ALSA: 6fire: Release resources at card release
  ALSA: caiaq: Use snd_card_free_when_closed() at disconnection
  ALSA: us122l: Drop mmap_count field
  ...
2024-11-21 14:39:31 -08:00