All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	Tomasz Stanislawski <t.stanislaws@samsung.com>,
	"kgene.kim" <kgene.kim@samsung.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	InKi Dae <inki.dae@samsung.com>,
	Sylwester Nawrocki <sylvester.nawrocki@gmail.com>,
	Olof Johansson <olofj@chromium.org>,
	RAHUL SHARMA <rahul.sharma@samsung.com>
Subject: Re: [PATCH v3 1/3] drm/exynos: Get HDMI version from device tree
Date: Tue, 5 Feb 2013 16:37:42 -0800	[thread overview]
Message-ID: <CAOw6vb+W3phFDJXp3gCx7y0N7mF4o2DpEfTGuNT1pGdKqiCGTg@mail.gmail.com> (raw)
In-Reply-To: <5111A23F.50300@wwwdotorg.org>

On Tue, Feb 5, 2013 at 4:22 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> n 02/05/2013 04:42 PM, Sean Paul wrote:
>> Use the compatible string in the device tree to determine which
>> registers/functions to use in the HDMI driver. Also changes the
>> references from v13 to 4210 and v14 to 4212 to reflect the IP
>> block version instead of the HDMI version.
>
>> diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
>
> Binding looks sane to me.
>
>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>
>>  #ifdef CONFIG_OF
>>  static struct of_device_id hdmi_match_types[] = {
>>       {
>> -             .compatible = "samsung,exynos5-hdmi",
>> -             .data   = (void *)HDMI_TYPE14,
>> +             .compatible = "samsung,exynos4-hdmi",
>>       }, {
>>               /* end node */
>>       }
>
> Why not fill in all the "base" compatible values there (I think you need
> this anyway so that DTs don't all have to be compatible with
> samsung,exynos4-hdmi), with .data containing the HDMI_VER_EXYNOS*
> values, then ...
>

At the moment, all DTs have to be compatible with exynos4-hdmi since
it provides the base for the current driver. The driver uses 4210 and
4212 to differentiate between different register addresses and
features, but most things are just exynos4-hdmi compatible.

>> @@ -2218,17 +2217,18 @@ static int hdmi_probe(struct platform_device *pdev)
>
>> +
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos4210-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS4210;
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos4212-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS4212;
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos5250-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS5250;
>
> Instead of that, do roughly:
>
>     match = of_match_device(hdmi_match_types, &pdev->dev);
>     if (match)
>         hdata->version |= (int)match->data;
>
> That way, it's all table-based. Any future additions to
> hdmi_match_types[] won't require another if statement to be added to
> probe().

I don't think it's that easy. of_match_device returns the first match
from the device table, so I'd still need to iterate through the
matches. I could still break this out into a table, but I don't think
of_match_device is the right way to probe it.

Sean

WARNING: multiple messages have this Message-ID
From: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Tomasz Stanislawski
	<t.stanislaws-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"kgene.kim" <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Tomasz Figa <tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	InKi Dae <inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Sylwester Nawrocki
	<sylvester.nawrocki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Olof Johansson <olofj-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	RAHUL SHARMA
	<rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH v3 1/3] drm/exynos: Get HDMI version from device tree
Date: Tue, 5 Feb 2013 16:37:42 -0800	[thread overview]
Message-ID: <CAOw6vb+W3phFDJXp3gCx7y0N7mF4o2DpEfTGuNT1pGdKqiCGTg@mail.gmail.com> (raw)
In-Reply-To: <5111A23F.50300-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>

On Tue, Feb 5, 2013 at 4:22 PM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
> n 02/05/2013 04:42 PM, Sean Paul wrote:
>> Use the compatible string in the device tree to determine which
>> registers/functions to use in the HDMI driver. Also changes the
>> references from v13 to 4210 and v14 to 4212 to reflect the IP
>> block version instead of the HDMI version.
>
>> diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
>
> Binding looks sane to me.
>
>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>
>>  #ifdef CONFIG_OF
>>  static struct of_device_id hdmi_match_types[] = {
>>       {
>> -             .compatible = "samsung,exynos5-hdmi",
>> -             .data   = (void *)HDMI_TYPE14,
>> +             .compatible = "samsung,exynos4-hdmi",
>>       }, {
>>               /* end node */
>>       }
>
> Why not fill in all the "base" compatible values there (I think you need
> this anyway so that DTs don't all have to be compatible with
> samsung,exynos4-hdmi), with .data containing the HDMI_VER_EXYNOS*
> values, then ...
>

At the moment, all DTs have to be compatible with exynos4-hdmi since
it provides the base for the current driver. The driver uses 4210 and
4212 to differentiate between different register addresses and
features, but most things are just exynos4-hdmi compatible.

>> @@ -2218,17 +2217,18 @@ static int hdmi_probe(struct platform_device *pdev)
>
>> +
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos4210-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS4210;
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos4212-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS4212;
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos5250-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS5250;
>
> Instead of that, do roughly:
>
>     match = of_match_device(hdmi_match_types, &pdev->dev);
>     if (match)
>         hdata->version |= (int)match->data;
>
> That way, it's all table-based. Any future additions to
> hdmi_match_types[] won't require another if statement to be added to
> probe().

I don't think it's that easy. of_match_device returns the first match
from the device table, so I'd still need to iterate through the
matches. I could still break this out into a table, but I don't think
of_match_device is the right way to probe it.

Sean

WARNING: multiple messages have this Message-ID
From: seanpaul@chromium.org (Sean Paul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/3] drm/exynos: Get HDMI version from device tree
Date: Tue, 5 Feb 2013 16:37:42 -0800	[thread overview]
Message-ID: <CAOw6vb+W3phFDJXp3gCx7y0N7mF4o2DpEfTGuNT1pGdKqiCGTg@mail.gmail.com> (raw)
In-Reply-To: <5111A23F.50300@wwwdotorg.org>

On Tue, Feb 5, 2013 at 4:22 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> n 02/05/2013 04:42 PM, Sean Paul wrote:
>> Use the compatible string in the device tree to determine which
>> registers/functions to use in the HDMI driver. Also changes the
>> references from v13 to 4210 and v14 to 4212 to reflect the IP
>> block version instead of the HDMI version.
>
>> diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
>
> Binding looks sane to me.
>
>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>
>>  #ifdef CONFIG_OF
>>  static struct of_device_id hdmi_match_types[] = {
>>       {
>> -             .compatible = "samsung,exynos5-hdmi",
>> -             .data   = (void *)HDMI_TYPE14,
>> +             .compatible = "samsung,exynos4-hdmi",
>>       }, {
>>               /* end node */
>>       }
>
> Why not fill in all the "base" compatible values there (I think you need
> this anyway so that DTs don't all have to be compatible with
> samsung,exynos4-hdmi), with .data containing the HDMI_VER_EXYNOS*
> values, then ...
>

At the moment, all DTs have to be compatible with exynos4-hdmi since
it provides the base for the current driver. The driver uses 4210 and
4212 to differentiate between different register addresses and
features, but most things are just exynos4-hdmi compatible.

>> @@ -2218,17 +2217,18 @@ static int hdmi_probe(struct platform_device *pdev)
>
>> +
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos4210-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS4210;
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos4212-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS4212;
>> +     if (of_device_is_compatible(dev->of_node, "samsung,exynos5250-hdmi"))
>> +             hdata->version |= HDMI_VER_EXYNOS5250;
>
> Instead of that, do roughly:
>
>     match = of_match_device(hdmi_match_types, &pdev->dev);
>     if (match)
>         hdata->version |= (int)match->data;
>
> That way, it's all table-based. Any future additions to
> hdmi_match_types[] won't require another if statement to be added to
> probe().

I don't think it's that easy. of_match_device returns the first match
from the device table, so I'd still need to iterate through the
matches. I could still break this out into a table, but I don't think
of_match_device is the right way to probe it.

Sean

  reply	other threads:[~2013-02-06  0:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05 23:42 [PATCH v3 0/2] Get the HDMI IP block " Sean Paul
2013-02-05 23:42 ` Sean Paul
2013-02-05 23:42 ` [PATCH v3 1/3] drm/exynos: Get HDMI " Sean Paul
2013-02-05 23:42   ` Sean Paul
2013-02-06  0:22   ` Stephen Warren
2013-02-06  0:22     ` Stephen Warren
2013-02-06  0:37     ` Sean Paul [this message]
2013-02-06  0:37       ` Sean Paul
2013-02-06  0:37       ` Sean Paul
2013-02-06  0:42       ` Stephen Warren
2013-02-06  0:42         ` Stephen Warren
2013-02-06  0:47         ` Kyungmin Park
2013-02-06  0:47           ` Kyungmin Park
2013-02-06  0:56         ` Sean Paul
2013-02-06  0:56           ` Sean Paul
2013-02-06  1:48           ` Joonyoung Shim
2013-02-06  1:48             ` Joonyoung Shim
2013-02-06  2:49           ` Stephen Warren
2013-02-06  2:49             ` Stephen Warren
2013-02-06  2:56           ` 김승우
2013-02-06  2:56             ` 김승우
2013-02-06 19:01             ` Olof Johansson
2013-02-06 19:01               ` Olof Johansson
2013-02-05 23:42 ` [PATCH v3 2/3] ARM: Change exynos5-hdmi references to exynos4-hdmi Sean Paul
2013-02-05 23:42   ` 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=CAOw6vb+W3phFDJXp3gCx7y0N7mF4o2DpEfTGuNT1pGdKqiCGTg@mail.gmail.com \
    --to=seanpaul@chromium.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=olofj@chromium.org \
    --cc=rahul.sharma@samsung.com \
    --cc=swarren@wwwdotorg.org \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=t.stanislaws@samsung.com \
    --cc=tomasz.figa@gmail.com \
    --subject='Re: [PATCH v3 1/3] drm/exynos: Get HDMI version from device tree' \
    /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

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.