Commit Graph

1464159 Commits

Author SHA1 Message Date
Dmitry Torokhov
3906ea776a
ASoC: tlv320aic32x4: remove global header with platform data
Commit 69d5b62c4b ("ASoC: codec: tlv320aic32x4: Drop aic32x4_pdata
usage") removed support for platform data, but left a global header file
with #defines and platform data structure.

Move the contents to the driver-private header.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20260726010519.117805-1-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-30 00:17:08 +01:00
Mark Brown
875e906efd
ASoC: ti: preparation for Card capsuling
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> says:

I will post Card capsuling patch.
To makes its review easy, tidyup its drivers to reduce
un-related diff as preparation.
No functional change, but is preparation for cleanup driver.

Link: https://patch.msgid.link/87ldb5i0do.wl-kuninori.morimoto.gx@renesas.com
2026-07-29 15:51:21 +01:00
Kuninori Morimoto
3596abbd7b
ASoC: ti: ams-delta: use &pdev->dev instead of card->dev
ams_delta_probe() will be updated when Card capsuling.
To makes its review easy, use &pdev->dev instead of card->dev.
These are same

	card->dev = &pdev->dev;

No functional change, but is preparation for Card capsuling.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87h5lti0cu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:49:31 +01:00
Kuninori Morimoto
4bd2afcdc8
ASoC: ti: tidyup not to use *card on rx51_soc_probe()
struct snd_soc_card will be capsuled soon, its member will not be
able to access from non soc-card.c.

To reduce the difference during conversion, replace dev.

	- card->dev, ...
	+ dev, ...

No functional change, but is preparation for Card capsuling.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/87ik69i0d0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:49:30 +01:00
Kuninori Morimoto
9af2c1d4f8
ASoC: ti: omap-hdmi: remove unused *card
No one is using ad->card. Remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87jyqpi0d9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:49:29 +01:00
Mark Brown
6d291d687d
ASoC: sunxi: Simplify error handling
bui duc phuc <phucduc.bui@gmail.com> says:

This series improves probe error handling in the sunxi ASoC drivers.
It replaces suitable probe error paths with dev_err_probe() to
simplify the code and handle deferred probe errors consistently.
It also removes redundant error messages where the called helpers
already report failures, avoiding duplicate log messages.

Build tested only.

Link: https://patch.msgid.link/20260715095525.40668-1-phucduc.bui@gmail.com
2026-07-29 15:29:35 +01:00
bui duc phuc
bb0d825c8a
ASoC: sunxi: sun8i-codec-analog: Improve probe error handling
Drop the redundant error message after devm_platform_ioremap_resource(),
which already reports failures, and use dev_err_probe() for regmap
initialization errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260715095525.40668-7-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:29:34 +01:00
bui duc phuc
76a770c30b
ASoC: sunxi: sun50i-codec-analog: Improve probe error handling
Drop the redundant error message after devm_platform_ioremap_resource(),
which already reports failures, and use dev_err_probe() for regmap
initialization errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260715095525.40668-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:29:33 +01:00
bui duc phuc
ac95bdb982
ASoC: sunxi: sun4i-spdif: Use dev_err_probe() for probe error handling
Use dev_err_probe() for probe error handling to simplify the error paths
and handle -EPROBE_DEFER correctly.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260715095525.40668-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:29:32 +01:00
bui duc phuc
3e2262df84
ASoC: sunxi: sun4i-i2s: Use dev_err_probe() for probe error handling
Use dev_err_probe() for probe error handling to simplify the error paths
and handle -EPROBE_DEFER correctly.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260715095525.40668-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:29:31 +01:00
bui duc phuc
de6bda2088
ASoC: sunxi: sun4i-codec: Drop redundant error messages
The called functions already log failures where appropriate. Return the
original error directly and avoid duplicate error messages.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260715095525.40668-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:29:30 +01:00
bui duc phuc
a8023598f3
ASoC: sunxi: sun4i-codec: Use dev_err_probe() for probe error handling
Use dev_err_probe() for probe error handling to simplify the error paths
and handle -EPROBE_DEFER correctly.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260715095525.40668-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-29 15:29:29 +01:00
Mark Brown
9d21577c23
ASoC: ti: Improve probe error handling
From: bui duc phuc <phucduc.bui@gmail.com> says:

This series cleans up probe error handling across several TI ASoC
drivers.

The changes fall into two categories:
 1.Replace dev_err() with dev_err_probe() when reporting probe
   failures. This preserves the original error code while suppressing
   unnecessary log messages for deferred probe errors.
 2.Preserve the original error codes returned by helper functions
   instead of converting them to -ENODEV, and remove redundant error
   messages where the helper already reports the failure.

Build-tested only.

Link: https://patch.msgid.link/20260716103911.77652-1-phucduc.bui@gmail.com
2026-07-28 19:44:03 +01:00
bui duc phuc
924448b41b
ASoC: ti: rx51: Use dev_err_probe() for error handling
Replace dev_err() with dev_err_probe() when reporting probe
failures. This preserves the original error code and suppresses
unnecessary log messages for deferred probe errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260716103911.77652-11-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:46 +01:00
bui duc phuc
31d9b5bc1a
ASoC: ti: omap-twl4030: Use dev_err_probe() for error handling
Replace dev_err() with dev_err_probe() when reporting
devm_snd_soc_register_card() failures. This suppresses
unnecessary log messages for deferred probe errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260716103911.77652-10-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:45 +01:00
bui duc phuc
23c89b7d91
ASoC: ti: omap-twl4030: Return the original error code
Return the error from snd_soc_of_parse_card_name() directly and drop
the redundant error message since the helper already logs the failure.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260716103911.77652-9-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:44 +01:00
bui duc phuc
492a53506a
ASoC: ti: omap-hdmi: Use dev_err_probe() for error handling
Replace dev_err() with dev_err_probe() when reporting
devm_snd_soc_register_card() failures. This suppresses
unnecessary log messages for deferred probe errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260716103911.77652-8-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:43 +01:00
bui duc phuc
fa1d248f16
ASoC: ti: omap-dmic: Use dev_err_probe() for error handling
Replace dev_err() with dev_err_probe() when handling clock lookup
failures. This preserves the original error code and suppresses
unnecessary deferred probe error messages.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260716103911.77652-7-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:43 +01:00
bui duc phuc
3e8b2361c6
ASoC: ti: omap-abe-twl6040: Use dev_err_probe() for error handling
Replace dev_err() with dev_err_probe() when reporting
devm_snd_soc_register_card() failures. This suppresses
unnecessary log messages for deferred probe errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260716103911.77652-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:42 +01:00
bui duc phuc
e0b2ab952d
ASoC: ti: omap-abe-twl6040: Preserve error code and drop redundant log
Return the original errors from the OF parsing helpers and remove the
redundant error messages, as the helpers already report failures.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260716103911.77652-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:41 +01:00
bui duc phuc
1a1145d1b2
ASoC: ti: j721e-evm: Return the original error from card name parsing
Return the error from snd_soc_of_parse_card_name() directly instead of
converting it to -ENODEV. The helper already logs the error, so drop the
redundant dev_err().

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260716103911.77652-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:40 +01:00
bui duc phuc
7ae5829ab0
ASoC: ti: davinci-evm: Use dev_err_probe() for error handling
Replace dev_err() with dev_err_probe() when reporting
devm_snd_soc_register_card() failures. This suppresses
unnecessary log messages for deferred probe errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260716103911.77652-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:39 +01:00
bui duc phuc
5413fb3ba5
ASoC: ti: ams-delta: Use dev_err_probe() for error handling
Use dev_err_probe() to replace dev_err() followed by returning
the error code. This keeps the error handling concise and
suppresses log messages for deferred probe errors.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260716103911.77652-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:43:38 +01:00
bui duc phuc
9167f26047
ASoC: soc-generic-dmaengine: Handle DMA channel request failures correctly
Currently any dma_request_chan() failure other than -EPROBE_DEFER is
silently ignored, since a missing channel is expected for devices that
only support one DMA direction.

Improve the handling of these failures by:
- reporting failures when a configured DMA channel cannot be requested;
- failing probe if neither playback nor capture obtains a DMA channel,
  since the PCM device would be unusable.

Devices that legitimately support only one DMA direction continue to
work as before.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260720064131.75156-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-28 19:38:32 +01:00
Randy Dunlap
14cdac7638
ASoC: SOF: ipc4-topology: repair struct kernel-doc comments
Use the correct struct names in the kernel-doc comments.
Add missing struct member descriptions.

This prevents all kernel-doc warnings:
Warning: ../sound/soc/sof/ipc4-topology.h:176 expecting prototype for struct sof_ipc4_multi_pipeline_data. Prototype was for struct ipc4_pipeline_set_state_data instead
Warning: ../sound/soc/sof/ipc4-topology.h:307 expecting prototype for struct sof_ipc4_dma_config. Prototype was for struct sof_ipc4_dma_config_tlv instead

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20260713175510.524728-2-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 20:28:04 +01:00
Randy Dunlap
34dfc478c9
ASoC: SOF: don't use "/**" for non-kernel-doc comments
Modify these errant comments to use "/*" since they are not kernel-doc
comments.

Warning: ../include/sound/sof/header.h:182 This comment starts with '/**', but isn't a kernel-doc comment.
 * OOPS header architecture specific data.
Warning: ../include/sound/sof/header.h:190 This comment starts with '/**', but isn't a kernel-doc comment.
 * OOPS header platform specific data.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20260713175510.524728-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 20:28:02 +01:00
Mark Brown
2b77b6f446
ASoC: ti: omap-twl4030: drop support for platform data
Dmitry Torokhov <dmitry.torokhov@gmail.com> says:

(nothing)

Link: https://patch.msgid.link/20260724233432.31325-1-dmitry.torokhov@gmail.com
2026-07-27 18:50:39 +01:00
Dmitry Torokhov
a9b7250a2f
ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio
hs_jack_gpios is being potentially shared among several instances of the
same device, and is being modified. This is not the best approach to
structuring the code (even if the device is in fact a singleton).
Change it to allocate a per-device instance.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260724233432.31325-2-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 18:50:38 +01:00
Dmitry Torokhov
0f97c75d15
ASoC: ti: omap-twl4030: drop support for platform data
There are no users of omap_tw4030_pdata in the mainline kernel so
remove support for it from the driver.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260724233432.31325-1-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 18:50:37 +01:00
Mark Brown
27e4b579cb
ASoC: dt-bindings: qcom,sm8250: Add Hawi sound card
Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com> says:

This series add support for sound card on Qualcomm Hawi boards.

Link: https://patch.msgid.link/20260713180907.874954-1-prasad.kumpatla@oss.qualcomm.com
2026-07-27 18:15:13 +01:00
Prasad Kumpatla
358782121d
ASoC: qcom: sc8280xp: Add support for Hawi
Add compatible for sound card on Qualcomm Hawi platform.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260713180907.874954-3-prasad.kumpatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 18:15:12 +01:00
Prasad Kumpatla
327679a605
ASoC: dt-bindings: qcom,sm8250: Add Hawi sound card
Add bindings for Hawi sound card, which is compatible with
the existing SM8450.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260713180907.874954-2-prasad.kumpatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 18:15:11 +01:00
Kuninori Morimoto
52ead5e1f1
ASoC: atmel: atmel_wm8904: use dev in atmel_asoc_wm8904_dt_init()
atmel_asoc_wm8904_dt_init() will be updated when Card capsuling.
To makes its review easy, use dev in this function and reduce
un-related diff.
No functional change, but is preparation for cleanup driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/878q75jfny.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 18:08:15 +01:00
Mark Brown
82736e0972
ASoC: Use named initializers for platform_device_id arrays
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> says:

the objective of this series is still to prepare making struct
platform_device_id::driver_data an anonymous union. See
https://lore.kernel.org/all/cover.1780048925.git.u.kleine-koenig@baylibre.com/
for the details about that.

Link: https://patch.msgid.link/cover.1784528081.git.u.kleine-koenig@baylibre.com
2026-07-27 15:10:35 +01:00
Uwe Kleine-König (The Capable Hub)
e4dc03df1f
ASOC: Unify code style for platform_device_id arrays
- Add a trailing comma for initializers unless the closing brace is on
   the same line and for the list terminator;
 - Use a single space in the list terminator;
 - Use compact one-line style for small entries;
 - s/\t=/ =/ were the tab is only one char wide anyhow;

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/093867d47c079d2aaab06bccaae734c54c342a7d.1784528081.git.u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 15:10:33 +01:00
Uwe Kleine-König (The Capable Hub)
232725a0e3
ASoC: Use named initializers for platform_device_id arrays
Named initializers are better readable and more robust to changes of the
struct definition. This robustness is relevant for a planned change to
struct platform_device_id replacing .driver_data by an anonymous union.

While touching these arrays unify spacing and usage of commas.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/a76e26aa4edb901b4bea684919463b2243dd8d9d.1784528081.git.u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 15:10:32 +01:00
Uwe Kleine-König (The Capable Hub)
4bed1074db
ASoC: amd: acp: Unify code style for platform_device_id array
- Add a trailing comma for initializers unless the closing brace is on
   the same line and for the list terminator;
 - Use a single space in the list terminator;

Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/08137cf5b3cdd0cc2e00da32256664f3cb9b1e4e.1784528081.git.u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 15:10:28 +01:00
Uwe Kleine-König (The Capable Hub)
2b26d06fd3
ASoC: amd: acp: Use named initializers for platform_device_id arrays
Named initializers are better readable and more robust to changes of the
struct definition. This robustness is relevant for a planned change to
struct platform_device_id replacing .driver_data by an anonymous union.

While touching these arrays unify spacing and usage of commas.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/a23fa9f649eaab706c704b671527c238f211ee26.1784528081.git.u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 15:10:22 +01:00
Uwe Kleine-König (The Capable Hub)
0ca8f65516
ASoC: renesas: fsi: Drop platform probing metadata
Since commit 38d3273075 ("ASoC: renesas: fsi: remove platform data
style support") probing using the traditional platform bus matching
isn't supported any more.

Drop the platform_device_id entries that should have been removed in the
above commit. Note that keeping the empty array results in the driver
not matching on "fsi-pcm-audio" (i.e. the driver name).

While touching that array, use a single space and no trailing comma for
the list terminator, which is the most used style for this.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/c79fa0d31abc0c80fbd7b4ec94d95b197ddb9f94.1784528081.git.u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 15:10:21 +01:00
Uwe Kleine-König (The Capable Hub)
c7a6909de8
ASoC: codecs: mt6357: Drop unused assignment of platform_device_id driver data
The driver explicitly sets the .driver_data member of struct
platform_device_id to zero without relying on that value. Drop this
unused assignment.

While touching this array unify spacing, use a named initializer for
.name and drop a trailing comma after the list terminator.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/724af6f60ed9420d5513724d126d70f22e319c91.1784528081.git.u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 15:10:19 +01:00
Mark Brown
28f67059bb
ASoC: meson: aiu-encoder-i2s: improve hw constraints checks
Valerio Setti <vsetti@baylibre.com> says:

This is a follow-up to the recently merged series reshaping the AIU
driver following the same design as AXG [1]. During the review,
Jerome pointed out that failing in hw_params() when two streams have
incompatible requirements is too late from userspace's point of view [2].

This series addresses that comment:

- Patch 1 fixes the existing bclk quirk check first: it only rejected
  one direction of the mismatch, and its interface-wide flag was
  cleared too late, making a legal reconfiguration of a single stream
  fail. This is a standalone fix and it's preparing for patch 2.

- Patch 2 is the actual answer to the review comment: the quirk
  incompatibility is expressed as hw rules on channels and sample
  bits, refined against the committed configuration of the opposite
  stream, so it becomes visible during parameter refinement. The
  hw_params() check is kept as the last backstop in case of concurrent
  refinement.

- Patch 3 applies the same philosophy to the interface-wide rate
  symmetry. Instead of manually reimplementing the check, take advantage of
  the core's 'symmetric_rate' handling.

Jerome's comment also mentioned the error returned when 'bs' is not a
multiple of 2. That one intentionally remains a hw_params() time
error: bs depends on the mclk rate, which the DAI only learns via
set_sysclk() from the machine driver's hw_params(), after parameter
refinement has already run. I don't think that can easily be expressed as
a constraint.

Final note. [1] has not been mainlined yet and it's only present in
'broonie/sound.git#for-7.3'. Therefore this series depends on commit
c7852d2dcf ("ASoC: meson: aiu: align I2S design to the AXG one").

[1] https://lore.kernel.org/linux-sound/20260610-reshape-aiu-as-axg-v2-0-cac3663a8b51@baylibre.com/
[2] https://lore.kernel.org/linux-sound/1jik7pebk7.fsf@starbuckisacylon.baylibre.com/

Link: https://patch.msgid.link/20260710-aiu-improve-quirk-check-v1-0-2fdd1b6f8896@baylibre.com
2026-07-27 14:39:26 +01:00
Valerio Setti
e82159384a
ASoC: meson: aiu-encoder-i2s: use the core symmetric_rate handling
The driver manually implement the interface-wide rate symmetry enforcement
in hw_params(), which suffers from the same problem addressed in the
previous patch: the restriction is not visible in the hw parameter
constraints, so a stream with a mismatching rate only finds out via
-EINVAL late in the stream setup.

The ASoC core already provides this feature through the DAI's
'symmetric_rate' flag: when another stream of the DAI is active,
soc_pcm_apply_symmetry() constrains the rate at open time so the
restriction shows up during parameter refinement, and
soc_pcm_params_symmetry() still rejects a mismatch at hw_params()
time as a backstop.

Set 'symmetric_rate' on the I2S encoder DAI and drop the open-coded
check along with the now unused 'rate' member of struct gx_iface.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Link: https://patch.msgid.link/20260710-aiu-improve-quirk-check-v1-3-2fdd1b6f8896@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 14:39:24 +01:00
Valerio Setti
df3c987ab3
ASoC: meson: aiu-encoder-i2s: reflect bs quirk in hw constraints
Currently the only check for bs-quirk is implemented in hw_params(), but
this is too late: nothing in the refined hw parameters hints at the
restriction, so userspace has no way to know the configuration is
invalid until the setup fails, as Jerome pointed out during review [1].

Add hw rules on CHANNELS and SAMPLE_BITS at startup() so that the
restriction shows up during parameter refinement instead. The rules
are refined against the committed configuration of the opposite
stream:

- if it uses the quirk, the current stream is narrowed to the same
  8ch/16-bit configuration;
- otherwise, selecting a 16-bit physical width limits the stream to
  2 channels, and selecting 8 channels requires a physical width
  larger than 16 bits.

The rules key on the physical width while the quirk is defined on the
significant bits. This is safe because S16_LE is the only format
supported by the encoder where both are 16 bits.

The check in aiu_encoder_i2s_set_clocks() is kept as the last backstop:
both streams may be refined concurrently before either commits its
configuration.

The rules are only registered on GX platforms where the bs-quirk exists
and only when the DAI has a stream in the opposite direction.

[1] https://lore.kernel.org/r/1jik7pebk7.fsf@starbuckisacylon.baylibre.com/

Suggested-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Link: https://lore.kernel.org/r/1jik7pebk7.fsf@starbuckisacylon.baylibre.com/
Link: https://patch.msgid.link/20260710-aiu-improve-quirk-check-v1-2-2fdd1b6f8896@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 14:39:23 +01:00
Valerio Setti
6b44ad3ec8
ASoC: meson: aiu-encoder-i2s: fix bs quirk incompatibility check
The bs-quirk incompatibility check has two flaws:

- It only rejects one direction of the mismatch. A stream that does
  not require the quirk is rejected while a quirked stream is active,
  but the opposite is not true: a stream requiring the quirk passes
  the check while a non-quirked stream is active, silently
  reprogramming the shared mclk/bclk divider with the 50% increase
  and corrupting the output of the running stream.

- 'bs_quirk' is only cleared in hw_free() when the last substream
  closes, but userspace may legally stop/reconfigure/start the stream
  without an intervening hw_free. Reconfiguring a single stream
  from the quirked configuration (8ch/16-bit) to one that does not
  need the quirk therefore fails with -EINVAL due to the stale flag.

Drop the interface-wide flag and instead compare the quirk
requirement of the incoming parameters against the committed
configuration of the opposite stream at hw_params() time. The
committed channels/width are cleared in hw_free() so that a released
stream no longer constrains the other one.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Link: https://patch.msgid.link/20260710-aiu-improve-quirk-check-v1-1-2fdd1b6f8896@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 14:39:22 +01:00
Mark Brown
fad15cabb7
ASoC: remove conditional returns with no effect
Sang-Heon Jeon <ekffu200098@gmail.com> says:

This series removes conditional returns where both branches return
the same value, so the check has no effect. As suggested by Vijendar,
the ASoC patch of the treewide v1 series [1] is split per vendor and
posted separately.

All patches are generated by the Coccinelle script, which you can
find in v1.

If you would rather drop any of the patches, just let me know and I will address
it in the next version.

Link: https://patch.msgid.link/20260725160344.916838-1-ekffu200098@gmail.com
2026-07-27 14:08:01 +01:00
Sang-Heon Jeon
619446b87c
ASoC: SOF: Intel: remove conditional return with no effect
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Link: https://patch.msgid.link/20260725160344.916838-5-ekffu200098@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 14:08:00 +01:00
Sang-Heon Jeon
cdb8b41357
ASoC: samsung: smdk_spdif: remove conditional return with no effect
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Link: https://patch.msgid.link/20260725160344.916838-4-ekffu200098@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 14:07:59 +01:00
Sang-Heon Jeon
52c0957729
ASoC: Intel: atom: remove conditional return with no effect
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260725160344.916838-3-ekffu200098@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 14:07:58 +01:00
Sang-Heon Jeon
3799a56da8
ASoC: amd: acp: remove conditional return with no effect
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20260725160344.916838-2-ekffu200098@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 14:07:57 +01:00
Sang-Heon Jeon
ca9b51f41c
ASoC: remove conditional return with no effect
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Link: https://patch.msgid.link/20260723184538.3888637-15-ekffu200098@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-27 13:23:49 +01:00