linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH] drm/tegra: Refactor CEC support
Date: Mon, 10 Dec 2018 18:07:59 +0100	[thread overview]
Message-ID: <57066560-7c1b-5702-5269-9bc9deffc53e@xs4all.nl> (raw)
In-Reply-To: <1611ab47-9ba6-83dc-6f6d-8add7b0a9751@xs4all.nl>

On 12/10/18 5:36 PM, Hans Verkuil wrote:
> On 12/10/18 5:34 PM, Thierry Reding wrote:
>> From: Thierry Reding <treding@nvidia.com>
>>
>> Most of the CEC support code already lives in the "output" library code.
>> Move registration and unregistration to the library code as well to make
>> use of the same code with HDMI on Tegra210 and later via the SOR.
>>
>> Signed-off-by: Thierry Reding <treding@nvidia.com>
> 
> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

But read my reply to "[PATCH 1/2] media: tegra-cec: Support Tegra186 and Tegra194".
You may want to take a different approach here.

Regards,

	Hans

> 
> Thanks!
> 
> 	Hans
> 
>> ---
>>  drivers/gpu/drm/tegra/drm.h    |  2 +-
>>  drivers/gpu/drm/tegra/hdmi.c   |  9 ---------
>>  drivers/gpu/drm/tegra/output.c | 11 +++++++++--
>>  3 files changed, 10 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
>> index 019862a41cb4..dbc9e11b0aec 100644
>> --- a/drivers/gpu/drm/tegra/drm.h
>> +++ b/drivers/gpu/drm/tegra/drm.h
>> @@ -132,7 +132,7 @@ struct tegra_output {
>>  	struct drm_panel *panel;
>>  	struct i2c_adapter *ddc;
>>  	const struct edid *edid;
>> -	struct cec_notifier *notifier;
>> +	struct cec_notifier *cec;
>>  	unsigned int hpd_irq;
>>  	int hpd_gpio;
>>  	enum of_gpio_flags hpd_gpio_flags;
>> diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
>> index 0082468f703c..d19973945614 100644
>> --- a/drivers/gpu/drm/tegra/hdmi.c
>> +++ b/drivers/gpu/drm/tegra/hdmi.c
>> @@ -22,8 +22,6 @@
>>  
>>  #include <sound/hda_verbs.h>
>>  
>> -#include <media/cec-notifier.h>
>> -
>>  #include "hdmi.h"
>>  #include "drm.h"
>>  #include "dc.h"
>> @@ -1709,10 +1707,6 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
>>  		return PTR_ERR(hdmi->vdd);
>>  	}
>>  
>> -	hdmi->output.notifier = cec_notifier_get(&pdev->dev);
>> -	if (hdmi->output.notifier == NULL)
>> -		return -ENOMEM;
>> -
>>  	hdmi->output.dev = &pdev->dev;
>>  
>>  	err = tegra_output_probe(&hdmi->output);
>> @@ -1771,9 +1765,6 @@ static int tegra_hdmi_remove(struct platform_device *pdev)
>>  
>>  	tegra_output_remove(&hdmi->output);
>>  
>> -	if (hdmi->output.notifier)
>> -		cec_notifier_put(hdmi->output.notifier);
>> -
>>  	return 0;
>>  }
>>  
>> diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
>> index c662efc7e413..9c2b9dad55c3 100644
>> --- a/drivers/gpu/drm/tegra/output.c
>> +++ b/drivers/gpu/drm/tegra/output.c
>> @@ -36,7 +36,7 @@ int tegra_output_connector_get_modes(struct drm_connector *connector)
>>  	else if (output->ddc)
>>  		edid = drm_get_edid(connector, output->ddc);
>>  
>> -	cec_notifier_set_phys_addr_from_edid(output->notifier, edid);
>> +	cec_notifier_set_phys_addr_from_edid(output->cec, edid);
>>  	drm_connector_update_edid_property(connector, edid);
>>  
>>  	if (edid) {
>> @@ -73,7 +73,7 @@ tegra_output_connector_detect(struct drm_connector *connector, bool force)
>>  	}
>>  
>>  	if (status != connector_status_connected)
>> -		cec_notifier_phys_addr_invalidate(output->notifier);
>> +		cec_notifier_phys_addr_invalidate(output->cec);
>>  
>>  	return status;
>>  }
>> @@ -174,11 +174,18 @@ 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);
>>
> 


  reply	other threads:[~2018-12-10 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 16:34 [PATCH] drm/tegra: Refactor CEC support Thierry Reding
2018-12-10 16:36 ` Hans Verkuil
2018-12-10 17:07   ` Hans Verkuil [this message]
2018-12-11  9:22     ` 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=57066560-7c1b-5702-5269-9bc9deffc53e@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).