Commit Graph

281 Commits

Author SHA1 Message Date
bui duc phuc
9e0698b776
ASoC: ti: omap-twl4030: Check for missing card name after parsing
Return any error from snd_soc_of_parse_card_name() directly. If the
helper returns successfully but card->name remains unset, report the
missing card name explicitly before returning -ENODEV.

Suggested-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260805044556.38183-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-08-11 14:58: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
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
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
8e5a6599a3
ASoC: cs35l3x: drain threaded IRQs before runtime suspend
Runyu Xiao <runyu.xiao@seu.edu.cn> says:

Both cs35l33 and cs35l34 can enter runtime suspend while their threaded
IRQ handlers are still reachable. The suspend path then switches the
driver into regcache cache-only mode and powers the codec down, while
the IRQ thread still expects live status-register access.

This issue was found by our static analysis tool and manually audited on
Linux v6.18.21. Directed QEMU no-device validation further showed that,
after runtime_suspend() completed, the real threaded handlers could
still be injected and would continue past volatile regmap read failures
into their release/update paths.

This series keeps the fix on the suspend actor and applies the same
runtime-suspend/threaded-IRQ ordering repair boundary to both drivers:

- track whether request_threaded_irq() actually succeeded
- disable_irq() before cache_only/power-off in runtime suspend
- enable_irq() only after regcache_sync() in runtime resume

That drains any in-flight threaded handler and blocks new IRQ handling
while the codec is suspended, without mixing in larger IRQ-thread
defensive cleanups.

Build-tested by compiling cs35l33.o and cs35l34.o.

No cs35l33/cs35l34 hardware was available for end-to-end runtime
testing.

Link: https://patch.msgid.link/20260611161553.3378721-1-runyu.xiao@seu.edu.cn
2026-07-06 14:39:25 +01:00
Uwe Kleine-König (The Capable Hub)
995832b2ce Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files)
Replace the #include of <linux/mod_devicetable.h> by the more specific
<linux/device-id/*.h> where applicable. For most cases the include
can be dropped completely, only a few drivers need one or two headers
added.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
2026-07-03 07:38:17 +02: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
Sen Wang
216f7452a6
ASoC: ti: davinci-mcasp: Add audio-graph-card2 and DPCM support
Extend the McASP driver to support audio-graph-card2 of-graph topology,
while maintaining backwards compatibility for existing simple-audio-card
phandles and machine drivers, which now uses the default MCASP_GRAPH_NONE
code path.

Signed-off-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260603211835.635184-1-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-11 20:48:11 +01:00
Mark Brown
1e50c7006d
ASoC: move card->pop_time to soc-dapm
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> says:

This is v3 to move card->pop_time to soc-dapm.
card->pop_time is used only on TI, and Janusz posted patch which will stop
using it. It was posted at 12 Apr 2026, and [1/2] is it as-is.

[2/2] will move card->pop_time to soc-dapm. We can use it via debugfs.
I have added [RFC] on Subject.

Link: https://patch.msgid.link/87wlx9wj1h.wl-kuninori.morimoto.gx@renesas.com
2026-05-20 13:36:51 +01:00
Janusz Krzysztofik
446c921ece
ASoC: ti: ams-delta: Stop (ab)using card->pop_time
A flag is needed that tells the card driver if the codec has been
initialized successfully over the modem's line discipline.  Initially,
codec->hw_write was used as the flag, but it was then dropped and the
flag function associated with card->pop_time, already managed by the
codec driver for diagnostic purposes.  Since now the card->pop_time is
going to be killed, stop abusing foreign fields in favor of an own one.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v7ctwj0w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-20 13:36:49 +01:00
Mark Brown
bf628fa4d4
ASoC: Merge up fixes
Merge up the fixes to help CI.
2026-05-15 22:39:50 +09:00
Ingyu Jang
c996a4418d
ASoC: ti: omap-dmic: Fix IS_ERR() vs NULL check bug in omap_dmic_select_fclk()
clk_get_parent() returns NULL when the clock has no parent (or when the
input clk is NULL); it never returns an ERR_PTR. The current IS_ERR(mux)
check therefore never triggers - a NULL return falls through silently
to clk_set_parent(NULL, parent_clk), which simply fails with -EINVAL.

Use a NULL check so the dedicated error path runs and the prior
clk_get() reference is released via clk_put().

Signed-off-by: Ingyu Jang <ingyujang25@korea.ac.kr>
Acked-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260514185215.3753998-1-ingyujang25@korea.ac.kr
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-15 10:53:56 +09:00
bui duc phuc
7c0acb8f76
ASoC: ti: omap-mcbsp: Remove mixed goto/scoped cleanup handling
After converting to guard()/scoped_guard() helpers,
omap_mcbsp_request() still mixes scoped cleanup with
goto based error handling.

Remove the remaining goto based cleanup paths for a more
consistent cleanup flow.

Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260514110602.30480-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-15 10:36:48 +09:00
Mark Brown
f86caf5ff6
ASoC: ti: Cleanup locking code using guard() helpers
phucduc.bui@gmail.com <phucduc.bui@gmail.com> says:

This series converts mutex and spinlock handling in TI ASoC drivers
to use guard() helpers.

Most patches are straightforward conversions to guard() helpers.
Two patches include minor cleanup changes in the process:

omap-dmic: Simplified omap_dmic_dai_startup() by removing the
temporary return variable and using a direct return path on error.

omap-mcbsp: Modernized omap_mcbsp_request() by using __free(kfree)
for memory management. This ensures that memory is always freed on
error paths after the spinlock is released, without needing manual
goto labels.

No behavior change intended.

Link: https://patch.msgid.link/20260508103837.138142-1-phucduc.bui@gmail.com
2026-05-11 09:58:51 +09:00
bui duc phuc
822f67bc26
ASoC: ti: omap-mcbsp: Simplify lock and resource handling
Convert spinlock protected sections to guard()/scoped_guard()
helpers and simplify the cleanup paths, including the
reg_cache lifetime handling in omap_mcbsp_request().

No functional change intended.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260508103837.138142-8-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11 09:58:49 +09:00
bui duc phuc
d94e794e82
ASoC: ti: omap-mcbsp-st: Use guard() for spin locks
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260508103837.138142-7-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11 09:58:49 +09:00
bui duc phuc
a8217778be
ASoC: ti: ams-delta: Use guard() for spin locks
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260508103837.138142-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11 09:58:48 +09:00
bui duc phuc
70031e9ad6
ASoC: ti: omap-mcpdm: Use guard() for mutex locks
Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260508103837.138142-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11 09:58:47 +09:00
bui duc phuc
59115f79ac
ASoC: ti: omap-hdmi: Use guard() for mutex locks
Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260508103837.138142-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11 09:58:46 +09:00
bui duc phuc
bc59728f93
ASoC: ti: omap-dmic: Use guard() for mutex locks
Replace open-coded mutex_lock()/mutex_unlock() pairs with guard(mutex)()
and scoped_guard() helpers.

This also simplifies the control flow by removing temporary return
variables and unnecessary goto-based cleanup paths.

No functional change intended.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260508103837.138142-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11 09:58:45 +09:00
bui duc phuc
6f4cf77320
ASoC: ti: j721e-evm: Use guard() for mutex locks
Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260508103837.138142-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11 09:58:44 +09:00
Ethan Nelson-Moore
ee05c329c0
ASoC: ti: rx51: remove stale reference to machine_is_nokia_rx51()
The rx51 driver relies on the machine_is_nokia_rx51() macro, which was
used with the legacy board file dropped in commit 9b7141d01a ("ARM:
OMAP2+: Drop legacy board file for n900"). The use of this macro
prevents the removal of machine IDs no longer used by the kernel from
arch/arm/tools/mach-types, because the machine_is_*() macros are
generated from mach-types. Drop this unused code.

Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com> # v1
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://patch.msgid.link/20260510054214.564950-1-enelsonmoore@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-10 22:46:22 +09:00
Ethan Nelson-Moore
45efb8fbda
ASoC: ti: omap3pandora: update board check to use DT compatible
The omap3pandora driver contains a check for the ARM machine ID via the
machine_is_omap3_pandora() macro. The board concerned now supports
only FDT booting, which does not use machine IDs, and therefore the
code should be updated to check the DT compatible property instead. The
legacy board file for this machine was removed in commit 7fcf7e061e
("ARM: OMAP2+: Remove legacy booting support for Pandora").
The presence of this machine ID check prevents the removal of machine
IDs no longer used by the kernel from arch/arm/tools/mach-types,
because the machine_is_*() macros are generated from mach-types. To
resolve this issue, use of_machine_is_compatible() instead.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-10 22:45:39 +09:00
Rosen Penev
85db411913
ASoC: ti: j721e-evm: allocate dai_links with priv
Use a flexible array member to combine allocations. Simplifies the code
slightly.

Remove open coding of of_device_get_match_data.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[Fixed up bitrotted commit message -- broonie]
Link: https://patch.msgid.link/20260428204728.24103-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-04-29 11:14:17 +09:00
Mark Brown
49c002275a
ASoC: ti: davinci-mcasp: McASP code cleanup and clk
Merge series from Sen Wang <sen@ti.com>:

Just two minor patches that aim to tidy up the code a little bit,
as well as fix the aux_div selection in davinci_mcasp_calc_clk_div()
for mid-range dividers (33 <= div <= 4096).

Sen Wang (2):
  ASoC: ti: davinci-mcasp: extract mcasp_is_auxclk_enabled() helper
  ASoC: ti: davinci-mcasp: improve aux_div selection for mid-range dividers

 sound/soc/ti/davinci-mcasp.c | 45 +++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 14 deletions(-)

--
2.43.0
2026-03-10 12:09:17 +00:00
Sen Wang
a8075ada4a
ASoC: ti: davinci-mcasp: improve aux_div selection for mid-range dividers
When the ideal total divider (sysclk/bclk) is between 33 and 4096 and
AUXCLK is enabled, the driver computes aux_div as ceil(div/32) and then
recomputes bclk_div from the truncated sysclk.

This two-step integer division loses precision due to truncation and can
sometimes produce PPM errors large enough for ALSA's hw_rule_format to
reject otherwise valid sample formats.

For example, on AM62D-EVM (auxclk-fs-ratio=2177, tdm-slots=2, fck=96 MHz),
playing S16_LE at 44100 Hz gives BCLK = 1,411,200 Hz and an ideal total
divider of 68.  The old code picks aux_div = ceil(68/32) = 3,
then bclk_div = (96005700/3) / 1411200 = 22, for a total of 3 x 22 =
66 -- two steps from ideal.  The resulting error exceeds the PPM threshold
and causes S16_LE, S24_LE to be rejected.

Therefore when the total divider fits in the AHCLKXDIV register alone
(<=4096), use it directly as aux_div with bclk_div=1, and compare floor
and ceil to pick the closer match, to ensure the best ideal total dividers.

Dividers at or below 32 never enter this path, and dividers above 4096
still fall through to the existing DIV_ROUND_UP path, so previously
working configurations remains unaffected.

Signed-off-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260305195825.9998-3-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09 00:17:29 +00:00
Sen Wang
5bebbfd64b
ASoC: ti: davinci-mcasp: extract mcasp_is_auxclk_enabled() helper
Move the AUXCLK-enabled check out of davinci_mcasp_calc_clk_div() into
a reusable helper.  No functional change.

Signed-off-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260305195825.9998-2-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09 00:17:28 +00:00
Sen Wang
5879521cb5
ASoC: ti: davinci-mcasp: Add system suspend/resume support
The McASP driver supports runtime PM callbacks for register save/restore
during device idle, but doesn't provide system suspend/resume callbacks.
This causes audio to fail to resume after system suspend.

Since the driver already handles runtime suspend & resume, we can reuse
existing runtime PM logics.

Signed-off-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260211221001.155843-1-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-02-22 23:52:22 +00:00
Sen Wang
9db327083f
ASoC: ti: davinci-mcasp: Add asynchronous mode support
McASP has dedicated clock & frame sync registers for both transmit
and receive. Currently McASP driver only supports synchronous behavior and
couples both TX & RX settings.

Add logic that enables asynchronous mode via ti,async-mode property. In
async mode, playback & record can be done simultaneously with different
audio configurations (tdm slots, tdm width, audio bit depth).

Note the ability to have different tx/rx DSP formats (i2s, dsp_a, etc.),
while possible in hardware, remains to be a gap as it require changes
to the corresponding machine driver interface.

Existing IIS (sync mode) and DIT mode logic remains mostly unchanged.
Exceptions are IIS mode logic that previously assumed sync mode, which has
now been made aware of the distinction. And shared logic across all modes
also now checks for McASP tx/rx-specific driver attributes. Those
attributes have been populated according to the original extent, ensuring
no divergence in functionality.

Constraints no longer applicable for async mode are skipped.
Clock selection options have also been added to include rx/tx-only clk_ids,
exposing independent configuration via the machine driver as well.

Note that asynchronous mode is not applicable for McASP in DIT mode,
which is a transmitter-only mode to interface w/ self-clocking formats.

Signed-off-by: Sen Wang <sen@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Tested-by: Paresh Bhagat <p-bhagat@ti.com>
Link: https://patch.msgid.link/20260203003703.2334443-5-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-02-04 18:21:52 +00:00
Sen Wang
016efcaa47
ASoC: ti: davinci-mcasp: Streamline pdir behavior across rx & tx streams
Simplify the mcasp_set_clk_pdir caller convention in start/stop stream
function, to make it so that set_clk_pdir gets called regardless when
stream starts and also disables when stream ends.

Functionality-wise, everything remains the same as the previously skipped
calls are now either correctly configured
(when McASP is SND_SOC_DAIFMT_BP_FC - pdir needs to be enabled)
or called with a bitmask of zero (when McASP is SND_SOC_DAIFMT_BC_FC - pdir
gets disabled).

On brief regarding McASP Clock and Frame sync configurations, refer to [0].

[0]:TRM Section 12.1.1.4.2 https://www.ti.com/lit/ug/sprujd4a/sprujd4a.pdf

Signed-off-by: Sen Wang <sen@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Tested-by: Paresh Bhagat <p-bhagat@ti.com>
Link: https://patch.msgid.link/20260203003703.2334443-4-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-02-04 18:21:51 +00:00
Sen Wang
e683cb088f
ASoC: ti: davinci-mcasp: Disambiguate mcasp_is_synchronous function
The current mcasp_is_synchronous() function does more than what it
proclaims, it also checks if McASP is a frame producer.

Therefore split the original function into two separate ones and
replace all occurrences with the new equivalent logic.

Signed-off-by: Sen Wang <sen@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Tested-by: Paresh Bhagat <p-bhagat@ti.com>
Link: https://patch.msgid.link/20260203003703.2334443-3-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-02-04 18:21:50 +00:00
Mark Brown
9ef552fcf0
ASoC: renesas: rz-ssi: Cleanups
Merge series from Claudiu <claudiu.beznea@tuxon.dev>:

This series adds cleanups for the Renesas RZ SSI driver.
2026-01-20 18:17:02 +00:00
Kery Qi
5b577d214f
ASoC: davinci-evm: Fix reference leak in davinci_evm_probe
The davinci_evm_probe() function calls of_parse_phandle() to acquire
device nodes for "ti,audio-codec" and "ti,mcasp-controller". These
functions return device nodes with incremented reference counts.

However, in several error paths (e.g., when the second of_parse_phandle(),
snd_soc_of_parse_card_name(), or devm_snd_soc_register_card() fails),
the function returns directly without releasing the acquired nodes,
leading to reference leaks.

This patch adds an error handling path 'err_put' to properly release
the device nodes using of_node_put() and clean up the pointers when
an error occurs.

Signed-off-by: Kery Qi <qikeyu2017@gmail.com>
Link: https://patch.msgid.link/20260107154836.1521-2-qikeyu2017@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-01-08 17:31:15 +00:00
Bartosz Golaszewski
0c1db36664
ASoC: davinci-mcasp: remove unneeded #ifdef
The enablement of the CONFIG_OF_GPIO switch has nothing to do with the
"gpio-controller" property which may as well come from software nodes
and GPIOLIB can still be enabled separately.

This driver does not call any symbols from gpiolib-of.h so has no need
to check this option at all. Just use the generic device property
accessor.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20251205090534.27845-1-bartosz.golaszewski@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14 19:37:33 +09:00
Kuninori Morimoto
fefd4e0b26
ASoC: ti: rx51: convert to snd_soc_dapm_xxx()
This patch converts below functions.

dapm->dev					-> snd_soc_dapm_to_dev()
dapm->card					-> snd_soc_dapm_to_card()
dapm->component					-> snd_soc_dapm_to_component()

dapm_kcontrol_get_value()			-> snd_soc_dapm_kcontrol_get_value()

snd_soc_component_enable_pin()			-> snd_soc_dapm_enable_pin()
snd_soc_component_enable_pin_unlocked()		-> snd_soc_dapm_enable_pin_unlocked()
snd_soc_component_disable_pin()			-> snd_soc_dapm_disable_pin()
snd_soc_component_disable_pin_unlocked()	-> snd_soc_dapm_disable_pin_unlocked()
snd_soc_component_nc_pin()			-> snd_soc_dapm_nc_pin()
snd_soc_component_nc_pin_unlocked()		-> snd_soc_dapm_nc_pin_unlocked()
snd_soc_component_get_pin_status()		-> snd_soc_dapm_get_pin_status()
snd_soc_component_force_enable_pin()		-> snd_soc_dapm_force_enable_pin()
snd_soc_component_force_enable_pin_unlocked()	-> snd_soc_dapm_force_enable_pin_unlocked()
snd_soc_component_force_bias_level()		-> snd_soc_dapm_force_bias_level()
snd_soc_component_get_bias_level()		-> snd_soc_dapm_get_bias_level()
snd_soc_component_init_bias_level()		-> snd_soc_dapm_init_bias_level()
snd_soc_component_get_dapm()			-> snd_soc_component_to_dapm()

snd_soc_dapm_kcontrol_component()		-> snd_soc_dapm_kcontrol_to_component()
snd_soc_dapm_kcontrol_widget()			-> snd_soc_dapm_kcontrol_to_widget()
snd_soc_dapm_kcontrol_dapm()			-> snd_soc_dapm_kcontrol_to_dapm()
snd_soc_dapm_np_pin()				-> snd_soc_dapm_disable_pin()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/87o6p9s8u8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-17 00:18:47 +00:00