Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Igor Paunovic <royalnet026@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, kernel@collabora.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] media: synopsys: hdmirx: add HDMI audio capture support
Date: Mon, 20 Jul 2026 04:42:46 +0300	[thread overview]
Message-ID: <25922edc-4ff1-4d28-9a64-2c28b2b690cb@collabora.com> (raw)
In-Reply-To: <20260718085728.6797-3-royalnet026@gmail.com>

On 7/18/26 11:57, Igor Paunovic wrote:
> The Synopsys DesignWare HDMI RX controller extracts the audio stream
> embedded in the incoming HDMI signal and feeds it to an on-SoC I2S
> controller. Expose it as an ALSA capture device by registering the
> generic hdmi-codec as a child of the controller, so that a
> simple-audio-card in the device tree can bind the HDMI RX audio DAI.
> 
> The sample rate is recovered from the ACR N/CTS values together with the
> measured TMDS character rate. A periodic worker keeps the local audio
> reference clock locked to the source by nudging it in small ppm steps to
> hold the audio FIFO fill level near its target, which avoids FIFO
> under/overflow and the resulting dropped samples.
> 
> Signed-off-by: Igor Paunovic <royalnet026@gmail.com>
> ---
> Changes in v3:
> - restore the v1 audio teardown in remove(): audio_shutdown() already
>   stops the worker when the stream closes, so the extra flag clear
>   and trailing cancel added in v2 were redundant (Dmitry Osipenko)
> - rename the ACR read locals and add a comment documenting the
>   register byte packing
> - drop the get_dai_id stub so OF-graph cards resolve the DAI index
>   from the reg property
> 
> Changes in v2:
> - register the S/PDIF DAI so the indexes match the binding and reject
>   it with -EOPNOTSUPP until wired up (Sebastian Reichel)
> - use platform_device_register_data() and drop the fixed 32-bit DMA
>   mask (Dmitry Osipenko)
> - don't leave an ERR_PTR in audio_pdev on registration failure
> - fix teardown ordering in remove()
> - stop the worker before reprogramming shared state in hw_params()
> - look up the "audio" clock by name instead of indexing clks[1]
> - keep the worker on system_unbound_wq when re-arming
> 
>  .../platform/synopsys/hdmirx/snps_hdmirx.c    | 271 ++++++++++++++++++
>  .../platform/synopsys/hdmirx/snps_hdmirx.h    |   8 +
>  2 files changed, 279 insertions(+)

Works well on 5b, thanks. Only one additional review comment:

Please update hdmirx_suspend() to return -EBUSY if audio_streaming=true.

```
static __maybe_unused int hdmirx_suspend(struct device *dev)
{
	struct snps_hdmirx_dev *hdmirx_dev = dev_get_drvdata(dev);

	if (READ_ONCE((hdmirx_dev->audio_streaming)))
		return -EBUSY;
```

-- 
Best regards,
Dmitry


  parent reply	other threads:[~2026-07-20  1:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18  8:57 [PATCH v3 0/4] media: synopsys: hdmirx: add HDMI audio capture support Igor Paunovic
2026-07-18  8:57 ` [PATCH v3 1/4] dt-bindings: media: snps,dw-hdmi-rx: add #sound-dai-cells Igor Paunovic
2026-07-19  8:54   ` Krzysztof Kozlowski
2026-07-19  9:53     ` Igor Paunovic
2026-07-18  8:57 ` [PATCH v3 2/4] media: synopsys: hdmirx: add HDMI audio capture support Igor Paunovic
     [not found]   ` <20260718090955.A79E51F000E9@smtp.kernel.org>
2026-07-18 10:53     ` Igor Paunovic
2026-07-20  1:42   ` Dmitry Osipenko [this message]
2026-07-20 12:30     ` Igor Paunovic
2026-07-20 14:36       ` Dmitry Osipenko
2026-07-21  5:31         ` Igor Paunovic
2026-07-18  8:57 ` [PATCH v3 3/4] arm64: dts: rockchip: add #sound-dai-cells to the RK3588 HDMI receiver Igor Paunovic
2026-07-18 11:12   ` Igor Paunovic
2026-07-18  8:57 ` [PATCH v3 4/4] arm64: dts: rockchip: enable HDMI RX audio capture on Orange Pi 5 Plus Igor Paunovic
     [not found]   ` <20260718091200.65AE21F000E9@smtp.kernel.org>
2026-07-18 11:04     ` Igor Paunovic
2026-07-18 23:31   ` Sebastian Reichel
2026-07-19  7:12     ` Igor Paunovic

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=25922edc-4ff1-4d28-9a64-2c28b2b690cb@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=royalnet026@gmail.com \
    --cc=sebastian.reichel@collabora.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox