All of lore.kernel.org
 help / color / mirror / Atom feed
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/4] drm/bridge: dw-hdmi: add cec driver
Date: Wed, 02 Aug 2017 17:22:54 +0300	[thread overview]
Message-ID: <2270313.kliK1kl0Jl@avalon> (raw)
In-Reply-To: <f9cddb0a-ed24-d5a4-c85e-ee803cebcfdd@xs4all.nl>

Hi Hans,

On Wednesday 02 Aug 2017 15:34:33 Hans Verkuil wrote:
> On 08/02/17 15:27, Russell King - ARM Linux wrote:
> > On Wed, Aug 02, 2017 at 04:14:34PM +0300, Laurent Pinchart wrote:
> >> On Wednesday 02 Aug 2017 08:47:23 Hans Verkuil wrote:
> >>> On 08/02/2017 12:32 AM, Laurent Pinchart wrote:
> >>>>> +
> >>>>> +	cec_register_cec_notifier(cec->adap, cec->notify);
> >>>>> +
> >>>>> +	return 0;
> >>>>> +}
> >>>>> +
> >>>>> +static int dw_hdmi_cec_remove(struct platform_device *pdev)
> >>>>> +{
> >>>>> +	struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
> >>>>> +
> >>>>> +	cec_unregister_adapter(cec->adap);
> >>>>> +	cec_notifier_put(cec->notify);
> >>>>> +
> >>>>> +	return 0;
> >>>>> +}
> >>>>> +
> >>>>> +static struct platform_driver dw_hdmi_cec_driver = {
> >>>>> +	.probe	= dw_hdmi_cec_probe,
> >>>>> +	.remove	= dw_hdmi_cec_remove,
> >>>>> +	.driver = {
> >>>>> +		.name = "dw-hdmi-cec",
> >>>>> +	},
> >>>>> +};
> >>>>> +module_platform_driver(dw_hdmi_cec_driver);
> >>>> 
> >>>> Is there a particular reason why this has to be a separate module
> >>>> instead of simply calling the CEC init/cleanup functions directly from
> >>>> the main dw-hdmi driver ?
> >>> 
> >>> Not all SoCs that use dw-hdmi also use the dw-hdmi CEC implementation.
> >>> Some use their own implementation (amlogic).
> >> 
> >> Lovely. Of course we need to reinvent the wheel every time, where would
> >> the fun be otherwise ?
> >> 
> >>> So by implementing the cec-notifier in the dw-hdmi driver and keeping
> >>> dw-hdmi CEC separate you can easily choose whether or not you want to
> >>> use this CEC driver or another SoC CEC driver.
> >> 
> >> I'm certainly fine with such a split, but I don't think it requires a
> >> separate platform_driver. We could use a similar approach as with the
> >> HDMI PHY that can also differ between SoCs. The PHY is identified at
> >> runtime when possible, and the SoC-specific glue code can override that
> >> with a few data fields and function pointers.
> > 
> > Excuse me if I completely lose interest in reworking the driver at this
> > point, as it's enough of an effort to follow the churn in CEC from one
> > kernel version to another.  I'm not about to rewrite the driver and
> > restart the review cycle from scratch and then have several iterations
> > of having to update it as CEC continues to evolve.
> > 
> > Let's get this driver in mainline, and then if we want further changes
> > we can do that later.
> 
> +1
> 
> I also don't think the phy idea applies here. CEC implementations range from
> tightly coupled to the HDMI implementation to a completely independent i2c
> device that is unrelated to any HDMI receiver/transmitter. And various
> shades in between those extremes.

Then it should be even simpler. Instead of creating a separate platform device 
for the DW HDMI CEC, we can just call the DW HDMI CEC driver init/cleanup 
functions directly when the IP core implements CEC. When it doesn't, a 
separate device will be described in DT (at least to my understanding, 
otherwise where would it come from ?) and a separate driver would handle it.

> The only thing that is needed is that the CEC device needs to be informed
> when an EDID is read and when the hotplug disappears. The CEC notifier does
> just that and it is already in use, so it is nothing new. No need to rework
> this.

The notifier implementation in patch 1/4 looks good to me (except for the 
missing cec_notifier_put() call that I mentioned in my review).

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/4] drm/bridge: dw-hdmi: add cec driver
Date: Wed, 02 Aug 2017 17:22:54 +0300	[thread overview]
Message-ID: <2270313.kliK1kl0Jl@avalon> (raw)
In-Reply-To: <f9cddb0a-ed24-d5a4-c85e-ee803cebcfdd@xs4all.nl>

Hi Hans,

On Wednesday 02 Aug 2017 15:34:33 Hans Verkuil wrote:
> On 08/02/17 15:27, Russell King - ARM Linux wrote:
> > On Wed, Aug 02, 2017 at 04:14:34PM +0300, Laurent Pinchart wrote:
> >> On Wednesday 02 Aug 2017 08:47:23 Hans Verkuil wrote:
> >>> On 08/02/2017 12:32 AM, Laurent Pinchart wrote:
> >>>>> +
> >>>>> +	cec_register_cec_notifier(cec->adap, cec->notify);
> >>>>> +
> >>>>> +	return 0;
> >>>>> +}
> >>>>> +
> >>>>> +static int dw_hdmi_cec_remove(struct platform_device *pdev)
> >>>>> +{
> >>>>> +	struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
> >>>>> +
> >>>>> +	cec_unregister_adapter(cec->adap);
> >>>>> +	cec_notifier_put(cec->notify);
> >>>>> +
> >>>>> +	return 0;
> >>>>> +}
> >>>>> +
> >>>>> +static struct platform_driver dw_hdmi_cec_driver = {
> >>>>> +	.probe	= dw_hdmi_cec_probe,
> >>>>> +	.remove	= dw_hdmi_cec_remove,
> >>>>> +	.driver = {
> >>>>> +		.name = "dw-hdmi-cec",
> >>>>> +	},
> >>>>> +};
> >>>>> +module_platform_driver(dw_hdmi_cec_driver);
> >>>> 
> >>>> Is there a particular reason why this has to be a separate module
> >>>> instead of simply calling the CEC init/cleanup functions directly from
> >>>> the main dw-hdmi driver ?
> >>> 
> >>> Not all SoCs that use dw-hdmi also use the dw-hdmi CEC implementation.
> >>> Some use their own implementation (amlogic).
> >> 
> >> Lovely. Of course we need to reinvent the wheel every time, where would
> >> the fun be otherwise ?
> >> 
> >>> So by implementing the cec-notifier in the dw-hdmi driver and keeping
> >>> dw-hdmi CEC separate you can easily choose whether or not you want to
> >>> use this CEC driver or another SoC CEC driver.
> >> 
> >> I'm certainly fine with such a split, but I don't think it requires a
> >> separate platform_driver. We could use a similar approach as with the
> >> HDMI PHY that can also differ between SoCs. The PHY is identified at
> >> runtime when possible, and the SoC-specific glue code can override that
> >> with a few data fields and function pointers.
> > 
> > Excuse me if I completely lose interest in reworking the driver at this
> > point, as it's enough of an effort to follow the churn in CEC from one
> > kernel version to another.  I'm not about to rewrite the driver and
> > restart the review cycle from scratch and then have several iterations
> > of having to update it as CEC continues to evolve.
> > 
> > Let's get this driver in mainline, and then if we want further changes
> > we can do that later.
> 
> +1
> 
> I also don't think the phy idea applies here. CEC implementations range from
> tightly coupled to the HDMI implementation to a completely independent i2c
> device that is unrelated to any HDMI receiver/transmitter. And various
> shades in between those extremes.

Then it should be even simpler. Instead of creating a separate platform device 
for the DW HDMI CEC, we can just call the DW HDMI CEC driver init/cleanup 
functions directly when the IP core implements CEC. When it doesn't, a 
separate device will be described in DT (at least to my understanding, 
otherwise where would it come from ?) and a separate driver would handle it.

> The only thing that is needed is that the CEC device needs to be informed
> when an EDID is read and when the hotplug disappears. The CEC notifier does
> just that and it is already in use, so it is nothing new. No need to rework
> this.

The notifier implementation in patch 1/4 looks good to me (except for the 
missing cec_notifier_put() call that I mentioned in my review).

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-08-02 14:22 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31 14:29 [PATCH v2 0/4] dw-hdmi CEC support Russell King - ARM Linux
2017-07-31 14:29 ` Russell King - ARM Linux
2017-07-31 14:29 ` [PATCH v2 1/4] drm/bridge: dw-hdmi: add cec notifier support Russell King
2017-07-31 14:29   ` Russell King
2017-07-31 14:33   ` Neil Armstrong
2017-07-31 14:33     ` Neil Armstrong
2017-07-31 15:25   ` Hans Verkuil
2017-07-31 15:25     ` Hans Verkuil
2017-08-04 13:36     ` Archit Taneja
2017-08-04 13:36       ` Archit Taneja
2017-08-05  9:23       ` Hans Verkuil
2017-08-05  9:23         ` Hans Verkuil
2017-08-07  3:59         ` Archit Taneja
2017-08-07  3:59           ` Archit Taneja
2017-08-02 14:11   ` Laurent Pinchart
2017-08-02 14:11     ` Laurent Pinchart
2017-08-02 14:17     ` Hans Verkuil
2017-08-02 14:17       ` Hans Verkuil
2017-08-02 17:44       ` Russell King - ARM Linux
2017-08-02 17:44         ` Russell King - ARM Linux
2017-07-31 14:29 ` [PATCH v2 2/4] drm/bridge: dw-hdmi: add better clock disable control Russell King
2017-07-31 14:29   ` Russell King
2017-07-31 15:26   ` Hans Verkuil
2017-07-31 15:26     ` Hans Verkuil
2017-08-04 13:39     ` Archit Taneja
2017-08-04 13:39       ` Archit Taneja
2017-07-31 14:29 ` [PATCH v2 3/4] drm/bridge: dw-hdmi: add cec driver Russell King
2017-07-31 14:29   ` Russell King
2017-07-31 15:35   ` Hans Verkuil
2017-07-31 15:35     ` Hans Verkuil
2017-08-01 22:32   ` Laurent Pinchart
2017-08-01 22:32     ` Laurent Pinchart
2017-08-02  6:47     ` Hans Verkuil
2017-08-02  6:47       ` Hans Verkuil
2017-08-02 13:14       ` Laurent Pinchart
2017-08-02 13:14         ` Laurent Pinchart
2017-08-02 13:27         ` Russell King - ARM Linux
2017-08-02 13:27           ` Russell King - ARM Linux
2017-08-02 13:34           ` Hans Verkuil
2017-08-02 13:34             ` Hans Verkuil
2017-08-02 14:22             ` Laurent Pinchart [this message]
2017-08-02 14:22               ` Laurent Pinchart
2017-08-02 17:43               ` Russell King - ARM Linux
2017-08-02 17:43                 ` Russell King - ARM Linux
2017-08-02 14:17         ` Neil Armstrong
2017-07-31 14:29 ` [PATCH v2 4/4] drm/bridge: dw-hdmi: remove CEC engine register definitions Russell King
2017-07-31 14:29   ` Russell King
2017-07-31 15:26   ` Hans Verkuil
2017-07-31 15:26     ` Hans Verkuil
2017-08-01 22:29 ` [PATCH v2 0/4] dw-hdmi CEC support Laurent Pinchart
2017-08-01 22:29   ` Laurent Pinchart

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=2270313.kliK1kl0Jl@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.