All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: christian.koever-draxl@student.uibk.ac.at
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/bridge: dw-hdmi-i2s: support the S/PDIF audio input
Date: Sun, 25 Oct 2026 21:19:15 +0000	[thread overview]
Message-ID: <sashiko-outbox-184454@kernel.org> (raw)
In-Reply-To: <20261025192436.209908-1-christian.koever-draxl@student.uibk.ac.at>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/bridge: dw-hdmi-i2s: duplicate Capture DAPM widgets when spdif is enabled
--

commit 566412f94af4997a1eb5d5114c6f602dc558da39
Author: Christian Stefan Kövér-Draxl <ckoever@outlook.de>

drm/bridge: dw-hdmi-i2s: support the S/PDIF audio input

This commit adds support for the S/PDIF audio input on the DesignWare HDMI TX
controller by allowing platforms to set spdif_input in dw_hdmi_plat_data,
registering the hdmi-codec S/PDIF DAI when enabled, and configuring the audio
sampler for S/PDIF in hw_params.

> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> index 2c903c9fe8052..304ef881e06c8 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
[ ... ]
> @@ -197,6 +244,7 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev)
>  	memset(&pdata, 0, sizeof(pdata));
>  	pdata.ops		= &dw_hdmi_i2s_ops;
>  	pdata.i2s		= 1;
> +	pdata.spdif		= audio->spdif;
>  	pdata.max_i2s_channels	= 8;
>  	pdata.data		= audio;

[Severity: Medium]
When plat_data->spdif_input is true, dw_hdmi_probe() sets audio.spdif = true,
and snd_dw_hdmi_probe() in drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
registers hdmi-audio-codec with both pdata.i2s and pdata.spdif set while
leaving pdata.no_i2s_capture and pdata.no_spdif_capture set to 0.

In sound/soc/codecs/hdmi-codec.c:hdmi_codec_probe(), both hdmi_i2s_dai and
hdmi_spdif_dai retain their default capture stream definition
(.capture.stream_name = "Capture") unless no_i2s_capture and no_spdif_capture
are set:

	if (hcd->i2s) {
		daidrv[i] = hdmi_i2s_dai;
		...
		if (hcd->no_i2s_capture)
			memset(&daidrv[i].capture, 0,
			       sizeof(daidrv[i].capture));
		i++;
	}

	if (hcd->spdif) {
		daidrv[i] = hdmi_spdif_dai;
		...
		if (hcd->no_spdif_playback)
			memset(&daidrv[i].playback, 0,
			       sizeof(daidrv[i].playback));
		if (hcd->no_spdif_capture)
			memset(&daidrv[i].capture, 0,
			       sizeof(daidrv[i].capture));
	}

When the sound card probes the component via
soc_probe_component()->snd_soc_dapm_new_dai_widgets(), does having two DAIs
with the same capture stream name "Capture" on the same component create two
duplicate "Capture" snd_soc_dapm_dai_out widgets in the same DAPM context,
triggering a debugfs file collision error ("debugfs: File 'Capture' in
directory 'dapm' already present!") in
snd_soc_dapm_new_widgets()->dapm_debugfs_add_widget() and causing duplicate
"RX" -> "Capture" DAPM routes to resolve to the first DAI's widget?

Since the DesignWare HDMI TX controller is transmit-only, should
snd_dw_hdmi_probe() also set pdata.no_i2s_capture = 1 and
pdata.no_spdif_capture = 1, matching other HDMI TX drivers that enable both
I2S and S/PDIF such as drm_connector_hdmi_audio_init() and
tda998x_audio_codec_init()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261025192436.209908-1-christian.koever-draxl@student.uibk.ac.at?part=1

      reply	other threads:[~2026-10-25 21:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25 19:24 [PATCH] drm/bridge: dw-hdmi-i2s: support the S/PDIF audio input christian.koever-draxl
2026-10-25 21:19 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-184454@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=christian.koever-draxl@student.uibk.ac.at \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.