[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ffa9973-014e-af7c-13ab-d255adf5a8c2@baylibre.com>
Date: Mon, 19 Aug 2019 16:35:51 +0200
From: Neil Armstrong <narmstrong@...libre.com>
To: Dariusz Marcinkiewicz <darekm@...gle.com>,
dri-devel@...ts.freedesktop.org, linux-media@...r.kernel.org,
hverkuil-cisco@...all.nl
Cc: Andrzej Hajda <a.hajda@...sung.com>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...l.net>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Kate Stewart <kstewart@...uxfoundation.org>,
Allison Randal <allison@...utok.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 3/9] dw-hdmi-cec: use
cec_notifier_cec_adap_(un)register
On 14/08/2019 12:45, Dariusz Marcinkiewicz wrote:
> Use the new cec_notifier_cec_adap_(un)register() functions to
> (un)register the notifier for the CEC adapter.
>
> Also adds CEC_CAP_CONNECTOR_INFO capability to the adapter.
>
> Changes since v3:
> - add CEC_CAP_CONNECTOR_INFO to cec_allocate_adapter,
> - replace CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT |
> CEC_CAP_RC | CEC_CAP_PASSTHROUGH with CEC_CAP_DEFAULTS.
>
> Signed-off-by: Dariusz Marcinkiewicz <darekm@...gle.com>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@...all.nl>
> Tested-by: Hans Verkuil <hverkuil-cisco@...all.nl>
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
> index 0f949978d3fcd..ac1e001d08829 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
> @@ -256,8 +256,8 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
> dw_hdmi_write(cec, 0, HDMI_CEC_POLARITY);
>
> cec->adap = cec_allocate_adapter(&dw_hdmi_cec_ops, cec, "dw_hdmi",
> - CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT |
> - CEC_CAP_RC | CEC_CAP_PASSTHROUGH,
> + CEC_CAP_DEFAULTS |
> + CEC_CAP_CONNECTOR_INFO,
> CEC_MAX_LOG_ADDRS);
> if (IS_ERR(cec->adap))
> return PTR_ERR(cec->adap);
> @@ -278,13 +278,14 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
> if (ret < 0)
> return ret;
>
> - cec->notify = cec_notifier_get(pdev->dev.parent);
> + cec->notify = cec_notifier_cec_adap_register(pdev->dev.parent,
> + NULL, cec->adap);
> if (!cec->notify)
> return -ENOMEM;
>
> ret = cec_register_adapter(cec->adap, pdev->dev.parent);
> if (ret < 0) {
> - cec_notifier_put(cec->notify);
> + cec_notifier_cec_adap_unregister(cec->notify);
> return ret;
> }
>
> @@ -294,8 +295,6 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
> */
> devm_remove_action(&pdev->dev, dw_hdmi_cec_del, cec);
>
> - cec_register_cec_notifier(cec->adap, cec->notify);
> -
> return 0;
> }
>
> @@ -303,8 +302,8 @@ static int dw_hdmi_cec_remove(struct platform_device *pdev)
> {
> struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
>
> + cec_notifier_cec_adap_unregister(cec->notify);
> cec_unregister_adapter(cec->adap);
> - cec_notifier_put(cec->notify);
>
> return 0;
> }
>
Reviewed-by: Neil Armstrong <narmstrong@...libre.com>
Powered by blists - more mailing lists