devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	devicetree-discuss@lists.ozlabs.org, k.debski@samsung.com,
	inki.dae@samsung.com, ajaykumar.rs@samsung.com,
	patches@linaro.org, s.nawrocki@samsung.com
Subject: Re: [PATCH 1/2] [media] s5p-g2d: Add DT based discovery support
Date: Wed, 30 Jan 2013 22:38:32 +0100	[thread overview]
Message-ID: <510992D8.9030800@gmail.com> (raw)
In-Reply-To: <1359107722-9974-1-git-send-email-sachin.kamat@linaro.org>

Hi Sachin,

On 01/25/2013 10:55 AM, Sachin Kamat wrote:
> This patch adds device tree based discovery support to G2D driver
>
> Signed-off-by: Sachin Kamat<sachin.kamat@linaro.org>
> ---
>   drivers/media/platform/s5p-g2d/g2d.c |   17 ++++++++++++++++-
>   1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
> index 7e41529..210e142 100644
> --- a/drivers/media/platform/s5p-g2d/g2d.c
> +++ b/drivers/media/platform/s5p-g2d/g2d.c
> @@ -18,6 +18,7 @@
>   #include<linux/slab.h>
>   #include<linux/clk.h>
>   #include<linux/interrupt.h>
> +#include<linux/of.h>
>
>   #include<linux/platform_device.h>
>   #include<media/v4l2-mem2mem.h>
> @@ -796,7 +797,8 @@ static int g2d_probe(struct platform_device *pdev)
>   	}
>
>   	def_frame.stride = (def_frame.width * def_frame.fmt->depth)>>  3;
> -	dev->variant = g2d_get_drv_data(pdev);
> +	if (!pdev->dev.of_node)
> +		dev->variant = g2d_get_drv_data(pdev);

Don' you need something like:

	else {
		of_id = of_match_node(exynos_g2d_match, pdev->dev.of_node);
		if (!of_id)
			return -ENODEV;
		dev->variant = (struct g2d_variant *)of_id->data;
	}
?

Otherwise dev->variant is left uninitialized...?

>   	return 0;
>
> @@ -844,6 +846,18 @@ static struct g2d_variant g2d_drvdata_v4x = {
>   	.hw_rev = TYPE_G2D_4X, /* Revision 4.1 for Exynos4X12 and Exynos5 */
>   };
>
> +static const struct of_device_id exynos_g2d_match[] = {
> +	{
> +		.compatible = "samsung,g2d-v3",
> +		.data =&g2d_drvdata_v3x,
> +	}, {
> +		.compatible = "samsung,g2d-v41",
> +		.data =&g2d_drvdata_v4x,

Didn't you consider adding "exynos" to these compatible strings ?
I'm afraid g2d may be too generic.

> +	},
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, exynos_g2d_match);
> +
>   static struct platform_device_id g2d_driver_ids[] = {
>   	{
>   		.name = "s5p-g2d",
> @@ -863,6 +877,7 @@ static struct platform_driver g2d_pdrv = {
>   	.driver		= {
>   		.name = G2D_NAME,
>   		.owner = THIS_MODULE,
> +		.of_match_table = of_match_ptr(exynos_g2d_match),

of_match_ptr() could be dropped, since exynos_g2d_match[] is
always compiled in.

--

Thanks,
Sylwester

  parent reply	other threads:[~2013-01-30 21:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25  9:55 [PATCH 1/2] [media] s5p-g2d: Add DT based discovery support Sachin Kamat
2013-01-25  9:55 ` [PATCH 2/2] drm/exynos: Add device tree based discovery support for G2D Sachin Kamat
2013-01-30  8:50   ` Inki Dae
2013-01-30 20:51     ` Sylwester Nawrocki
2013-01-31  1:30       ` Inki Dae
2013-01-31 23:47         ` Sylwester Nawrocki
2013-02-01  0:15           ` Kukjin Kim
2013-02-01  1:27             ` Inki Dae
2013-02-01  2:26               ` Stephen Warren
2013-02-01  8:33               ` Sachin Kamat
     [not found]                 ` <CAK9yfHxqqumg-oqH_Ku8Zkf8biWVknF91Su0VkWJJXjvWQ3Jhw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-01 10:54                   ` Sylwester Nawrocki
2013-02-01 11:12                     ` Sachin Kamat
2013-02-01 11:32                       ` Inki Dae
2013-02-01 11:40                         ` Sachin Kamat
2013-02-01 11:52                           ` Inki Dae
2013-02-01 12:58                             ` Inki Dae
     [not found]                               ` <E382E0B5-2695-4293-B264-FB4C54FE4F9D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-04 12:04                                 ` Sachin Kamat
2013-02-05  3:03                                   ` Inki Dae
2013-02-05  4:21                                     ` Kyungmin Park
2013-02-05  7:56                                     ` 김승우
2013-02-05  8:32                                     ` Joonyoung Shim
2013-02-05  9:33                                     ` Sylwester Nawrocki
2013-02-06  4:14                                       ` Sachin Kamat
2013-02-01 17:35                     ` Kukjin Kim
2013-02-01 18:06                     ` Kukjin Kim
2013-01-30 21:38 ` Sylwester Nawrocki [this message]
2013-01-31  6:29   ` [PATCH 1/2] [media] s5p-g2d: Add DT based discovery support Sachin Kamat

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=510992D8.9030800@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=ajaykumar.rs@samsung.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=k.debski@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sachin.kamat@linaro.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).