Commit Graph

1461805 Commits

Author SHA1 Message Date
Vijendar Mukunda
c04de2d88c
ASoC: SOF: amd: validate SizeFWSigned before signed FW length on ACP7x
The ACP7.B/7.F ACPI signed path already reads SizeFWSigned from the image
header into size_fw. Before adding ACP_IMAGE_HEADER_SIZE for SHA DMA,
reject payload size zero or any size_fw with size_fw > fw_bin_size -
ACP_IMAGE_HEADER_SIZE, so size_fw + ACP_IMAGE_HEADER_SIZE cannot exceed the
supplied firmware buffer.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:31:03 +01:00
Vijendar Mukunda
d6869ae07d
ASoC: SOF: amd: require full ACP header for ACP7 signed firmware
ACP7.B/7.F signed images read SizeFWSigned from a fixed offset inside
the ACP header. Reject firmware buffers shorter than the header so we
never read past the end of the supplied image.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:55 +01:00
Vijendar Mukunda
cbdafd2acd
ASoC: SOF: amd: extend signed firmware pre-run for ACP7x
Parse SizeFWSigned from the ACP image header when loading signed
firmware on ACP7.B/7.F platforms. Keep the legacy
ACP_FIRMWARE_SIGNATURE subtraction for pre-7B platforms using quirks.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:52 +01:00
Vijendar Mukunda
a3674345f9
ASoC: SOF: amd: add ACP7x IRQ handler for DSP IPC
Add acp7x_irq_handler() and register it from amd_sof_acp7x_probe() for
DSP doorbell IPC interrupts on ACP7.B/7.F.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:51 +01:00
Vijendar Mukunda
78d99c2c5e
ASoC: SOF: amd: add ACP7x probe and remove
Add amd_sof_acp7x_probe() and amd_sof_acp7x_remove() for ACP7.B/7.F.
Wire probe and remove into sof_acp7x_ops_init().

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:50 +01:00
Vijendar Mukunda
571464f543
ASoC: SOF: amd: refactor SW1 I2S error reason clear in acp_irq_handler
Replace the open-coded pci_rev comparison with a switch statement for
clearing ACP_SW1_I2S_ERROR_REASON. This makes the per-platform control
explicit and easier to extend.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:49 +01:00
Vijendar Mukunda
237efba38c
ASoC: SOF: amd: mask ACP7x PGFSM status poll
For ACP7.B/7.F, poll only the PGFSM tile status bits (P0-P4) and
consider the tiles powered on when the masked status becomes 0.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:48 +01:00
Vijendar Mukunda
0ec5afad9d
ASoC: SOF: amd: add base platform support for ACP7.B/7.F
Add SOF support for ACP7.B and ACP7.F PCI revision based platforms.
This covers Kconfig/Makefile entries, register offset definitions,
DMA descriptor/channel/status paths, PGFSM power-on handling,
PCI device driver, I2S/DMIC DAI definitions, and IPC SW interrupt
trigger offset selection for ACP7.B/7.F.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:47 +01:00
Vijendar Mukunda
ec2332472f
ASoC: amd: acp: add ACPI machine table for ACP7.B/7.F SOF driver
Add snd_soc_acpi_amd_acp7x_sof_machines[] ACPI machine table for ACP7.B
and ACP7.F PCI revision based platforms. Add the extern declaration to
mach-config.h so that it can be referenced from the SOF PCI driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260701095759.1012929-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-03 17:30:46 +01:00
Mark Brown
8d01573c48
ASoC: Add Loongson-2K0300 I2S controller and sound card support
Binbin Zhou <zhoubinbin@loongson.cn> says:

This series adds ASoC support for the Loongson-2K0300 SoC and its
associated development boards, including the CTCISZ Forever Pi and the
ATK-DL2K0300B.

Key changes:
- Extend DT bindings to support ls2k0300-i2s and new audio card
  compatibles.
- Refactor the platform I2S driver to handle SoC differences via per-device
  configuration (rev_id, optional APB DMA config, reset sequence).
- Refactor the audio machine driver to support board-specific DAI formats,
  GPIO-based headphone detection/control, speaker enable, and DAPM routing.
- Add jack detection and automatic switching between headphones and
  speakers for the DL2K0300B board.

The patchset also cleans up the existing audio card binding by
referencing the common sound-card properties, and adds new compatibles
for the Loongson-2K0300 variants with proper DAI format handling.

All changes have been tested on Loongson-2K2000 (PCI), Loongson-2K0300
Forever Pi and Loongson-2K0300 DL2K0300B boards.

Link: https://patch.msgid.link/cover.1782439646.git.zhoubinbin@loongson.cn
2026-07-02 20:04:18 +01:00
Binbin Zhou
5f988d6223
ASoC: es8328: Add DAPM routes from MIC inputs to Mic Bias
The ES8328 codec has differential/single-ended microphone inputs
(LINPUT1/RINPUT1, LINPUT2/RINPUT2) that require connection to the
internal Mic Bias generator for proper operation. Currently, these
routes are missing, which can cause microphone recording to fail.

Add the missing DAPM routes to link the input pins to the Mic Bias
supply, ensuring the microphone bias voltage is correctly applied.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/dcf1f8ae4f1f192a1d63e9fe7044b0218119b5eb.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:17 +01:00
Binbin Zhou
dde4064a49
ASoC: loongson: Add headphone jack detection and DAPM routing
Extend the Loongson audio machine driver with jack detection, DAPM
widgets support, enabling proper switching between headphones and
speakers on the Loongson-2K0300 ATK-DL2K0300B board.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/c4b1503220b6fb433ecdcb881556827579041c3d.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:16 +01:00
Binbin Zhou
3ddae79479
ASoC: dt-bindings: loongson,ls-audio-card: Add ATK-DL2K0300B compatible
Add new compatible for the ATK-DL2K0300B development board based on
Loongson-2K0300.

Unlike others, this board features GPIO-controlled headphone detection,
headphone control, and speaker enable.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/71430fcee5951fb7a7d52e2091a87707db85e06c.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:15 +01:00
Binbin Zhou
da659805e0
ASoC: loongson: Add Loongson-2K0300 CTCISZ Forever Pi sound card support
The Loongson-2K0300 audio card uses a different DAI format compared to
existing Loongson platforms.

Move the dai_fmt setting from the static DAI link to runtime hw_params
via snd_soc_runtime_set_dai_fmt(), and pass the correct format through
driver match data.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/ed1314e1d3275fd20aff47397345a88fad6e9368.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:14 +01:00
Binbin Zhou
5460b4ddc7
ASoC: dt-bindings: loongson,ls-audio-card: Add ctcisz forever pi compatible
Add a new compatible string `loongson,ls2k0300-forever-pi-audio-card`
for the audio card on Loongson-2K0300 ctcisz forever pi SoC. It uses a
different DAI format compared to existing Loongson platforms.

The existing "loongson,ls-audio-card" remains valid for LS7A,
Loongson-2K1000 and Loongson-2K2000.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/183d809cd51874bcb78743273e4b7617f120fedb.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:13 +01:00
Binbin Zhou
95133a9ac8
ASoC: dt-bindings: loongson,ls-audio-card: Use common sound card
Reference the common sound card properties. This allows removing the
`model` property and directly using the common `audio-routing` property
later on.

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/fa72a429a9d076d381f7d514184f19d5a35ffa51.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:12 +01:00
Binbin Zhou
41ab1f8a0e
ASoC: loongson: Add Loongson-2K0300 I2S controller support
The Loongson-2K0300 I2S interface differs significantly from the
Loongson-2K1000. Although both utilize external DMA controllers, the
Loongson-2K0300 does not require additional registers for routing
configuration.

Due to hardware design flaw, an extra controller reset sequence is
required during probe.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/4d3caa62d4275e1495505387198408f4d30d453c.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:11 +01:00
Binbin Zhou
914e95aaec
ASoC: dt-bindings: loongson,ls2k1000-i2s: Document Loongson-2K0300 compatible
Add a new compatible string `loongson,ls2k0300-i2s` for the I2S
controller found on Loongson-2K0300 SoC.

Unlike Loongson-2K1000, Loongson-2K0300 does not require the second
register region for APB DMA configuration, so update the binding to
allow a single reg entry.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/af092f9eabdc170c3d7951b29eee6512f748eb48.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:10 +01:00
Binbin Zhou
0eb0e3c623
ASoC: loongson: Fix error handling in ACPI property parsing
In loongson_card_parse_acpi(), the return value of
device_property_read_string() for the `codec-dai-name` property was
ignored. If the property is missing or invalid, an uninitialized pointer
would be used later, potentially leading to undefined behavior.

Fix this by checking the return value and propagating the error
appropriately.

Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/cover.1780538113.git.zhoubinbin@loongson.cn?part=5
Fixes: ddb538a300 ("ASoC: loongson: Factor out loongson_card_acpi_find_device() function")
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/08e44a54708eae053be148524346bb8dfcd55b03.1782439646.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:04:09 +01:00
bui duc phuc
bb7c62fdbf
ASoC: samsung: spdif: Preserve the original clock acquisition error
devm_clk_get() may return different error codes, including -EPROBE_DEFER.
The current code overwrites the original error with -ENOENT, preventing
deferred probing from working correctly.
Replace dev_err() with dev_err_probe() so the original error code is
preserved and propagated to the caller.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260701080517.298294-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-02 20:00:36 +01:00
WenTao Liang
fb5d1b1c5f
ASoC: samsung: aries_audio_probe: double of_node_put due to direct assignment without of_node_get
In aries_audio_probe(), aries_dai[0].platforms->of_node is assigned the
same pointer as aries_dai[0].cpus->of_node (from of_parse_phandle)
without calling of_node_get(). When the sound card is deregistered, the
ASoC framework calls of_node_put() on both cpus->of_node and
platforms->of_node, causing a double put on the same node and a refcount
underflow.

Add of_node_get(aries_dai[0].cpus->of_node) before the assignment.

Cc: stable@vger.kernel.org
Fixes: 7a3a7671fa ("ASoC: samsung: Add driver for Aries boards")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260627035251.60172-1-vulab@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 17:41:27 +01:00
Mark Brown
e487b00d70
ASoC: Fix mixed goto and guard() usage
bui duc phuc <phucduc.bui@gmail.com> says:

These two patches fix the remaining cases of mixed goto-based error
handling and cleanup helpers introduced by the recent guard() conversion
patches that have already been merged for the 7.2 development cycle.

The cleanup.h guidelines explicitly recommend not mixing goto with
cleanup helpers in the same function. Only two functions were left in
this state:

 - sound/soc/samsung/i2s.c: remove the goto-based error path and rely
   on guard(pm_runtime) for automatic cleanup.
 - sound/soc/ti/j721e-evm.c: restore mutex_lock()/mutex_unlock() to
   preserve the existing goto-based error handling.

Although these cases do not trigger any build warnings or errors with
Clang (W=1), they still violate the cleanup.h guidelines. These
patches address those remaining cases and add the appropriate Fixes:
tags for the commits that introduced them.

Link: https://patch.msgid.link/20260701041310.230725-1-phucduc.bui@gmail.com
2026-07-01 16:34:51 +01:00
bui duc phuc
47a0dde9a3
ASoC: ti: j721e-evm: Avoid mixing goto with guard()
The previous guard(mutex) conversion mixed cleanup helpers with
goto-based error handling, which is discouraged by the cleanup.h
guidelines.
Restore mutex_lock()/mutex_unlock() instead.

Fixes: 6f4cf77320 ("ASoC: ti: j721e-evm: Use guard() for mutex locks")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260701041310.230725-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:34:49 +01:00
bui duc phuc
02fd694e60
ASoC: samsung: i2s: Avoid mixing goto with guard()
cleanup.h recommends not mixing goto-based error handling with cleanup
helpers in the same function.
Remove the goto path and rely on guard(pm_runtime) for automatic cleanup
instead.

Fixes: 3d08517b5c ("ASoC: samsung: i2s: Use guard() for spin locks")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260701041310.230725-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:34:48 +01:00
Kuninori Morimoto
e3653722b9
ASoC: sof: topology: use for_each_card_rtds()
We already have for_each_card_rtds(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87h5mpet2c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:11:58 +01:00
Mark Brown
6eee87fc72
ASoC: codecs: ES8389: Modify the ES8389 driver
Zhang Yi <zhangyi@everest-semi.com> says:

Modify the initialization configuration and routes for ES8389,
and add private members.

Link: https://patch.msgid.link/20260630072311.8427-1-zhangyi@everest-semi.com
2026-07-01 16:10:03 +01:00
Zhang Yi
2264927316
ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX
Add INPUTL MUX and INPUTR MUX in route

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-7-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:10:01 +01:00
Zhang Yi
87592da1a4
ASoC: codecs: ES8389: Add private members about HPF
Add private members related to HPF.
Add Kcontrol for HPF

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-6-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:10:00 +01:00
Zhang Yi
3bea836903
ASoC: codecs: ES8389: Modify the initial configuration
Modify the initial configuration

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-5-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:10:00 +01:00
Zhang Yi
9367a244af
ASoC: codecs: ES8389: Modify the clock table
Updated the configuration for certain frequencies

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-4-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:09:59 +01:00
Zhang Yi
cbc559dd8d
ASoC: codecs: ES8389: Fix the issue about mclk_src
Fix the issue with incorrect modifications to mclk_src
When the system needs to be configured to use the MCLK from the SCLK pin,
the code still sets the relevant registers to use the MCLK from the MCLK pin

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:09:58 +01:00
Zhang Yi
882e550311
ASoC: codecs: ES8389: Modify volatile_register
Mark some registers that are not volatile as false
And modified the logic for `cache_bypass` during `8389_resume`.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 16:09:57 +01:00
Kuninori Morimoto
7ffb66fd96
ASoC: mediatek: mt8173-rt5650: tidyup error message
mt8173_rt5650_dev_probe() has strange error message

=>	ret = device_property_read_u32(...);
	      ^^^^^^^^^^^^^^^^^^^^^^^^
	if (ret)
=>		dev_err(... "%s snd_soc_register_card fail %d\n", ...);
				^^^^^^^^^^^^^^^^^^^^^

It should be "device_property_read_u32() fail". Fix it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/875x2zcjxn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-01 14:56:18 +01:00
David Heidelberg
bff7fad101
ASoC: dt-bindings: Convert cirrus,cs35l36 to DT schema
Convert CS35L36 Speaker Amplifier to yaml.

Changes:
 - maintainers email to the generic Cirrus email
 - Both the codec and downstream worked just fine without
   VP-supply provided. Align with datasheet for similar models.
 - add dai-common.yaml to cover for '#sound-dai-cells',
   'sound-name-prefix'
 - updated not yet implemented:
     cirrus,weak-fet-delay -> cirrus,classh-wk-fet-delay-ms
       (in both definition and example)
     cirrus,weak-fet-thld -> cirrus,weak-fet-thld-millivolt
       (only in the example)
 - added two required properties:
     cirrus,boost-ctl-millivolt
     cirrus,boost-peak-milliamp

Assisted-by: OpenAI:gpt-4
Reviewed-by: David Rhodes <David.Rhodes@cirrus.com>
Co-developed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260624-dt-cirrus-cs35l36-v3-1-ec451d5a2908@ixit.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-30 19:45:07 +01:00
Rosen Penev
ae2e2f1ff1
ASoC: mediatek: mt2701: add COMPILE_TEST
Enable COMPILE_TEST for mt2701 to get extra build coverage as done with
other mediatek platforms.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20260630013024.1500623-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-30 19:36:47 +01:00
Narasimharao Vadlamudi
3848617c64
ASoC: renesas: fsi: Propagate platform_get_irq() errors
platform_get_irq() returns a positive IRQ number on success and a
negative error code on failure. It no longer returns zero. The driver
currently stores the return value in an unsigned int and returns -ENODEV
for all failures, which loses useful errors such as -EPROBE_DEFER.

Store the IRQ in an int and return the error from platform_get_irq()
directly.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Narasimharao Vadlamudi <ahmisaranrao@gmail.com>
Link: https://patch.msgid.link/20260630171333.36396-1-ahmisaranrao@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-30 19:36:04 +01:00
Julian Braha
2f82d58a87
ASoC: codecs: cleanup kconfig indentations
Cleanup various bad indentations in the kconfig:
1. spaces instead of tabs (this file mostly uses tabs)
2. too much indentation
3. not enough indentation

Signed-off-by: Julian Braha <julianbraha@gmail.com>
Link: https://patch.msgid.link/20260630085249.380365-1-julianbraha@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-30 19:17:53 +01:00
Mark Brown
ec34e1acaf
ASoC: sdw_utils: tidyup functions
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> says:

I will post DAI/Component/Card capsuling patch, but
current code makes old style / new style conversion difficult.
To make future conversions easier to understand, this patch clean up the
code a little. but no functional change.

Link: https://patch.msgid.link/87ldc1etyp.wl-kuninori.morimoto.gx@renesas.com
2026-06-30 14:23:04 +01:00
Kuninori Morimoto
a1332be2a0
ASoC: sdw_utils: tidyup asoc_sdw_parse_sdw_endpoints()
We can avoid to use *card. Tidyup it.

Current code makes old style / new style conversion difficult.
To make future conversions easier to understand, this patch clean up the
code a little. but no functional change.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/87ik75etxw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-30 14:23:03 +01:00
Kuninori Morimoto
c97f0bf5f7
ASoC: sdw_utils: tidyup .count_sidecar
count_sidecar() is not using *card. Tidyup it.

Current code makes old style / new style conversion difficult.
To make future conversions easier to understand, this patch clean up the
code a little. but no functional change.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/87jyrlety1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-30 14:23:02 +01:00
Kuninori Morimoto
b2133ca33e
ASoC: au1x: psc-ac97: remove unused chans
chans is not used in au1xpsc_ac97_hw_params(). Remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87y0g2ds7c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-30 12:25:05 +01:00
Mark Brown
c7852d2dcf
ASoC: meson: aiu: align I2S design to the AXG one
Valerio Setti <vsetti@baylibre.com> says:

The goal of this series is to reshape Amlogic GX's AIU implementation for
I2S to let it follow the same design as in AXG's TDM. Keeping the same
design allows for unifying the two platform implementations in the future
and it also allows for an easy addition of I2S input.

The first commit introduces gx-formatter as the basic block which takes
care of properly formatting audio data. Formatters are DAPM widgets
(c.f. axg-tdm-formatter in AXG) which are dynamically attached/detached
to the streams when the latters starts/stop, respectively.
aiu-formatter-i2s is introduced as formatter implementation for the i2s
output.

By the end aiu-encoder-i2s will only need to handle interface clocks and
enforce interface wide rate symmetry (c.f axg-tdm-interface on the AXG
platform). Right now rate symmetry is not relevant because only i2s output
is supported, but it will become useful when following patch series will
introduce the i2s input part.

This series was tested on an OdroidC2 board (Amlogic S905 SOC) both with
HDMI output and with NXP SGTL5000 codec connected to the I2S pins.
This series was also verified using "pcm-test" test tool and all tests
are passing.

[1]: https://sashiko.dev/#/patchset/20260515-reshape-aiu-as-axg-v1-0-53b457784ff3%40baylibre.com

Link: https://patch.msgid.link/20260610-reshape-aiu-as-axg-v2-0-cac3663a8b51@baylibre.com
2026-06-29 19:43:31 +01:00
Valerio Setti
83b83024cd
ASoC: meson: aiu: use aiu-formatter-i2s to format I2S output data
Create a new DAPM widget for "I2S formatter" and place it on the path
between FIFO and output DAI interface. Remove I2S output formatting code
from aiu-encoder-i2s since it's now implemented from aiu-formatter-i2s.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20260610-reshape-aiu-as-axg-v2-4-cac3663a8b51@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-29 19:43:29 +01:00
Valerio Setti
2cbb32d8dc
ASoC: meson: aiu: introduce I2S output formatter
Introduce aiu-formatter-i2s, a gx_formatter implementation for the AIU I2S
playback path. This is going to replace data formatting tasks that are
currently being implemented in aiu-encoder-i2s.

This should ideally follow the same design pattern used on the AXG
platform (see axg-tdmout), where basically the widget/formatter corresponds
to a single audio component. This is not possible in the GX platform though
because all the features are currently implemented in the AIU audio
component and changing that would require backward incompatible
device-tree changes.

Therefore aiu-formatter-i2s is kept very simple and
it only implements the bare minimum functionalities to provide I2S
playback formatting. It's not a standalone component though because this
is still belongs to AIU.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20260610-reshape-aiu-as-axg-v2-3-cac3663a8b51@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-29 19:43:28 +01:00
Valerio Setti
9335117a22
ASoC: meson: aiu-encoder-i2s: prepare for multiple streams
aiu-encoder-i2s is going to be the interface that handles both playback
and capture, so this commit does all the required changes to prepare
for that since so far it only handled playback:
- probe/remove functions are added to allocate/free per stream data,
  respectively.
- 'struc gx_iface' and 'struct gx_stream' are used to store interface or
  stream associated data, respecively.
- interface wide rate symmetry is enforced.
- quirks on bclk are also enforced if/when necessary.

Clock-wise instead of bulk enabling all the clocks on startup and disabling
them on shutdown, only the peripheral's internal ones are enabled/disabled
in those functions, whereas MCLK and I2S clock divider are handled in
prepare/hw_free.

Finally a trigger() callback is also added to start/stop the associated
I2S data formatter.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20260610-reshape-aiu-as-axg-v2-2-cac3663a8b51@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-29 19:43:27 +01:00
Valerio Setti
a295be8d62
ASoC: meson: gx: add gx-formatter and gx-interface
These files are the basic block which allow to shape I2S in GX devices
the same as the AXG ones: the DAI backend only controls the interface
(i.e. clocks and pins) whereas a formatter takes care of properly
formatting the data.

gx-formatter and gx-interface are strongly inspired to axg-tdm-formatter
and axg-tdm, respectively. The long term plan is to join the two platforms
to use the same formatter solution.

There is only a minor addition here compared to what has been done for
AXG and it's "gx_formatter_create()" which is required in order to let
already existing AIU code to make use of this formatter without making any
devicetree change.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20260610-reshape-aiu-as-axg-v2-1-cac3663a8b51@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-29 19:43:26 +01:00
Mark Brown
28f4d2a9d1
ASoC: rt5677: add GPIO get_direction and enable standalone compilation
Diogo Ivo <diogo.ivo@bootlin.com> says:

This small series fixes two issues in the RT5677 ASoC codec driver:

- Patch 1 adds the missing GPIO .get_direction() callback, allowing
  the direction of GPIO pins to be queried.

- Patch 2 makes the Kconfig option user-visible so the driver can be
  built standalone for example when using generic audio-graph-card
  bindings, which do not pull in specific codec drivers via select/imply.

Link: https://patch.msgid.link/20260620-smaug-audio-v1-0-e318acdf5abd@bootlin.com
2026-06-29 19:41:10 +01:00
Diogo Ivo
a5edc45d9c
ASoC: rt5677: Enable standalone compilation for generic card use
Add a prompt string to make the RT5677 driver user-selectable, allowing
it to be built independently for use with generic sound card bindings.

Signed-off-by: Diogo Ivo <diogo.ivo@bootlin.com>
Link: https://patch.msgid.link/20260620-smaug-audio-v1-2-e318acdf5abd@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-29 19:41:08 +01:00
Diogo Ivo
99e361b2a5
ASoC: rt5677: Add GPIO .get_direction() callback
Implement the get_direction callback for the GPIO controller to allow
consumers to query the direction of GPIO pins.

Signed-off-by: Diogo Ivo <diogo.ivo@bootlin.com>
Link: https://patch.msgid.link/20260620-smaug-audio-v1-1-e318acdf5abd@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-29 19:41:07 +01:00
Shuming Fan
d79828f380
ASoC: rt1321: add support for rt1321 VA1/VA2
This patch adds support for the RT1321 VA1 and VA2 amplifier.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20260622091149.2183334-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-29 19:36:05 +01:00