From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Dariusz Marcinkiewicz <darekm@google.com>, linux-media@vger.kernel.org
Subject: Re: [PATCH v5 7/9] drm: tegra: use cec_notifier_conn_(un)register
Date: Thu, 8 Aug 2019 22:42:52 +0200 [thread overview]
Message-ID: <a0f3e2ba-5e3b-9800-d1f4-75d7ca424fc9@xs4all.nl> (raw)
In-Reply-To: <20190807085232.151260-8-darekm@google.com>
On 8/7/19 10:52 AM, Dariusz Marcinkiewicz wrote:
> Use the new cec_notifier_conn_(un)register() functions to
> (un)register the notifier for the HDMI connector, and fill in
> the cec_connector_info.
>
> Changes since v4:
> - only create a CEC notifier for HDMI connectors
>
> Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Tested with a Jetson TK1 board.
Regards,
Hans
> ---
> drivers/gpu/drm/tegra/output.c | 28 +++++++++++++++++++++-------
> 1 file changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
> index 9c2b9dad55c30..13153b93626fd 100644
> --- a/drivers/gpu/drm/tegra/output.c
> +++ b/drivers/gpu/drm/tegra/output.c
> @@ -80,6 +80,11 @@ tegra_output_connector_detect(struct drm_connector *connector, bool force)
>
> void tegra_output_connector_destroy(struct drm_connector *connector)
> {
> + struct tegra_output *output = connector_to_output(connector);
> +
> + if (output->cec)
> + cec_notifier_conn_unregister(output->cec);
> +
> drm_connector_unregister(connector);
> drm_connector_cleanup(connector);
> }
> @@ -174,18 +179,11 @@ int tegra_output_probe(struct tegra_output *output)
> disable_irq(output->hpd_irq);
> }
>
> - output->cec = cec_notifier_get(output->dev);
> - if (!output->cec)
> - return -ENOMEM;
> -
> return 0;
> }
>
> void tegra_output_remove(struct tegra_output *output)
> {
> - if (output->cec)
> - cec_notifier_put(output->cec);
> -
> if (gpio_is_valid(output->hpd_gpio)) {
> free_irq(output->hpd_irq, output);
> gpio_free(output->hpd_gpio);
> @@ -197,6 +195,7 @@ void tegra_output_remove(struct tegra_output *output)
>
> int tegra_output_init(struct drm_device *drm, struct tegra_output *output)
> {
> + int connector_type;
> int err;
>
> if (output->panel) {
> @@ -212,6 +211,21 @@ int tegra_output_init(struct drm_device *drm, struct tegra_output *output)
> if (gpio_is_valid(output->hpd_gpio))
> enable_irq(output->hpd_irq);
>
> + connector_type = output->connector.connector_type;
> + /*
> + * Create a CEC notifier for HDMI connector.
> + */
> + if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> + connector_type == DRM_MODE_CONNECTOR_HDMIB) {
> + struct cec_connector_info conn_info;
> +
> + cec_fill_conn_info_from_drm(&conn_info, &output->connector);
> + output->cec = cec_notifier_conn_register(output->dev, NULL,
> + &conn_info);
> + if (!output->cec)
> + return -ENOMEM;
> + }
> +
> return 0;
> }
>
>
next prev parent reply other threads:[~2019-08-08 20:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 8:52 [PATCH v5 0/9] drm: cec: convert DRM drivers to the new notifier API Dariusz Marcinkiewicz
2019-08-07 8:52 ` [PATCH v5 1/9] drm_dp_cec: add connector info support Dariusz Marcinkiewicz
2019-08-08 8:18 ` Hans Verkuil
2019-08-09 10:30 ` Hans Verkuil
2019-08-08 8:44 ` Hans Verkuil
2019-08-07 8:52 ` [PATCH v5 2/9] drm/i915/intel_hdmi: use cec_notifier_conn_(un)register Dariusz Marcinkiewicz
2019-08-08 11:47 ` Hans Verkuil
2019-08-07 8:52 ` [PATCH v5 3/9] dw-hdmi-cec: use cec_notifier_cec_adap_(un)register Dariusz Marcinkiewicz
2019-08-09 10:25 ` Hans Verkuil
2019-08-07 8:52 ` [PATCH v5 4/9] tda9950: " Dariusz Marcinkiewicz
2019-08-08 9:11 ` Hans Verkuil
2019-08-07 8:52 ` [PATCH v5 5/9] drm: tda998x: use cec_notifier_conn_(un)register Dariusz Marcinkiewicz
2019-08-08 9:12 ` Hans Verkuil
2019-08-07 8:52 ` [PATCH v5 6/9] drm: sti: " Dariusz Marcinkiewicz
2019-08-07 8:52 ` [PATCH v5 7/9] drm: tegra: " Dariusz Marcinkiewicz
2019-08-08 20:42 ` Hans Verkuil [this message]
2019-08-07 8:52 ` [PATCH v5 8/9] drm: dw-hdmi: " Dariusz Marcinkiewicz
2019-08-09 15:12 ` Hans Verkuil
2019-08-07 8:52 ` [PATCH v5 9/9] drm: exynos: exynos_hdmi: " Dariusz Marcinkiewicz
2019-08-08 14:27 ` Hans Verkuil
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=a0f3e2ba-5e3b-9800-d1f4-75d7ca424fc9@xs4all.nl \
--to=hverkuil-cisco@xs4all.nl \
--cc=darekm@google.com \
--cc=linux-media@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).