Commit Graph

51040 Commits

Author SHA1 Message Date
Stephen Rothwell
dca381d2cc Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 2024-12-20 12:23:25 +11:00
Stephen Rothwell
8316cb8f20 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git 2024-12-20 12:23:22 +11:00
Stephen Rothwell
b86e29c311 Merge branch 'mm-everything' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 2024-12-20 10:23:48 +11:00
Stephen Rothwell
bbbc571c9c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 2024-12-20 09:41:41 +11:00
Mark Brown
45f6111597
Merge remote-tracking branch 'asoc/for-6.14' into asoc-next 2024-12-19 18:54:16 +00:00
Chen-Yu Tsai
32c9c06adb
ASoC: mediatek: disable buffer pre-allocation
On Chromebooks based on Mediatek MT8195 or MT8188, the audio frontend
(AFE) is limited to accessing a very small window (1 MiB) of memory,
which is described as a reserved memory region in the device tree.

On these two platforms, the maximum buffer size is given as 512 KiB.
The MediaTek common code uses the same value for preallocations. This
means that only the first two PCM substreams get preallocations, and
then the whole space is exhausted, barring any other substreams from
working. Since the substreams used are not always the first two, this
means audio won't work correctly.

This is observed on the MT8188 Geralt Chromebooks, on which the
"mediatek,dai-link" property was dropped when it was upstreamed. That
property causes the driver to only register the PCM substreams listed
in the property, and in the order given.

Instead of trying to compute an optimal value and figuring out which
streams are used, simply disable preallocation. The PCM buffers are
managed by the core and are allocated and released on the fly. There
should be no impact to any of the other MediaTek platforms.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20241219105303.548437-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-19 11:15:09 +00:00
Easwar Hariharan
b4f014f9da ALSA: line6: convert timeouts to secs_to_jiffies()
Commit b35108a51c ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies().  As the value here is a multiple of 1000, use
secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.

This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
the following Coccinelle rules:

@@ constant C; @@

- msecs_to_jiffies(C * 1000)
+ secs_to_jiffies(C)

@@ constant C; @@

- msecs_to_jiffies(C * MSEC_PER_SEC)
+ secs_to_jiffies(C)

Link: https://lkml.kernel.org/r/20241210-converge-secs-to-jiffies-v3-19-ddfefd7e9f2a@linux.microsoft.com
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Daniel Mack <daniel@zonque.org>
Cc: David Airlie <airlied@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dick Kennedy <dick.kennedy@broadcom.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Jack Wang <jinpu.wang@cloud.ionos.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: James Smart <james.smart@broadcom.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Jeff Johnson <jjohnson@kernel.org>
Cc: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jeroen de Borst <jeroendb@google.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Joe Lawrence <joe.lawrence@redhat.com>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
Cc: Julia Lawall <julia.lawall@inria.fr>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: Louis Peens <louis.peens@corigine.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Naveen N Rao <naveen@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Nicolas Palix <nicolas.palix@imag.fr>
Cc: Oded Gabbay <ogabbay@kernel.org>
Cc: Ofir Bitton <obitton@habana.ai>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Praveen Kaligineedi <pkaligineedi@google.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Roger Pau Monné <roger.pau@citrix.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: Shailend Chand <shailend@google.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Simon Horman <horms@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-12-18 19:51:38 -08:00
Shengjiu Wang
cf126261d5
ASoC: fsl_asrc_m2m: force cast for snd_pcm_format_t type
Fix sparse warnings:

fsl_asrc_m2m.c:360:45: sparse: warning: incorrect type in argument 1 (different base types)
fsl_asrc_m2m.c:360:45: sparse:    expected restricted snd_pcm_format_t [usertype] pcm_forma
fsl_asrc_m2m.c:360:45: sparse:    got unsigned int [usertype] format
fsl_asrc_m2m.c:361:41: sparse: warning: incorrect type in assignment (different base types)
fsl_asrc_m2m.c:361:41: sparse:    expected restricted snd_pcm_format_t
fsl_asrc_m2m.c:361:41: sparse:    got unsigned int [usertype] format
fsl_asrc_m2m.c:365:45: sparse: warning: incorrect type in argument 1 (different base types)
fsl_asrc_m2m.c:365:45: sparse:    expected restricted snd_pcm_format_t [usertype] pcm_forma
fsl_asrc_m2m.c:365:45: sparse:    got unsigned int [usertype] pcm_format
fsl_asrc_m2m.c:366:42: sparse: warning: incorrect type in assignment (different base types)
fsl_asrc_m2m.c:366:42: sparse:    expected restricted snd_pcm_format_t
fsl_asrc_m2m.c:366:42: sparse:    got unsigned int [usertype] pcm_format
fsl_asrc_m2m.c:595:54: sparse: warning: incorrect type in assignment (different base types)
fsl_asrc_m2m.c:595:54: sparse:    expected unsigned int [usertype] formats
fsl_asrc_m2m.c:595:54: sparse:    got restricted snd_pcm_format_t [assigned] [usertype] k

Fixes: 24a01710f6 ("ASoC: fsl_asrc_m2m: Add memory to memory function")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412180043.PAA4t4sQ-lkp@intel.com/
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20241218024358.3022635-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-18 14:17:40 +00:00
Shuming Fan
c9e3ebdc52
ASoC: rt722: add delay time to wait for the calibration procedure
The calibration procedure needs some time to finish.
This patch adds the delay time to ensure the calibration procedure is completed correctly.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20241218091307.96656-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-18 14:17:32 +00:00
Colin Ian King
d349fd151f
ASoC: soc-core: remove redundant assignment to variable ret
The variable ret is being assigned a zero value that is never read,
it is being re-assigned a new value from the return value from the
call to snd_soc_dapm_add_routes. The assignment is redundant and can
be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20241217171151.354550-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-17 17:32:33 +00:00
Wolfram Sang
db8b9b1289
ASoC: cs42l43: don't include '<linux/find.h>' directly
The header clearly states that it does not want to be included directly,
only via '<linux/bitmap.h>'. Replace the include accordingly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20241217070545.2533-2-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-17 13:27:39 +00:00
Peter Ujfalusi
e8d0ba147d
ASoC: SOF: Intel: hda-dai: Do not release the link DMA on STOP
The linkDMA should not be released on stop trigger since a stream re-start
might happen without closing of the stream. This leaves a short time for
other streams to 'steal' the linkDMA since it has been released.

This issue is not easy to reproduce under normal conditions as usually
after stop the stream is closed, or the same stream is restarted, but if
another stream got in between the stop and start, like this:
aplay -Dhw:0,3 -c2 -r48000 -fS32_LE /dev/zero -d 120
CTRL+z
aplay -Dhw:0,0 -c2 -r48000 -fS32_LE /dev/zero -d 120

then the link DMA channels will be mixed up, resulting firmware error or
crash.

Fixes: ab5593793e ("ASoC: SOF: Intel: hda: Always clean up link DMA during stop")
Cc: stable@vger.kernel.org
Closes: https://github.com/thesofproject/sof/issues/9695
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241217091019.31798-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-17 13:21:10 +00:00
Alexey Klimov
8bfb66c75c
ASoC: qcom: sdm845: add handling of secondary MI2S clock
Add handling of clock related to secondary MI2S_RX in startup, shutdown
and hw params routines. The handing of MI2S_TX and SEC_MI2S clock is
already there so this requires only placing SECONDARY_MI2S_RX in the
correct switch-case choices.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Link: https://patch.msgid.link/20241205023344.2232529-3-alexey.klimov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 22:04:44 +00:00
Mark Brown
a5dfca553c
ASoC: Intel: Add matches for Cirrus Logic CDB35L56
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

This series adds TGL and MTL matches for configurations using the
Cirrus Logic CDB35L56-EIGHT-C board.
2024-12-16 18:25:51 +00:00
Linus Torvalds
f44d154d6e soc: fixes for 6.13
There are three small fixes for the soc tree:
 
  - A devicetee fix for the Arm Juno reference machine, so allow more
    interesting PCI configurations
 
  - A build fix for SCMI firmware on the NXP i.MX platform
 
  - A fix for a race condition in Arm FF-A firmware
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmdgNf4ACgkQYKtH/8kJ
 Uid99g/9Eve2yPqK+nAqlfFs20NE/cDvdaQ9n2Z+rU5igpvrqR62rBVG2v7AuFHZ
 w8Awl2iB57y1XdCxG8FE0wQ+TloiN+aLwgmbUh2st2fTjmPh6KgGq6jsGbvDli07
 WrlH4PxxMm8axO2HwEWiSLsQBpeoqYvgO+6GDW5eXLtsbr6VuFNBoD6ExC/YVqsQ
 kCdHG+WrjA+rZyXjYZqlAknLaldLEplVPmh9riZEcdYh02QE5VXU53+ctUtYZENU
 VGM/638YAlnCANKYH9u5e8YmL2RgiLLNS63xSdO0krv/gCEor3txKvcG6Cie+76d
 n0bOu13kWdcJbrt0+wVR6ILCffAurhxZZ6L3Q+iSqJ0as/eBXeZtBKYyEl5w6vZf
 X32TkPmx3cvCTZG8Vs+0e4JlC/5wiPrPCTdQSStTckp7FDEs9sttEpeZWenYJNQY
 7hVFj2Nx8SFv0JCB9N68CJB1KkhhRkAqNq6aKymTNJZLxAd72xJm3sOlDmOPRJ43
 9j6LwQ6panUk49WNRklwuL0YajcX1jTS/MRHQfKtVCOfBD05A0BaQEDeAUeYfq2V
 rCFphvZn315fv6h1XLP0LkBTOJ0f+3X+0GcwtMUX8TC/AJXPnKHAuZKmujmVH8Uh
 mtfvVlUuvnw73LM/QlyAaG/D9Tj2wHtN2HNtTaGl6CY6zdeznRw=
 =+t0h
 -----END PGP SIGNATURE-----

Merge tag 'soc-fixes-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC fixes from Arnd Bergmann:
 "Three small fixes for the soc tree:

   - devicetee fix for the Arm Juno reference machine, to allow more
     interesting PCI configurations

   - build fix for SCMI firmware on the NXP i.MX platform

   - fix for a race condition in Arm FF-A firmware"

* tag 'soc-fixes-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  arm64: dts: fvp: Update PCIe bus-range property
  firmware: arm_ffa: Fix the race around setting ffa_dev->properties
  firmware: arm_scmi: Fix i.MX build dependency
2024-12-16 10:10:53 -08:00
Mark Brown
001a3d5e8b
ASoC: Intel: sof_sdw: Update DMI matches for Lenovo
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

The DMI match information for these models has changed so the match
entries need updates.
2024-12-16 17:10:37 +00:00
Dr. David Alan Gilbert
37c42bde28
ASoC: rt715: Remove unused hda_to_sdw
hda_to_sdw() has been unused since it was added in 2020 as part of the
commit d1ede0641b ("ASoC: rt715: add RT715 codec driver")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20241216135110.53426-1-linux@treblig.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 15:12:49 +00:00
Richard Fitzgerald
ba7d47a54b
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 21QA and 21QB
Update the DMI match for a Lenovo laptop to the new DMI identifier.

This laptop ships with a different DMI identifier to what was expected,
and now has two identifiers.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: ea657f6b24 ("ASoC: Intel: sof_sdw: Add quirk for cs42l43 system using host DMICs")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241216140821.153670-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 14:28:58 +00:00
Richard Fitzgerald
7c449ef0fd
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 21Q6 and 21Q7
Update the DMI match for a Lenovo laptop to the new DMI identifier.

This laptop ships with a different DMI identifier to what was expected,
and now has two identifiers.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 83c062ae81 ("ASoC: Intel: sof_sdw: Add quirks for some new Lenovo laptops")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241216140821.153670-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 14:28:57 +00:00
Kuninori Morimoto
5725bce709
ASoC: simple-card-utils: Unify clock direction by clk_direction
Original sample-card assumes SND_SOC_CLOCK_IN is used for
snd_soc_dai_set_sysclk(), but someday, Codec uses SND_SOC_CLOCK_IN
and CPU uses SND_SOC_CLOCK_OUT at hw_params(), and dai->clk_direction
is used at simple_init_dai().

There is no uniformity today. Let's use dai->clk_direction for all cases.

Fortunately, almost all DAI doesn't care about "dir"
(= SND_SOC_CLOCK_IN/OUT) in .set_sysclk callback function (which is called
in snd_soc_dai_set_sysclk()), so this patch has no effect in such DAIs.

But this patch might breaks some existing Sound Card. Use
"system-clock-direction-out" property if it needs to use SND_SOC_CLOCK_OUT

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87y10lu0gx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 12:31:29 +00:00
Kuninori Morimoto
301c26a018
ASoC: soc-pcm: don't use soc_pcm_ret() on .prepare callback
commit 1f56643514 ("ASoC: lower "no backend DAIs enabled for ... Port"
log severity") ignores -EINVAL error message on common soc_pcm_ret().
It is used from many functions, ignoring -EINVAL is over-kill.

The reason why -EINVAL was ignored was it really should only be used
upon invalid parameters coming from userspace and in that case we don't
want to log an error since we do not want to give userspace a way to do
a denial-of-service attack on the syslog / diskspace.

So don't use soc_pcm_ret() on .prepare callback is better idea.

Link: https://lore.kernel.org/r/87v7vptzap.wl-kuninori.morimoto.gx@renesas.com
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87bjxg8jju.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 12:31:28 +00:00
Kuninori Morimoto
abf594ce91
ASoC: soc-core: tidyup ret handling for card->disable_route_checks
commit a22ae72b86 ("ASoC: soc-core: disable route checks for legacy
devices") added card->disable_route_checks to disable route checks
for legacy devices at soc_probe_component() and snd_soc_bind_card().

And commit 6974857c2b ("ASoC: topology: Do not ignore route checks
when parsing graphs") tidyup soc-topology for same reason.

In snd_soc_bind_card() case, if snd_soc_dapm_add_routes() (A) error,
but has card->disable_route_checks case (B), it will indicate
dev_info() only, and then, next function (C) will be called.
Thus, "ret" will be over written, and it is handled as non-error.

	static int snd_soc_bind_card(...)
	{
		...
(A)		ret = snd_soc_dapm_add_routes(...);
		if (ret < 0) {
(B)			if (card->disable_route_checks) {
				dev_info(...);
			} else {
				...
				goto probe_end;
			}
		}

(C)		ret = snd_soc_dapm_add_routes(...);
		...

In soc_probe_component() case, if snd_soc_dapm_add_routes() (a)
error, and has card->disable_route_checks case (b), it will indicate
dev_info(). But there is no next function after that, this means ret is
still indicating error, and will not be over written.
So error handline (c) will be handled, and will return error (d)

	static int soc_probe_component(...)
	{
		...
(a)		ret = snd_soc_dapm_add_routes(...);
		if (ret < 0) {
(b)			if (card->disable_route_checks) {
				dev_info(...);
			} else {
				...
				goto err_probe;
			}
		}

		/* see for_each_card_components */
		list_add(...);

	err_probe:
(c)		if (ret < 0)
			soc_remove_component(...);

(d)		return ret;
	}

In soc_tplg_dapm_graph_elems_load() case, snd_soc_dapm_add_routes()
is called in for loop (1). if it was error (2), and doesn't have
card->disable_route_checks case flag (3), it will break from loop.
If card has flag, it will indicate dev_info() and handled as non-error.
But ret is still indicating error in this case. If this error happen
in last of loop, if will return error (4).

	static int soc_tplg_dapm_graph_elems_load(...)
	{
		...
(1)		for (i = 0; i < count; i++) {
			...
(2)			ret = snd_soc_dapm_add_routes(...);
			if (ret) {
(3)				if (!dapm->card->disable_route_checks) {
					dev_err(...);
					break;
				}
				dev_info(...);
			}
		}

(4)		return ret;
	}

This patch set "ret = 0" for each case.

Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87wmg5tzra.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 12:31:26 +00:00
Richard Fitzgerald
6dcc8e7f2b
ASoC: Intel: mtl-match: Add CDB35L56-EIGHT-C 8x CS35L56 without CS42L43
This adds a match entry for using all the amps on a CDB35L56-EIGHT-C board
without the CS42L43 codec. Configuration is:

  SDW0: 4x CS35L56 (OUT1, OUT2, OUT3, OUT4)
  SDW1: 4x CS35L56 (OUT5, OUT6, OUT7, OUT8)

Speaker playback and amp feedback are aggregated.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241216032721.131227-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 12:31:16 +00:00
Richard Fitzgerald
bc7bd5c335
ASoC: Intel: mtl-match: Add CDB35L56-EIGHT-C with aggregated speakers
This adds a match for the CDB35L56-EIGHT-C board with SmartCodec and
SmartAmp speakers aggregated.

The configuration is:

  SDW0: CS35L56 x2 (SmartAmp) using OUT1 and OUT2
  SDW1: CS35L56 x2 (SmartAmp) using OUT7 and OUT8
  SDW3: CS42L43 (SmartJack, SmartMic, SmartAmp)

CS35L56 and CS42L43 Speaker playback is aggregated across all 3 buses.

The device addresses and reset arrangements of the EIGHT-C board are
quirky hence the use of non-contiguous outputs OUT1,2,7,8.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241216032721.131227-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 12:31:15 +00:00
Richard Fitzgerald
bf4519f4b1
ASoC: Intel: tgl-match: Add entries for CS35L56 on CDB35L56-EIGHT-C
This adds match entries for the eight CS35L56 amps on the Cirrus Logic
CDB35L56-EIGHT-C board. Speaker playback and amp feedback are aggregated
across all amps on both SoundWire buses.

The mapping of SoundWire addresses to AMPn numbers matches the actual
order of amps on the EIGHT-C board. The SoundWire unique ID is in reverse
order for amps 1..4 on these boards, and the amp resets are paired
1+8, 2+7, 3+6, 4+5.

This then makes the entries from cs35l56_sdw_eight_1_4_fb_adr and
cs35l56_sdw_eight_5_8_fb_adr match the way the amp resets are paired on
the EIGHT-C board.

[0] = 1 + 8
[1] = 2 + 7
[3] = 3 + 6
[4] = 4 + 5

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241216032721.131227-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 12:31:14 +00:00
Venkata Prasad Potturu
88438444fd
ASoC: amd: ps: Fix for enabling DMIC on acp63 platform via _DSD entry
Add condition check to register ACP PDM sound card by reading
_WOV acpi entry.

Fixes: 0386d765f2 ("ASoC: amd: ps: refactor acp device configuration read logic")

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20241213061147.1060451-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-16 12:31:03 +00:00
Mark Brown
5ce3beed07
ASoC: fsl: add memory to memory function for ASRC
Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

This function is base on the accelerator implementation
for compress API:
04177158cf ("ALSA: compress_offload: introduce accel operation mode")

Audio signal processing also has the requirement for memory to
memory similar as Video.

This asrc memory to memory (memory ->asrc->memory) case is a non
real time use case.

User fills the input buffer to the asrc module, after conversion, then asrc
sends back the output buffer to user. So it is not a traditional ALSA playback
and capture case.

Because we had implemented the "memory -> asrc ->i2s device-> codec"
use case in ALSA.  Now the "memory->asrc->memory" needs
to reuse the code in asrc driver, so the patch 1 and patch 2 is for refining
the code to make it can be shared by the "memory->asrc->memory"
driver.

Other change is to add memory to memory support for two kinds of i.MX ASRC
modules.
2024-12-13 17:33:09 +00:00
Mark Brown
9b94f41449
ASoC: SOF: core/Intel: Handle pause supported token
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

A new set of tokens have been added to SOF topology to indicate that the pause
operation is supported or not on the given PCM device.
Pause is an optional feature that depends on pipeline, topology and modules
used by the PCM.

Add a pause_supported flag to snd_sof_pcm_stream and use this flag in Intel
platform code to keep the pause support enabled or to disable it.
2024-12-13 17:33:00 +00:00
Peter Ujfalusi
f851b987f3
ASoC: SOF: sof-priv: Remove unused SOF_DAI_STREAM() and SOF_FORMATS
The following definitions have no users: SOF_DAI_STREAM() and SOF_FORMATS,
they can be dropped from the header file.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241213131717.24071-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 13:25:52 +00:00
Peter Ujfalusi
e4b3a84564
ASoC: SOF: ipc4-topology: Use macro to set the EXT_PARAM_SIZE in widget setup
Use the SOF_IPC4_MOD_EXT_PARAM_SIZE() macro to set the param size in the
extension part of the IPC message for clarity.

No Functional change as the PARMA_SIZE offset is at 0.

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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241213132110.27800-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 13:25:51 +00:00
Peter Ujfalusi
3a47319d2d
ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support
If the stream's pause_supported flag is false then mask out the PAUSE
support, so user space will be prevented to use it.

Introduce a module parameter to ignore the pause_supported flag, named as
force_pause_support to allow testing of the PAUSE feature.

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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241213101123.27318-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 13:10:30 +00:00
Peter Ujfalusi
70a667d70c
ASoC: SOF: Add support for pause supported tokens from topology
New tokens are added to topology:
1202: SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED
1203: SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED

The new tokens are used to advertise support for PAUSE/RESUME operation on
a PCM device depending on firmware product, use case, pipeline topology.

The snd_sof_pcm_stream.pause_supported is updated to reflect the advertised
value for the PCM device.

If the token does not exist then the pause_supported is set to false.

Note: it is up to the platform code to use this flag to decide to advertise
the PAUSE support for user space or not.

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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241213101123.27318-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 13:10:29 +00:00
Shengjiu Wang
b62eaff065
ASoC: fsl_easrc: register m2m platform device
Register m2m platform device,that user can
use M2M feature.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-7-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 08:57:11 +00:00
Shengjiu Wang
286d658477
ASoC: fsl_asrc: register m2m platform device
Register m2m platform device, that user can
use M2M feature.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-6-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 08:57:10 +00:00
Shengjiu Wang
24a01710f6
ASoC: fsl_asrc_m2m: Add memory to memory function
Implement the ASRC memory to memory function using
the compress framework, user can use this function with
compress ioctl interface.

This feature can be shared by ASRC and EASRC drivers

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-5-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 08:57:09 +00:00
Shengjiu Wang
27147695aa
ASoC: fsl_easrc: define functions for memory to memory usage
ASRC can be used on memory to memory case, define several
functions for m2m usage and export them as function pointer.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-4-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 08:57:08 +00:00
Shengjiu Wang
8ea7d04a4e
ASoC: fsl_asrc: define functions for memory to memory usage
ASRC can be used on memory to memory case, define several
functions for m2m usage.

m2m_prepare: prepare for the start step
m2m_start: the start step
m2m_unprepare: unprepare for stop step, optional
m2m_stop: stop step
m2m_check_format: check format is supported or not
m2m_calc_out_len: calculate output length according to input length
m2m_get_maxburst: burst size for dma
m2m_pair_suspend: suspend function of pair, optional.
m2m_pair_resume: resume function of pair
get_output_fifo_size: get remaining data size in FIFO

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-13 08:57:07 +00:00
Takashi Iwai
7b26bc6582 ASoC: Fixes for v6.13
A small pile of driver specific fixes, all quite small and not
 particularly major.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmda4CsACgkQJNaLcl1U
 h9BYGwf/W+MWujoP9buzCXg5gIDm9PAMyL8wbo2RdeaevzzGgFtN1Qlbs8thJU/M
 Zo2dsnoSSd/S0RN2xgywKALCcNkL2wc/BE+hbOTcm1vk7JeonggzAQjdk2Mvt9un
 CtvqayQNNycNRU+xvBiyc3j8q1BvKkt+jWdkzMYRLraVm//hseMXyRo9nolLMRxU
 22d7tzYE0qdAS5Zkd3lGOgQW6v5kMih+h0QtwsaqEZb0LOtzqJmr8gNx4DZXdg50
 cSsPzgdPM7vKC1/LnwY7SdLHxSl9Uga3vNiDR6y0O9PgCtOlEJe5oydSBvFo4/32
 dE1qIlg8jEEidTmVpWcDThHM4D/4lw==
 =/FQk
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.12-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.13

A small pile of driver specific fixes, all quite small and not
particularly major.
2024-12-12 14:49:35 +01:00
Charles Keepax
255cc582e6
ASoC: Intel: sof_sdw: Add space for a terminator into DAIs array
The code uses the initialised member of the asoc_sdw_dailink struct to
determine if a member of the array is in use. However in the case the
array is completely full this will lead to an access 1 past the end of
the array, expand the array by one entry to include a space for a
terminator.

Fixes: 27fd36aefa ("ASoC: Intel: sof-sdw: Add new code for parsing the snd_soc_acpi structs")
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212105742.1508574-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-12 11:08:49 +00:00
Shengjiu Wang
bb76e82bfe
ASoC: fsl_spdif: change IFACE_PCM to IFACE_MIXER
As the snd_soc_card_get_kcontrol() is updated to use
snd_ctl_find_id_mixer() in
commit 897cc72b08 ("ASoC: soc-card: Use
snd_ctl_find_id_mixer() instead of open-coding")
which make the iface fix to be IFACE_MIXER.

Fixes: 897cc72b08 ("ASoC: soc-card: Use snd_ctl_find_id_mixer() instead of open-coding")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20241126053254.3657344-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 18:45:27 +00:00
Shengjiu Wang
7c17f7780a
ASoC: fsl_xcvr: change IFACE_PCM to IFACE_MIXER
As the snd_soc_card_get_kcontrol() is updated to use
snd_ctl_find_id_mixer() in
commit 897cc72b08 ("ASoC: soc-card: Use
snd_ctl_find_id_mixer() instead of open-coding")
which make the iface fix to be IFACE_MIXER.

Fixes: 897cc72b08 ("ASoC: soc-card: Use snd_ctl_find_id_mixer() instead of open-coding")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20241126053254.3657344-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 18:45:26 +00:00
Shenghao Ding
2aa13da97e
ASoC: tas2781: Fix calibration issue in stress test
One specific test condition: the default registers of p[j].reg ~
p[j+3].reg are 0, TASDEVICE_REG(0x00, 0x14, 0x38)(PLT_FLAG_REG),
TASDEVICE_REG(0x00, 0x14, 0x40)(SINEGAIN_REG), and
TASDEVICE_REG(0x00, 0x14, 0x44)(SINEGAIN2_REG). After first calibration,
they are freshed to TASDEVICE_REG(0x00, 0x1a, 0x20), TASDEVICE_REG(0x00,
0x16, 0x58)(PLT_FLAG_REG), TASDEVICE_REG(0x00, 0x14, 0x44)(SINEGAIN_REG),
and TASDEVICE_REG(0x00, 0x16, 0x64)(SINEGAIN2_REG) via "Calibration Start"
kcontrol. In second calibration, the p[j].reg ~ p[j+3].reg have already
become tas2781_cali_start_reg. However, p[j+2].reg, TASDEVICE_REG(0x00,
0x14, 0x44)(SINEGAIN_REG), will be freshed to TASDEVICE_REG(0x00, 0x16,
0x64), which is the third register in the input params of the kcontrol.
This is why only first calibration can work, the second-time, third-time
or more-time calibration always failed without reboot. Of course, if no
p[j].reg is in the list of tas2781_cali_start_reg, this stress test can
work well.

Fixes: 49e2e353fb ("ASoC: tas2781: Add Calibration Kcontrols for Chromebook")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20241211043859.1328-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:27:45 +00:00
Thorsten Blum
42d28736a5 ALSA: sonicvibes: Use str_on_off() helper in snd_sonicvibes_proc_read()
Remove hard-coded strings by using the str_on_off() helper function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20241210172428.139643-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-12-11 14:24:32 +01:00
Claudiu Beznea
1fc778f7c8
ASoC: renesas: rz-ssi: Add suspend to RAM support
The SSIF-2 IP is available on the Renesas RZ/G3S SoC. The Renesas RZ/G3S
SoC supports a power-saving mode where power to most of the SoC
components is turned off. Add suspend/resume support to the SSIF-2 driver
to support this power-saving mode.

On SNDRV_PCM_TRIGGER_SUSPEND trigger the SSI is stopped (the stream
user pointer is left untouched to avoid breaking user space and the dma
buffer pointer is set to zero), on SNDRV_PCM_TRIGGER_RESUME software reset
is issued for the SSIF-2 IP and the clocks are re-configured.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-18-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:07 +00:00
Claudiu Beznea
fc2a31affb
ASoC: renesas: rz-ssi: Issue software reset in hw_params API
The code initially issued software reset on SNDRV_PCM_TRIGGER_START
action only before starting the first stream. This can be easily moved to
hw_params() as the action is similar to setting the clocks. Moreover,
according to the hardware manual (Table 35.7 Bits Initialized by Software
Reset of the SSIFCR.SSIRST Bit) the software reset action acts also on the
clock dividers bits. Due to this issue the software reset in hw_params()
before configuring the clock dividers. This also simplifies the code in
trigger API.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-17-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:06 +00:00
Claudiu Beznea
3888672495
ASoC: renesas: rz-ssi: Add runtime PM support
Add runtime PM support to the ssi driver. This assert/de-assert the
reset lines on runtime suspend/resume. Along with it the de-assertion of
the reset line from probe function was removed as it is not necessary
anymore.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-16-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:05 +00:00
Claudiu Beznea
cf3a79e4f8
ASoC: renesas: rz-ssi: Enable runtime PM autosuspend support
Enable runtime PM autosuspend support. The chosen autosuspend delay is
zero for immediate autosuspend. In case there are users that need a
different autosuspend delay, it can be adjusted through sysfs.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-15-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:04 +00:00
Claudiu Beznea
e8fcf25f56
ASoC: renesas: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI
The ASoC subsystem takes care of runtime resume/suspend the audio
devices when needed. Just enable the runtime PM on the SSI driver and
let the subsystem runtime resume/suspend it. While at it use directly
the devm_pm_runtime_enable().

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-14-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:03 +00:00
Claudiu Beznea
f0c155c9da
ASoC: renesas: rz-ssi: Use goto label names that specify their actions
Use goto label names that specify their action. In this way we can have
a better understanding of what is the action associated with the label
by just reading the label name.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-13-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:02 +00:00
Claudiu Beznea
403366d2a4
ASoC: renesas: rz-ssi: Use temporary variable for struct device
Use a temporary variable for the struct device pointers to avoid
dereferencing.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-12-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:01 +00:00