* [PATCH v2] ASoC: spacemit: advertise only DMA-backed DAI streams
@ 2026-08-05 6:43 phucduc.bui
2026-08-07 6:32 ` Troy Mitchell
2026-08-12 18:46 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: phucduc.bui @ 2026-08-05 6:43 UTC (permalink / raw)
To: Yixun Lan, Takashi Iwai, Mark Brown, Jaroslav Kysela, Liam Girdwood
Cc: Troy Mitchell, Goko Mell, Jinmei Wei, linux-riscv, spacemit,
linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The static DAI template initializes both playback and capture stream
capabilities before dma-names is examined. As a result,
snd_soc_dai_stream_valid() considers both directions valid even when the
device only provides a single DMA channel.
Move the playback and capture capability initialization into
spacemit_i2s_init_dai(), where it is performed only for the stream
directions backed by a corresponding DMA channel. This preserves the
existing capabilities for devices with both "tx" and "rx" DMA channels,
while preventing unsupported stream directions from being advertised.
Initialize rate_min and rate_max together with the other stream
capabilities to preserve the existing rate constraints.
Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Update the commit message to describe the functional fix as
suggested by Troy.
Link v1 :
https://lore.kernel.org/all/20260804043036.22065-1-phucduc.bui@gmail.com/
sound/soc/spacemit/k1_i2s.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c
index 2d5ea1fd5d49..28a762769253 100644
--- a/sound/soc/spacemit/k1_i2s.c
+++ b/sound/soc/spacemit/k1_i2s.c
@@ -354,22 +354,6 @@ static const struct snd_soc_dai_ops spacemit_i2s_dai_ops = {
static struct snd_soc_dai_driver spacemit_i2s_dai = {
.ops = &spacemit_i2s_dai_ops,
- .playback = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = SPACEMIT_PCM_RATES,
- .rate_min = SNDRV_PCM_RATE_8000,
- .rate_max = SNDRV_PCM_RATE_48000,
- .formats = SPACEMIT_PCM_FORMATS,
- },
- .capture = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = SPACEMIT_PCM_RATES,
- .rate_min = SNDRV_PCM_RATE_8000,
- .rate_max = SNDRV_PCM_RATE_48000,
- .formats = SPACEMIT_PCM_FORMATS,
- },
.symmetric_rate = 1,
};
@@ -399,6 +383,8 @@ static int spacemit_i2s_init_dai(struct spacemit_i2s_dev *i2s,
dai->playback.channels_min = 1;
dai->playback.channels_max = 2;
dai->playback.rates = SPACEMIT_PCM_RATES;
+ dai->playback.rate_min = SNDRV_PCM_RATE_8000;
+ dai->playback.rate_max = SNDRV_PCM_RATE_48000;
dai->playback.formats = SPACEMIT_PCM_FORMATS;
i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
@@ -411,6 +397,8 @@ static int spacemit_i2s_init_dai(struct spacemit_i2s_dev *i2s,
dai->capture.channels_min = 1;
dai->capture.channels_max = 2;
dai->capture.rates = SPACEMIT_PCM_RATES;
+ dai->capture.rate_min = SNDRV_PCM_RATE_8000;
+ dai->capture.rate_max = SNDRV_PCM_RATE_48000;
dai->capture.formats = SPACEMIT_PCM_FORMATS;
i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] ASoC: spacemit: advertise only DMA-backed DAI streams
2026-08-05 6:43 [PATCH v2] ASoC: spacemit: advertise only DMA-backed DAI streams phucduc.bui
@ 2026-08-07 6:32 ` Troy Mitchell
2026-08-12 18:46 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Troy Mitchell @ 2026-08-07 6:32 UTC (permalink / raw)
To: phucduc.bui, Yixun Lan, Takashi Iwai, Mark Brown,
Jaroslav Kysela, Liam Girdwood
Cc: Troy Mitchell, Goko Mell, Jinmei Wei, linux-riscv, spacemit,
linux-sound, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]
On Wed Aug 5, 2026 at 2:43 PM +08, phucduc.bui wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> The static DAI template initializes both playback and capture stream
> capabilities before dma-names is examined. As a result,
> snd_soc_dai_stream_valid() considers both directions valid even when the
> device only provides a single DMA channel.
>
> Move the playback and capture capability initialization into
> spacemit_i2s_init_dai(), where it is performed only for the stream
> directions backed by a corresponding DMA channel. This preserves the
> existing capabilities for devices with both "tx" and "rx" DMA channels,
> while preventing unsupported stream directions from being advertised.
>
> Initialize rate_min and rate_max together with the other stream
> capabilities to preserve the existing rate constraints.
>
> Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC")
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Please don't send out the next version so quickly. Many people may miss
it before they even have a chance to see it.
--
Troy Mitchell
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 248 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] ASoC: spacemit: advertise only DMA-backed DAI streams
2026-08-05 6:43 [PATCH v2] ASoC: spacemit: advertise only DMA-backed DAI streams phucduc.bui
2026-08-07 6:32 ` Troy Mitchell
@ 2026-08-12 18:46 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-08-12 18:46 UTC (permalink / raw)
To: Yixun Lan, Takashi Iwai, Jaroslav Kysela, Liam Girdwood, phucduc.bui
Cc: Troy Mitchell, Goko Mell, Jinmei Wei, linux-riscv, spacemit,
linux-sound, linux-kernel
On Wed, 05 Aug 2026 13:43:48 +0700, phucduc.bui@gmail.com wrote:
> ASoC: spacemit: advertise only DMA-backed DAI streams
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/1] ASoC: spacemit: advertise only DMA-backed DAI streams
https://git.kernel.org/broonie/sound/c/0a91bb72980e
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-13 12:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-05 6:43 [PATCH v2] ASoC: spacemit: advertise only DMA-backed DAI streams phucduc.bui
2026-08-07 6:32 ` Troy Mitchell
2026-08-12 18:46 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®