devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
To: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/exynos: Get HDMI version from device tree
Date: Mon, 07 Jan 2013 10:54:28 -1000	[thread overview]
Message-ID: <50EB3604.60209@firmworks.com> (raw)
In-Reply-To: <1357591415-17092-1-git-send-email-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

On 1/7/2013 10:43 AM, Sean Paul wrote:
> Add a property to the hdmi node so we can specify the HDMI version in
> the device tree instead of just defaulting to v1.4 with the existence of
> the dt node.
> 
> Signed-off-by: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  .../devicetree/bindings/drm/exynos/hdmi.txt        |    3 +++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   19 ++++++++++---------
>  2 files changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
> index 589edee..d1c7d91 100644
> --- a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
> +++ b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
> @@ -11,6 +11,8 @@ Required properties:
>  	c) pin function mode.
>  	d) optional flags and pull up/down.
>  	e) drive strength.
> +- samsung,supports-hdmi-1.4: Define if device supports HDMI v1.4
> +- samsung,supports-hdmi-1.3: Define if device supports HDMI v1.3

a) This seems pretty generic, not at all samsung-specific, as the HDMI
version numbering space is well-defined by the HDMI spec.

b) It would be better to make it an integer property whose value
encodes the version number, thus eliminating the need to add new
properties as new HDMI versions appear.

>  
>  Example:
>  
> @@ -19,4 +21,5 @@ Example:
>  		reg = <0x14530000 0x100000>;
>  		interrupts = <0 95 0>;
>  		hpd-gpio = <&gpx3 7 0xf 1 3>;
> +		samsung,supports-hdmi-1.4;
>  	};
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 2c46b6c..9834ae5 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -2444,7 +2444,6 @@ static struct platform_device_id hdmi_driver_types[] = {
>  static struct of_device_id hdmi_match_types[] = {
>  	{
>  		.compatible = "samsung,exynos5-hdmi",
> -		.data	= (void	*)HDMI_TYPE14,
>  	}, {
>  		/* end node */
>  	}
> @@ -2498,16 +2497,18 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, drm_hdmi_ctx);
>  
> -	if (dev->of_node) {
> -		const struct of_device_id *match;
> -		match = of_match_node(of_match_ptr(hdmi_match_types),
> -					pdev->dev.of_node);
> -		if (match == NULL)
> -			return -ENODEV;
> -		hdata->type = (enum hdmi_type)match->data;
> -	} else {
> +	if (!dev->of_node) {
>  		hdata->type = (enum hdmi_type)platform_get_device_id
>  					(pdev)->driver_data;
> +	} else if (of_get_property(dev->of_node, "samsung,supports-hdmi-1.4",
> +				NULL)) {
> +		hdata->type = HDMI_TYPE14;
> +	} else if (of_get_property(dev->of_node, "samsung,supports-hdmi-1.3",
> +				NULL)) {
> +		hdata->type = HDMI_TYPE13;
> +	} else {
> +		DRM_ERROR("Could not resolve HDMI version support\n");
> +		return -ENODEV;
>  	}
>  
>  	hdata->hpd_gpio = pdata->hpd_gpio;
> 

  parent reply	other threads:[~2013-01-07 20:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 20:43 [PATCH] drm/exynos: Get HDMI version from device tree Sean Paul
     [not found] ` <1357591415-17092-1-git-send-email-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-01-07 20:54   ` Mitch Bradley [this message]
     [not found]     ` <50EB3604.60209-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2013-01-07 21:12       ` Sean Paul
2013-01-08 16:45         ` Lucas Stach
2013-01-08 16:48           ` Sean Paul
     [not found]             ` <CAOw6vbLYZgAj6Rco1qDQUhqVs1b10fBL9F0Vq0LBUBo14KJLrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-08 18:01               ` Mitch Bradley
     [not found]                 ` <50EC5EDE.3030208-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2013-01-08 20:16                   ` [PATCH v2] " Sean Paul
     [not found]                     ` <1357676181-16728-1-git-send-email-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-01-08 22:56                       ` Stephen Warren
     [not found]                         ` <50ECA400.50007-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-29 16:10                           ` Sean Paul
     [not found]                             ` <CAOw6vbK_wJupFt0CG6Bw5y0=Wq4qAJ0HvMSATgyOt+fK+tqR6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-30  5:40                               ` Inki Dae
2013-01-29 20:04                           ` Sylwester Nawrocki
     [not found]                             ` <51082B6A.1010406-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-01-31  1:16                               ` Inki Dae
     [not found]                                 ` <CAAQKjZNR8EJ+UFRO3vgYLH9So_gHn0a8gAf1JKu250shGiJ4qQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-31  3:03                                   ` Stephen Warren
     [not found]                                     ` <5109DF18.6010202-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-31  4:52                                       ` Inki Dae
2013-01-31  6:22                                         ` Rahul Sharma
2013-01-31 15:04                                       ` Sean Paul
     [not found]                                         ` <CAOw6vbJtUQdDLNkhg3ZL10KaPK=wQRDxkVUUUqO_=W84sYHgzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-31 17:36                                           ` Stephen Warren
     [not found]                                             ` <510AAB94.6030406-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-01  2:30                                               ` Stephen Warren
2013-01-31 18:25                                           ` Olof Johansson
2013-01-07 22:32   ` [PATCH] " Stephen Warren
     [not found]     ` <50EB4D11.7000407-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-07 23:12       ` Sean Paul
     [not found]         ` <CAOw6vbKqVnDt7PH1JTtG1cujnfzNOeK-eHhebpX9WSytnhwmBg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-08 16:38           ` Stephen Warren
     [not found]             ` <50EC4B8F.1050802-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-08 16:43               ` Sean Paul

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=50EB3604.60209@firmworks.com \
    --to=wmb-d5eqfidgl7eakbo8gow8eq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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).