public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Shreeya Patel <shreeya.patel@collabora.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	jose.abreu@synopsys.com, nelson.costa@synopsys.com,
	shawn.wen@rock-chips.com, nicolas.dufresne@collabora.com,
	Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: kernel@collabora.com, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rockchip@lists.infradead.org, Tim Surber <me@timsurber.de>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH v10 3/6] media: platform: synopsys: Add support for HDMI input driver
Date: Wed, 26 Feb 2025 12:24:22 +0300	[thread overview]
Message-ID: <cf4c855b-6b1f-4a91-b292-5635ee4f7d2e@collabora.com> (raw)
In-Reply-To: <4236518a-6ed6-4e01-9bf2-d41f0a194c26@xs4all.nl>

On 2/26/25 11:47, Hans Verkuil wrote:
...
>> +static int hdmirx_register_cec(struct snps_hdmirx_dev *hdmirx_dev,
>> +			       struct platform_device *pdev)
>> +{
>> +	struct device *dev = hdmirx_dev->dev;
>> +	struct hdmirx_cec_data cec_data;
>> +	int irq;
>> +
>> +	irq = platform_get_irq_byname(pdev, "cec");
>> +	if (irq < 0) {
>> +		dev_err_probe(dev, irq, "failed to get cec irq\n");
>> +		return irq;
>> +	}
>> +
>> +	hdmirx_dev->cec_notifier = cec_notifier_conn_register(dev, NULL, NULL);
> 
> I never really paid attention to this, but you don't need to use the cec-notifier
> API. The notifier API is needed if an independent CEC device has to be associated
> with an independent HDMI interface, and needs to be notified whenever the
> physical address changes.
> 
> This is a single IP combining both HDMI and CEC, so the HDMI part calls
> cec_s_phys_addr_from_edid()/cec_phys_addr_invalidate() directly whenever the EDID
> changes.
> 
> So just drop the include of cec-notifier.h and anything related to this.

Ack

...
>> +	hdmirx_dev->infoframes = v4l2_debugfs_if_alloc(hdmirx_dev->debugfs_dir,
>> +						       V4L2_DEBUGFS_IF_AVI, hdmirx_dev,
>> +						       hdmirx_debugfs_if_read);
>> +
>> +	return 0;
>> +
>> +err_unreg_video_dev:
>> +	video_unregister_device(&hdmirx_dev->stream.vdev);
> 
> Replace this with vb2_video_unregister_device(). Sorry, I missed this in my previous reviews.
> 
>> +err_unreg_v4l2_dev:
>> +	v4l2_device_unregister(&hdmirx_dev->v4l2_dev);
>> +err_hdl:
>> +	v4l2_ctrl_handler_free(&hdmirx_dev->hdl);
>> +err_pm:
>> +	hdmirx_disable(dev);
>> +
>> +	return ret;
>> +}
>> +
>> +static void hdmirx_remove(struct platform_device *pdev)
>> +{
>> +	struct device *dev = &pdev->dev;
>> +	struct snps_hdmirx_dev *hdmirx_dev = dev_get_drvdata(dev);
>> +
>> +	v4l2_debugfs_if_free(hdmirx_dev->infoframes);
>> +	debugfs_remove_recursive(hdmirx_dev->debugfs_dir);
>> +
>> +	snps_hdmirx_cec_unregister(hdmirx_dev->cec);
>> +	cec_notifier_conn_unregister(hdmirx_dev->cec_notifier);
>> +
>> +	hdmirx_disable_irq(dev);
>> +
>> +	video_unregister_device(&hdmirx_dev->stream.vdev);
> 
> vb2_video_unregister_device().
> 
> This function ensures that, if streaming was in progress and the driver was forcibly
> removed, streaming is stopped gracefully and safely.

Ack

-- 
Best regards,
Dmitry

  reply	other threads:[~2025-02-26  9:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 18:30 [PATCH v10 0/6] Add Synopsys DesignWare HDMI RX Controller Dmitry Osipenko
2025-02-25 18:30 ` [PATCH v10 1/6] MAINTAINERS: Add entry for Synopsys DesignWare HDMI RX Driver Dmitry Osipenko
2025-02-26  8:44   ` Krzysztof Kozlowski
2025-02-26  9:24     ` Dmitry Osipenko
2025-02-25 18:30 ` [PATCH v10 2/6] dt-bindings: media: Document bindings for HDMI RX Controller Dmitry Osipenko
2025-02-25 18:30 ` [PATCH v10 3/6] media: platform: synopsys: Add support for HDMI input driver Dmitry Osipenko
2025-02-26  8:47   ` Hans Verkuil
2025-02-26  9:24     ` Dmitry Osipenko [this message]
2025-02-26 15:14   ` Diederik de Haas
2025-02-27  5:28     ` Dmitry Osipenko
2025-02-27 11:16       ` Diederik de Haas
2025-02-27 19:40       ` Nicolas Dufresne
2025-02-25 18:30 ` [PATCH v10 4/6] arm64: dts: rockchip: Add device tree support for HDMI RX Controller Dmitry Osipenko
2025-02-25 18:30 ` [PATCH v10 5/6] arm64: dts: rockchip: Enable HDMI receiver on rock-5b Dmitry Osipenko
2025-02-25 18:30 ` [PATCH v10 6/6] arm64: defconfig: Enable Synopsys HDMI receiver Dmitry Osipenko
2025-02-26  8:31   ` Hans Verkuil
2025-02-26  9:24     ` Dmitry Osipenko
2025-02-28  3:51     ` Nicolas Dufresne
2025-03-04 16:17       ` Hans Verkuil
2025-03-05 11:08         ` Dmitry Osipenko

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=cf4c855b-6b1f-4a91-b292-5635ee4f7d2e@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=hverkuil@xs4all.nl \
    --cc=jose.abreu@synopsys.com \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=me@timsurber.de \
    --cc=nelson.costa@synopsys.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=robh@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=shawn.wen@rock-chips.com \
    --cc=shreeya.patel@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