All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <tomasz.figa@gmail.com>
To: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Cc: Ajay Kumar <ajaykumar.rs@samsung.com>,
	linux-samsung-soc@vger.kernel.org, linux-fbdev@vger.kernel.org,
	jg1.han@samsung.com, devicetree-discuss@lists.ozlabs.org,
	FlorianSchandinat@gmx.de, thomas.ab@samsung.com
Subject: Re: [PATCH V5 1/2] video: exynos_dp: Add device tree support to DP driver
Date: Fri, 12 Oct 2012 21:54:48 +0000	[thread overview]
Message-ID: <1909932.BXc5ALaqMM@flatron> (raw)
In-Reply-To: <50788F25.2040003@gmail.com>

Dnia piątek, 12 października 2012 23:44:05 Sylwester Nawrocki pisze:
> On 10/12/2012 10:47 PM, Ajay Kumar wrote:
> > This patch enables device tree based discovery support for DP driver.
> > The driver is modified to handle platform data in both the cases:
> > with DT and non-DT.
> > 
> > Signed-off-by: Ajay Kumar<ajaykumar.rs@samsung.com>
> > Acked-by: Jingoo Han<jg1.han@samsung.com>
> > ---
> > 
> >   drivers/video/exynos/exynos_dp_core.c |  161
> >   ++++++++++++++++++++++++++++++---
> >   drivers/video/exynos/exynos_dp_core.h |    2 +
> >   2 files changed, 149 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/video/exynos/exynos_dp_core.c
> > b/drivers/video/exynos/exynos_dp_core.c index d55470e..62932ba 100644
> > --- a/drivers/video/exynos/exynos_dp_core.c
> > +++ b/drivers/video/exynos/exynos_dp_core.c
> > @@ -18,6 +18,7 @@
> > 
> >   #include<linux/io.h>
> >   #include<linux/interrupt.h>
> >   #include<linux/delay.h>
> > 
> > +#include<linux/of.h>
> > 
> >   #include<video/exynos_dp.h>
> > 
> > @@ -856,6 +857,99 @@ static irqreturn_t exynos_dp_irq_handler(int irq,
> > void *arg)> 
> >   	return IRQ_HANDLED;
> >   
> >   }
> > 
> > +#ifdef CONFIG_OF
> > +struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device
> > *dev)
> > +{
> > +	struct device_node *dp_node = dev->of_node;
> > +	struct exynos_dp_platdata *pd;
> > +	struct video_info *dp_video_config;
> > +
> > +	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
> > +	if (!pd) {
> > +		dev_err(dev, "memory allocation for pdata failed\n");
> > +		return ERR_PTR(-ENOMEM);
> > +	}
> > +	dp_video_config = devm_kzalloc(dev,
> > +				sizeof(*dp_video_config), GFP_KERNEL);
> > +
> > +	if (!dp_video_config) {
> > +		dev_err(dev, "memory allocation for video config failed\n");
> > +		return ERR_PTR(-ENOMEM);
> > +	}
> > +	pd->video_info = dp_video_config;
> > +
> > +	if (of_get_property(dp_node, "hsync-active-high", NULL))
> > +		dp_video_config->h_sync_polarity = 1;
> > +
> > +	if (of_get_property(dp_node, "vsync-active-high", NULL))
> > +		dp_video_config->v_sync_polarity = 1;
> > +
> > +	if (of_get_property(dp_node, "interlaced", NULL))
> > +		dp_video_config->interlaced = 1;
> 
> of_property_read_bool() could also be used here.

Wouldn't it make the property mandatory?

I would just use of_find_property here, instead of of_get_property.

Best regards,
Tomasz Figa


WARNING: multiple messages have this Message-ID (diff)
From: Tomasz Figa <tomasz.figa@gmail.com>
To: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Cc: Ajay Kumar <ajaykumar.rs@samsung.com>,
	linux-samsung-soc@vger.kernel.org, linux-fbdev@vger.kernel.org,
	jg1.han@samsung.com, devicetree-discuss@lists.ozlabs.org,
	FlorianSchandinat@gmx.de, thomas.ab@samsung.com
Subject: Re: [PATCH V5 1/2] video: exynos_dp: Add device tree support to DP driver
Date: Fri, 12 Oct 2012 23:54:48 +0200	[thread overview]
Message-ID: <1909932.BXc5ALaqMM@flatron> (raw)
In-Reply-To: <50788F25.2040003@gmail.com>

Dnia piątek, 12 października 2012 23:44:05 Sylwester Nawrocki pisze:
> On 10/12/2012 10:47 PM, Ajay Kumar wrote:
> > This patch enables device tree based discovery support for DP driver.
> > The driver is modified to handle platform data in both the cases:
> > with DT and non-DT.
> > 
> > Signed-off-by: Ajay Kumar<ajaykumar.rs@samsung.com>
> > Acked-by: Jingoo Han<jg1.han@samsung.com>
> > ---
> > 
> >   drivers/video/exynos/exynos_dp_core.c |  161
> >   ++++++++++++++++++++++++++++++---
> >   drivers/video/exynos/exynos_dp_core.h |    2 +
> >   2 files changed, 149 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/video/exynos/exynos_dp_core.c
> > b/drivers/video/exynos/exynos_dp_core.c index d55470e..62932ba 100644
> > --- a/drivers/video/exynos/exynos_dp_core.c
> > +++ b/drivers/video/exynos/exynos_dp_core.c
> > @@ -18,6 +18,7 @@
> > 
> >   #include<linux/io.h>
> >   #include<linux/interrupt.h>
> >   #include<linux/delay.h>
> > 
> > +#include<linux/of.h>
> > 
> >   #include<video/exynos_dp.h>
> > 
> > @@ -856,6 +857,99 @@ static irqreturn_t exynos_dp_irq_handler(int irq,
> > void *arg)> 
> >   	return IRQ_HANDLED;
> >   
> >   }
> > 
> > +#ifdef CONFIG_OF
> > +struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device
> > *dev)
> > +{
> > +	struct device_node *dp_node = dev->of_node;
> > +	struct exynos_dp_platdata *pd;
> > +	struct video_info *dp_video_config;
> > +
> > +	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
> > +	if (!pd) {
> > +		dev_err(dev, "memory allocation for pdata failed\n");
> > +		return ERR_PTR(-ENOMEM);
> > +	}
> > +	dp_video_config = devm_kzalloc(dev,
> > +				sizeof(*dp_video_config), GFP_KERNEL);
> > +
> > +	if (!dp_video_config) {
> > +		dev_err(dev, "memory allocation for video config failed\n");
> > +		return ERR_PTR(-ENOMEM);
> > +	}
> > +	pd->video_info = dp_video_config;
> > +
> > +	if (of_get_property(dp_node, "hsync-active-high", NULL))
> > +		dp_video_config->h_sync_polarity = 1;
> > +
> > +	if (of_get_property(dp_node, "vsync-active-high", NULL))
> > +		dp_video_config->v_sync_polarity = 1;
> > +
> > +	if (of_get_property(dp_node, "interlaced", NULL))
> > +		dp_video_config->interlaced = 1;
> 
> of_property_read_bool() could also be used here.

Wouldn't it make the property mandatory?

I would just use of_find_property here, instead of of_get_property.

Best regards,
Tomasz Figa

  reply	other threads:[~2012-10-12 21:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 11:18 [PATCH V5 1/2] video: exynos_dp: Add device tree support to DP driver Ajay Kumar
2012-10-12 20:47 ` Ajay Kumar
2012-10-12 11:19 ` [PATCH V5 2/2] video: exynos_dp: device tree documentation Ajay Kumar
2012-10-12 20:47   ` Ajay Kumar
2012-10-15  6:13   ` Jingoo Han
2012-10-15  6:13     ` Jingoo Han
2012-10-12 21:44 ` [PATCH V5 1/2] video: exynos_dp: Add device tree support to DP driver Sylwester Nawrocki
2012-10-12 21:44   ` Sylwester Nawrocki
2012-10-12 21:54   ` Tomasz Figa [this message]
2012-10-12 21:54     ` Tomasz Figa
2012-10-12 22:14     ` Sylwester Nawrocki
2012-10-12 22:14       ` Sylwester Nawrocki
2012-10-12 22:22       ` Tomasz Figa
2012-10-12 22:22         ` Tomasz Figa
2012-10-15  8:14   ` Jingoo Han
2012-10-15  8:14     ` Jingoo Han
2012-10-15 21:14     ` Sylwester Nawrocki
2012-10-15 21:14       ` Sylwester Nawrocki
2012-10-16  2:02       ` Jingoo Han
2012-10-16  2:02         ` Jingoo Han
2012-10-16 11:07         ` Sylwester Nawrocki
2012-10-16 11:07           ` Sylwester Nawrocki

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=1909932.BXc5ALaqMM@flatron \
    --to=tomasz.figa@gmail.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=ajaykumar.rs@samsung.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=thomas.ab@samsung.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 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.