Commit Graph

50995 Commits

Author SHA1 Message Date
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
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
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
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
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
Claudiu Beznea
4bf77dfa33
ASoC: renesas: rz-ssi: Use readl_poll_timeout_atomic()
Use readl_poll_timeout_atomic() instead of hardcoding something similar.
While at it replace dev_info() with dev_warn_ratelimited() as the
rz_ssi_set_idle() can also be called from IRQ context and if the SSI
idle is not properly set this is at least a warning for user.

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-11-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:24:00 +00:00
Claudiu Beznea
109e60866f
ASoC: renesas: rz-ssi: Remove the first argument of rz_ssi_stream_is_play()
The first argument of the rz_ssi_stream_is_play() is not used. Remove it.

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-10-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:23:59 +00:00
Claudiu Beznea
dec61e16e7
ASoC: renesas: rz-ssi: Remove the rz_ssi_get_dai() function
Remove the rz_ssi_get_dai() function and use directly the
snd_soc_rtd_to_cpu() where needed or the struct device pointer embedded
in the struct rz_ssi_priv objects.

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-9-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:23:58 +00:00
Claudiu Beznea
a73710a258
ASoC: renesas: rz-ssi: Remove pdev member of struct rz_ssi_priv
Remove the pdev member of struct rz_ssi_priv as it is not used.

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-8-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:23:57 +00:00
Claudiu Beznea
100c6b22d6
ASoC: renesas: rz-ssi: Fix typo on SSI_RATES macro comment
The SSI_RATES macro covers 8KHz-48KHz audio frequencies. Update macro
comment to reflect it.

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-7-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:23:56 +00:00
Claudiu Beznea
55c209cd43
ASoC: renesas: rz-ssi: Use only the proper amount of dividers
There is no need to populate the ckdv[] with invalid dividers as that
part will not be indexed anyway. The ssi->audio_mck/bclk_rate should
always be >= 0. While at it, change the ckdv type as u8, as the divider
128 was previously using the s8 sign bit.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Fixes: 03e786bd43 ("ASoC: sh: Add RZ/G2L SSIF-2 driver")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20241210170953.2936724-6-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:23:55 +00:00
Claudiu Beznea
541011dc2d
ASoC: renesas: rz-ssi: Terminate all the DMA transactions
The stop trigger invokes rz_ssi_stop() and rz_ssi_stream_quit().
- The purpose of rz_ssi_stop() is to disable TX/RX, terminate DMA
  transactions, and set the controller to idle.
- The purpose of rz_ssi_stream_quit() is to reset the substream-specific
  software data by setting strm->running and strm->substream appropriately.

The function rz_ssi_is_stream_running() checks if both strm->substream and
strm->running are valid and returns true if so. Its implementation is as
follows:

static inline bool rz_ssi_is_stream_running(struct rz_ssi_stream *strm)
{
    return strm->substream && strm->running;
}

When the controller is configured in full-duplex mode (with both playback
and capture active), the rz_ssi_stop() function does not modify the
controller settings when called for the first substream in the full-duplex
setup. Instead, it simply sets strm->running = 0 and returns if the
companion substream is still running. The following code illustrates this:

static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
{
    strm->running = 0;

    if (rz_ssi_is_stream_running(&ssi->playback) ||
        rz_ssi_is_stream_running(&ssi->capture))
        return 0;

    // ...
}

The controller settings, along with the DMA termination (for the last
stopped substream), are only applied when the last substream in the
full-duplex setup is stopped.

While applying the controller settings only when the last substream stops
is not problematic, terminating the DMA operations for only one substream
causes failures when starting and stopping full-duplex operations multiple
times in a loop.

To address this issue, call dmaengine_terminate_async() for both substreams
involved in the full-duplex setup when the last substream in the setup is
stopped.

Fixes: 4f8cd05a43 ("ASoC: sh: rz-ssi: Add full duplex support")
Cc: stable@vger.kernel.org
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20241210170953.2936724-5-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-11 13:23:54 +00:00
Mark Brown
c56078128c
ASoC: simple-card-utils: tidyup for Multi connection
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

These patches tidyup simple-card-utils for Multi connection of
Audio Graph Card, Because of DT node parsing, it should check port
1st instead of endpoint. Otherwise, it can't handle DAI correctly.
2024-12-10 13:46:41 +00:00
Mark Brown
527acf5de4
Add function to constrain rates
Merge series from Chancel Liu <chancel.liu@nxp.com>:

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. Add common function to constrain
rates according to different clock sources.

In ASoC drivers switch to this new function.
2024-12-10 12:37:21 +00:00
Mark Brown
5a305d9d48
ASoC: sun4i-spdif: Add 24bit support
Merge series from codekipper@gmail.com:

I've tested this patch series on the Allwinner H3, A64, H6 and H313 SoCs
up to 192KHz.
24bit support is working on my H313 board but 16bit plays a bit slow and
I suspect that there is an issue with the clock setups. This is even
present without this patch stack. I would look to address this asap,
but for now can you please review what's here.
2024-12-10 12:37:17 +00:00
Mark Brown
8c695b4d19
ASoC: Intel: boards: updates for 6.14
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

1. Fix the incorrect cfg-mics value in card->components string.
2. New codec match entries supports.

Bard Liao (6):
  ASoC: Intel: sof_sdw: correct mach_params->dmic_num
  ASoC: Intel: sof_sdw: reduce log level for not using internal dmic
  ASoC: Intel: sof_sdw: improve the log of DAI link numbers
  ASoC: Intel: soc-acpi-intel-ptl-match: add rt712_vb + rt1320 support
  ASoC: Intel: soc-acpi-intel-lnl-match: add rt713_vb_l2_rt1320_l13
    support
  ASoC: Intel: soc-acpi-intel-ptl-match: add rt713_vb_l2_rt1320_l13
    support

Simon Trimmer (4):
  ASoC: Intel: sof_sdw: Correct quirk for Lenovo Yoga Slim 7
  ASoC: Intel: sof_sdw: Add a dev_dbg message for the SOC_SDW_CODEC_MIC
    quirk
  ASoC: Intel: soc-acpi: arl: Correct naming of a cs35l56 address struct
  ASoC: Intel: soc-acpi: arl: Add match entries for new cs42l43 laptops

 sound/soc/intel/boards/sof_sdw.c              |  33 ++--
 .../intel/common/soc-acpi-intel-arl-match.c   |  45 +++++-
 .../intel/common/soc-acpi-intel-lnl-match.c   |  70 +++++++++
 .../intel/common/soc-acpi-intel-ptl-match.c   | 148 ++++++++++++++++++
 4 files changed, 282 insertions(+), 14 deletions(-)

--
2.43.0
2024-12-10 12:37:13 +00:00
Marcus Cooper
6e750d3ec7
ASoC: sun4i-spdif: Add working 24bit audio support
24 bit audio file can be detected by the alsa driver as S32_LE.
Add this format to what is supported and change the DMA address
width.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Link: https://patch.msgid.link/20241111165600.57219-4-codekipper@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 14:07:58 +00:00
Marcus Cooper
80ac12ffb3
ASoC: sun4i-spdif: Always set the valid data to be the MSB
This doesn't affect 16bit formats and allows us to properly run
24bit formats.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Link: https://patch.msgid.link/20241111165600.57219-3-codekipper@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 14:07:57 +00:00
George Lander
0a2319308d
ASoC: sun4i-spdif: Add clock multiplier settings
There have been intermittent issues with the SPDIF output on H3
and H2+ devices which has been fixed by setting the s_clk to 4
times the audio pll.
Add a quirk for the clock multiplier as not every supported SoC
requires it. Without the multiplier, the audio at normal sampling
rates was distorted and did not play at higher sampling rates.

Fixes: 1bd92af877 ("ASoC: sun4i-spdif: Add support for the H3 SoC")
Signed-off-by: George Lander <lander@jagmn.com>
Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Link: https://patch.msgid.link/20241111165600.57219-2-codekipper@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 14:07:56 +00:00
Andrew Davis
7d57d1ce93
ASoC: wm8985: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-21-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:46 +00:00
Andrew Davis
77f3bfeacb
ASoC: wm8904: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-20-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:45 +00:00
Andrew Davis
cb47dcedef
ASoC: tpa6130a2: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-19-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:44 +00:00
Andrew Davis
2a169c459d
ASoC: tlv320aic3x: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-18-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:43 +00:00
Andrew Davis
f742875ee2
ASoC: tlv320aic31xx: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-17-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:42 +00:00
Andrew Davis
55cf63cc8d
ASoC: tlv320adc3xxx: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-16-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:41 +00:00
Andrew Davis
06c6107017
ASoC: tas5720: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-15-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:40 +00:00
Andrew Davis
af4cffb250
ASoC: tas2781: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-14-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:39 +00:00
Andrew Davis
eb4b5da0ec
ASoC: tas2562: Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-13-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09 13:12:38 +00:00