[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69d57416-c37f-fab9-6436-ec18212cdcce@xs4all.nl>
Date: Mon, 19 Aug 2019 11:33:21 +0200
From: Hans Verkuil <hverkuil-cisco@...all.nl>
To: Dariusz Marcinkiewicz <darekm@...gle.com>,
dri-devel@...ts.freedesktop.org, linux-media@...r.kernel.org
Cc: David Airlie <airlied@...ux.ie>, linux-kernel@...r.kernel.org,
Jonathan Hunter <jonathanh@...dia.com>,
Thierry Reding <thierry.reding@...il.com>,
linux-tegra@...r.kernel.org
Subject: Re: [PATCH v7 7/9] drm: tegra: use cec_notifier_conn_(un)register
On 8/14/19 12:45 PM, 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@...gle.com>
> Tested-by: Hans Verkuil <hverkuil-cisco@...all.nl>
Acked-by: Hans Verkuil <hverkuil-cisco@...all.nl>
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 bdcaa4c7168cf..34373734ff689 100644
> --- a/drivers/gpu/drm/tegra/output.c
> +++ b/drivers/gpu/drm/tegra/output.c
> @@ -70,6 +70,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);
> }
> @@ -163,18 +168,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 (output->hpd_gpio)
> free_irq(output->hpd_irq, output);
>
> @@ -184,6 +182,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) {
> @@ -199,6 +198,21 @@ int tegra_output_init(struct drm_device *drm, struct tegra_output *output)
> if (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;
> }
>
>
Powered by blists - more mailing lists