public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Shreeya Patel <shreeya.patel@collabora.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>, 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>,
	Diederik de Haas <didi.debian@cknow.org>
Subject: Re: [PATCH v12 3/6] media: platform: synopsys: Add support for HDMI input driver
Date: Thu, 27 Feb 2025 09:20:03 +0300	[thread overview]
Message-ID: <82e5a342-c82e-40c4-88a9-645a70420aa0@collabora.com> (raw)
In-Reply-To: <20250227055025.766018-4-dmitry.osipenko@collabora.com>

On 2/27/25 08:50, Dmitry Osipenko wrote:
> +struct hdmirx_cec *snps_hdmirx_cec_register(struct hdmirx_cec_data *data)
> +{
> +	struct hdmirx_cec *cec;
> +	unsigned int irqs;
> +	int ret;
> +
> +	/*
> +	 * Our device is just a convenience - we want to link to the real
> +	 * hardware device here, so that userspace can see the association
> +	 * between the HDMI hardware and its associated CEC chardev.
> +	 */
> +	cec = devm_kzalloc(data->dev, sizeof(*cec), GFP_KERNEL);
> +	if (!cec)
> +		return ERR_PTR(-ENOMEM);
> +
> +	cec->dev = data->dev;
> +	cec->irq = data->irq;
> +	cec->ops = data->ops;
> +	cec->hdmirx = data->hdmirx;
> +
> +	hdmirx_cec_update_bits(cec, GLOBAL_SWENABLE, CEC_ENABLE, CEC_ENABLE);
> +	hdmirx_cec_update_bits(cec, CEC_CONFIG, RX_AUTO_DRIVE_ACKNOWLEDGE,
> +			       RX_AUTO_DRIVE_ACKNOWLEDGE);
> +
> +	hdmirx_cec_write(cec, CEC_TX_COUNT, 0);
> +	hdmirx_cec_write(cec, CEC_INT_MASK_N, 0);
> +	hdmirx_cec_write(cec, CEC_INT_CLEAR, ~0);
> +
> +	cec->adap = cec_allocate_adapter(&hdmirx_cec_ops, cec, "snps-hdmirx",
> +					 CEC_CAP_DEFAULTS | CEC_CAP_MONITOR_ALL,
> +					 CEC_MAX_LOG_ADDRS);
> +	if (IS_ERR(cec->adap)) {
> +		dev_err(cec->dev, "cec adapter allocation failed\n");
> +		return ERR_CAST(cec->adap);
> +	}
> +
> +	/* override the module pointer */
> +	cec->adap->owner = THIS_MODULE;
> +
> +	ret = devm_add_action(cec->dev, hdmirx_cec_del, cec);
> +	if (ret) {
> +		cec_delete_adapter(cec->adap);
> +		return ERR_PTR(ret);
> +	}
> +
> +	irq_set_status_flags(cec->irq, IRQ_NOAUTOEN);
> +
> +	ret = devm_request_threaded_irq(cec->dev, cec->irq,
> +					hdmirx_cec_hardirq,
> +					hdmirx_cec_thread, IRQF_ONESHOT,
> +					"rk_hdmirx_cec", cec->adap);
> +	if (ret) {
> +		dev_err(cec->dev, "cec irq request failed\n");
> +		return ERR_PTR(ret);
> +	}
> +
> +	cec->notify = cec_notifier_cec_adap_register(cec->dev,
> +						     NULL, cec->adap);

It now occurred to me that this cec->notify also should be not needed
for this driver and *everything* related to CEC notifiers should be
removed. Hans, is this correct or I'm missing something?

-- 
Best regards,
Dmitry

  reply	other threads:[~2025-02-27  6:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  5:50 [PATCH v12 0/6] Add Synopsys DesignWare HDMI RX Controller Dmitry Osipenko
2025-02-27  5:50 ` [PATCH v12 1/6] MAINTAINERS: Add entry for Synopsys DesignWare HDMI RX Driver Dmitry Osipenko
2025-02-27  5:50 ` [PATCH v12 2/6] dt-bindings: media: Document bindings for HDMI RX Controller Dmitry Osipenko
2025-02-27  5:50 ` [PATCH v12 3/6] media: platform: synopsys: Add support for HDMI input driver Dmitry Osipenko
2025-02-27  6:20   ` Dmitry Osipenko [this message]
2025-02-27  5:50 ` [PATCH v12 4/6] arm64: dts: rockchip: Add device tree support for HDMI RX Controller Dmitry Osipenko
2025-02-27  5:50 ` [PATCH v12 5/6] arm64: dts: rockchip: Enable HDMI receiver on rock-5b Dmitry Osipenko
2025-02-27  5:50 ` [PATCH v12 6/6] arm64: defconfig: Enable Synopsys HDMI receiver 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=82e5a342-c82e-40c4-88a9-645a70420aa0@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=didi.debian@cknow.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