Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH] backlight: check null deference of name when device is registered
From: Andrew Morton @ 2013-01-08  1:35 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'LKML', linux-fbdev, 'Richard Purdie',
	'Devendra Naga'
In-Reply-To: <003c01cded3f$0f25a3e0$2d70eba0$%han@samsung.com>

On Tue, 08 Jan 2013 10:25:35 +0900 Jingoo Han <jg1.han@samsung.com> wrote:

> On Tuesday, January 08, 2013 9:02 AM, Andrew Morton wrote
> > On Fri, 04 Jan 2013 17:29:11 +0900
> > Jingoo Han <jg1.han@samsung.com> wrote:
> > 
> > > NULL deference of name is checked when device is registered.
> > > If the name is null, it will cause a kernel oops in dev_set_name().
> > >
> > > ...
> > >
> > > --- a/drivers/video/backlight/backlight.c
> > > +++ b/drivers/video/backlight/backlight.c
> > > @@ -292,6 +292,11 @@ struct backlight_device *backlight_device_register(const char *name,
> > >  	struct backlight_device *new_bd;
> > >  	int rc;
> > >
> > > +	if (name = NULL) {
> > > +		pr_err("backlight name is null\n");
> > > +		return ERR_PTR(-EINVAL);
> > > +	}
> > > +
> > >  	pr_debug("backlight_device_register: name=%s\n", name);
> > 
> > I don't understand this.
> > 
> > Is there some driver which is calling these functions with name=NULL?
> > If so, which one(s)?
> 
> No, there is no one.
> 
> > 
> > If "no" then why don't we declare that "passing name=NULL is a bug" and
> > leave the code as-is?
> 
> Do you mean following?
> 
> +	if (name = NULL)
> +		pr_err("passing name=NULL is a bug");
> +
>   	pr_debug("backlight_device_register: name=%s\n", name);

Nope; I'm suggesting we leave the code alone.  If someone passes in
NULL they will get a nice oops and their bug will then get fixed.


^ permalink raw reply

* Re: [PATCH] backlight: check null deference of name when device is registered
From: Jingoo Han @ 2013-01-08  1:25 UTC (permalink / raw)
  To: 'Andrew Morton'
  Cc: 'LKML', linux-fbdev, 'Richard Purdie',
	'Devendra Naga', 'Jingoo Han'
In-Reply-To: <20130107160137.dec5098a.akpm@linux-foundation.org>

On Tuesday, January 08, 2013 9:02 AM, Andrew Morton wrote
> On Fri, 04 Jan 2013 17:29:11 +0900
> Jingoo Han <jg1.han@samsung.com> wrote:
> 
> > NULL deference of name is checked when device is registered.
> > If the name is null, it will cause a kernel oops in dev_set_name().
> >
> > ...
> >
> > --- a/drivers/video/backlight/backlight.c
> > +++ b/drivers/video/backlight/backlight.c
> > @@ -292,6 +292,11 @@ struct backlight_device *backlight_device_register(const char *name,
> >  	struct backlight_device *new_bd;
> >  	int rc;
> >
> > +	if (name = NULL) {
> > +		pr_err("backlight name is null\n");
> > +		return ERR_PTR(-EINVAL);
> > +	}
> > +
> >  	pr_debug("backlight_device_register: name=%s\n", name);
> 
> I don't understand this.
> 
> Is there some driver which is calling these functions with name=NULL?
> If so, which one(s)?

No, there is no one.

> 
> If "no" then why don't we declare that "passing name=NULL is a bug" and
> leave the code as-is?

Do you mean following?

+	if (name = NULL)
+		pr_err("passing name=NULL is a bug");
+
  	pr_debug("backlight_device_register: name=%s\n", name);


Best regards,
Jingoo Han




^ permalink raw reply

* [PATCH] video: mxsfb: Fix build warnings with W=1
From: Fabio Estevam @ 2013-01-08  1:19 UTC (permalink / raw)
  To: linux-fbdev

From: Fabio Estevam <fabio.estevam@freescale.com>

Fix the following warnings when building with W=1 option:

drivers/video/mxsfb.c: In function 'mxsfb_set_par':
drivers/video/mxsfb.c:389:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/video/mxsfb.c: In function 'mxsfb_restore_mode':
drivers/video/mxsfb.c:592:11: warning: variable 'line_count' set but not used [-Wunused-but-set-variable]
drivers/video/mxsfb.c: In function 'mxsfb_probe':
drivers/video/mxsfb.c:867:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/video/mxsfb.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index a45b37c..47c92a2 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -380,7 +380,7 @@ static int mxsfb_set_par(struct fb_info *fb_info)
 {
 	struct mxsfb_info *host = to_imxfb_host(fb_info);
 	u32 ctrl, vdctrl0, vdctrl4;
-	int line_size, fb_size;
+	u32 line_size, fb_size;
 	int reenable = 0;
 
 	line_size =  fb_info->var.xres * (fb_info->var.bits_per_pixel >> 3);
@@ -589,7 +589,6 @@ static struct fb_ops mxsfb_ops = {
 static int mxsfb_restore_mode(struct mxsfb_info *host)
 {
 	struct fb_info *fb_info = &host->fb_info;
-	unsigned line_count;
 	unsigned period;
 	unsigned long pa, fbsize;
 	int bits_per_pixel, ofs;
@@ -668,7 +667,6 @@ static int mxsfb_restore_mode(struct mxsfb_info *host)
 		writel(fb_info->fix.smem_start, host->base + host->devdata->next_buf);
 	}
 
-	line_count = fb_info->fix.smem_len / fb_info->fix.line_length;
 	fb_info->fix.ypanstep = 1;
 
 	clk_prepare_enable(host->clk);
@@ -784,7 +782,8 @@ static int mxsfb_probe(struct platform_device *pdev)
 	struct pinctrl *pinctrl;
 	int panel_enable;
 	enum of_gpio_flags flags;
-	int i, ret;
+	int ret;
+	u32 i;
 
 	if (of_id)
 		pdev->id_entry = of_id->data;
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH] backlight: check null deference of name when device is registered
From: Andrew Morton @ 2013-01-08  0:01 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'LKML', linux-fbdev, 'Richard Purdie',
	'Devendra Naga'
In-Reply-To: <000b01cdea55$92725aa0$b7570fe0$%han@samsung.com>

On Fri, 04 Jan 2013 17:29:11 +0900
Jingoo Han <jg1.han@samsung.com> wrote:

> NULL deference of name is checked when device is registered.
> If the name is null, it will cause a kernel oops in dev_set_name().
> 
> ...
>
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -292,6 +292,11 @@ struct backlight_device *backlight_device_register(const char *name,
>  	struct backlight_device *new_bd;
>  	int rc;
>  
> +	if (name = NULL) {
> +		pr_err("backlight name is null\n");
> +		return ERR_PTR(-EINVAL);
> +	}
> +
>  	pr_debug("backlight_device_register: name=%s\n", name);

I don't understand this.

Is there some driver which is calling these functions with name=NULL? 
If so, which one(s)?

If "no" then why don't we declare that "passing name=NULL is a bug" and
leave the code as-is?


^ permalink raw reply

* Re: [PATCHv16 5/7] fbmon: add of_videomode helpers
From: Rob Clark @ 2013-01-07 20:06 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: Steffen Trumtrar, devicetree-discuss@lists.ozlabs.org,
	linux-fbdev@vger.kernel.org, David Airlie,
	Florian Tobias Schandinat, dri-devel@lists.freedesktop.org,
	Valkeinen, Tomi, Laurent Pinchart, kernel@pengutronix.de,
	Guennady Liakhovetski, linux-media@vger.kernel.org
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A93EA7FBF7@DBDE01.ent.ti.com>

On Mon, Jan 7, 2013 at 2:46 AM, Mohammed, Afzal <afzal@ti.com> wrote:
> Hi Steffen,
>
> On Mon, Jan 07, 2013 at 13:36:48, Steffen Trumtrar wrote:
>> On Mon, Jan 07, 2013 at 06:10:13AM +0000, Mohammed, Afzal wrote:
>
>> > This breaks DaVinci (da8xx_omapl_defconfig), following change was
>> > required to get it build if OF_VIDEOMODE or/and FB_MODE_HELPERS
>> > is not defined. There may be better solutions, following was the
>> > one that was used by me to test this series.
>
>> I just did a quick "make da8xx_omapl_defconfig && make" and it builds just fine.
>> On what version did you apply the series?
>> At the moment I have the series sitting on 3.7. Didn't try any 3.8-rcx yet.
>> But fixing this shouldn't be a problem.
>
> You are right, me idiot, error will happen only upon try to make use of
> of_get_fb_videomode() (defined in this patch) in the da8xx-fb driver
> (with da8xx_omapl_defconfig), to be exact upon adding,
>
> "video: da8xx-fb: obtain fb_videomode info from dt" of my patch series.
>
> The change as I mentioned or something similar would be required as
> any driver that is going to make use of of_get_fb_videomode() would
> break if CONFIG_OF_VIDEOMODE or CONFIG_FB_MODE_HELPERS is not defined.

Shouldn't the driver that depends on CONFIG_OF_VIDEOMODE and
CONFIG_FB_MODE_HELPERS, explicitly select them?  I don't really see
the point of having the static-inline fallbacks.

fwiw, using 'select' is what I was doing for lcd panel support for
lcdc/da8xx drm driver (which was using the of videomode helpers,
albeit a slightly earlier version of the patches):

https://github.com/robclark/kernel-omap4/commit/e2aef5f281348afaaaeaa132699efc2831aa8384

BR,
-R

>
> And testing was done over v3.8-rc2.
>
>> > > +#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
>> >
>> > As _OF_VIDEOMODE is a bool type CONFIG, isn't,
>> >
>> > #ifdef CONFIG_OF_VIDEOMODE
>> >
>> > sufficient ?
>> >
>>
>> Yes, that is right. But I think IS_ENABLED is the preferred way to do it, isn't it?
>
> Now I realize it is.
>
> Regards
> Afzal

^ permalink raw reply

* Re: [PATCH] video: ssd1307fb: Fix bit order bug in the byte translation function
From: Maxime Ripard @ 2013-01-07 16:06 UTC (permalink / raw)
  To: linux-fbdev

Hi,

Le 18/12/2012 14:49, Maxime Ripard (by way of Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>) a écrit :
> This was leading to a strange behaviour when using the fbcon driver on
> top of this one: the letter were in the right order, but each letter was
> having a vertical symmetry.
> 
> This was because the addressing was right for the byte, but the
> addressing of each individual bit was inverted.

I'd really like to see this patch merged into one of 3.8-rc's.

Is this ok for you?

-- 
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply

* RE: [PATCH] da8xx: Allow use by am33xx based devices
From: Mohammed, Afzal @ 2013-01-07 12:03 UTC (permalink / raw)
  To: Hiremath, Vaibhav, Manjunathappa, Prakash
  Cc: Valkeinen, Tomi, davinci-linux-open-source@linux.davincidsp.com,
	Porter, Matt, linux-fbdev@vger.kernel.org,
	FlorianSchandinat@gmx.de, Koen Kooi, Pantelis Antoniou,
	linux-kernel@vger.kernel.org, Dill, Russ,
	linux-omap@vger.kernel.org
In-Reply-To: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WRz
IHRvIGJlIHNlbGVjdGVkIG9yIG5vdC4NCg0KUmVnYXJkcw0KQWZ6YWwNCg=

^ permalink raw reply

* RE: [PATCH 08/10] video: da8xx-fb: obtain fb_videomode info from dt
From: Mohammed, Afzal @ 2013-01-07  9:21 UTC (permalink / raw)
  To: Steffen Trumtrar
  Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Florian Tobias Schandinat,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Nori, Sekhar,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring,
	Valkeinen, Tomi,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20130107091131.GC23478-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

SGkgU3RlZmZlbiwNCg0KT24gTW9uLCBKYW4gMDcsIDIwMTMgYXQgMTQ6NDE6MzEsIFN0ZWZmZW4g
VHJ1bXRyYXIgd3JvdGU6DQo+IE9uIE1vbiwgSmFuIDA3LCAyMDEzIGF0IDEwOjQxOjMwQU0gKzA1
MzAsIEFmemFsIE1vaGFtbWVkIHdyb3RlOg0KDQo+ID4gT2J0YWluIGZiX3ZpZGVvbW9kZSBkZXRh
aWxzIGZvciB0aGUgY29ubmVjdGVkIGxjZCBwYW5lbCB1c2luZyB0aGUNCj4gPiBkaXNwbGF5IHRp
bWluZyBkZXRhaWxzIHByZXNlbnQgaW4gRFQuDQoNCj4gPiArLSBkaXNwbGF5LXRpbWluZ3M6IGxp
c3Qgb2YgZGlmZmVyZW50IHZpZGVvbW9kZXMgc3VwcG9ydGVkIGJ5IHRoZSBsY2QNCj4gPiArICBw
YW5lbCwgcmVwcmVzZW50ZWQgYXMgY2hpbGRzLCBjYW4gaGF2ZSBtdWx0aXBsZSBtb2RlcyBzdXBw
b3J0ZWQsIGlmDQo+ID4gKyAgb25seSBvbmUsIHRoZW4gaXQgaXMgY29uc2lkZXJlZCBuYXRpdmUg
bW9kZSwgaWYgbXVsdGlwbGUgbW9kZXMgYXJlDQo+ID4gKyAgcHJvdmlkZWQsIG5hdGl2ZSBtb2Rl
IGNhbiBiZSBzZXQgZXhwbGljaXRseSwgbW9yZSBkZXRhaWxzIGF2YWlsYWJsZQ0KPiA+ICsgIEBE
b2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmluZGluZ3MvdmlkZW8vZGlzcGxheS10aW1pbmcudHh0
DQoNCj4gS2VlcCBpbiBtaW5kIHRoYXQgdGhlIHRleHQgY29tYmluZWQgd2l0aC4uLg0KDQo+ID4g
KwkJaWYgKG9mX2dldF9mYl92aWRlb21vZGUobnAsIGxjZGNfaW5mbywgMCkpIHsNCj4gPiArCQkJ
ZGV2X2VycigmZGV2LT5kZXYsICJ0aW1pbmdzIG5vdCBhdmFpbGFibGUgaW4gRFRcbiIpOw0KPiA+
ICsJCQlyZXR1cm4gTlVMTDsNCj4gPiArCQl9DQo+ID4gKwkJcmV0dXJuIGxjZGNfaW5mbzsNCj4g
PiArCX0NCj4gDQo+IC4uLiB0aGlzIGlzIG5vdCBjb3JyZWN0LiBZb3UgYXJlIGp1c3Qgc3VwcG9y
dGluZyB0aGUgZmlyc3QgZGlzcGxheS10aW1pbmdzDQo+IHN1Ym5vZGUgKG9mX2dldF9mYl92aWRl
b21vZGUoLi4uLCAwKSkuDQoNCg0KWWVzIHJpZ2h0LCBJIHdpbGwgbW9kaWZ5IHRoZSB0ZXh0IHRv
IHJlZmxlY3Qgd2hhdCB0aGUgZHJpdmVyIGRvZXMuDQoNClJlZ2FyZHMNCkFmemFsDQo

^ permalink raw reply

* Re: [PATCH 08/10] video: da8xx-fb: obtain fb_videomode info from dt
From: Steffen Trumtrar @ 2013-01-07  9:11 UTC (permalink / raw)
  To: Afzal Mohammed
  Cc: Florian Tobias Schandinat, Tomi Valkeinen, Grant Likely,
	Rob Herring, Rob Landley, Sekhar Nori, Vaibhav Hiremath,
	linux-omap, linux-fbdev, linux-kernel, devicetree-discuss,
	linux-doc
In-Reply-To: <78e026555731e0bbe8475610279d3e5265d124b9.1357304090.git.afzal@ti.com>

Hi!

On Mon, Jan 07, 2013 at 10:41:30AM +0530, Afzal Mohammed wrote:
> Obtain fb_videomode details for the connected lcd panel using the
> display timing details present in DT.
> 
> Signed-off-by: Afzal Mohammed <afzal@ti.com>
> ---
>  .../devicetree/bindings/video/fb-da8xx.txt         |   20 ++++++++++++++++++++
>  drivers/video/da8xx-fb.c                           |   16 ++++++++++++++++
>  2 files changed, 36 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/video/fb-da8xx.txt b/Documentation/devicetree/bindings/video/fb-da8xx.txt
> index 581e014..eeb935b 100644
> --- a/Documentation/devicetree/bindings/video/fb-da8xx.txt
> +++ b/Documentation/devicetree/bindings/video/fb-da8xx.txt
> @@ -6,6 +6,11 @@ Required properties:
>  	AM335x SoC's - "ti,am3352-lcdc", "ti,da830-lcdc"
>  - reg: Address range of lcdc register set
>  - interrupts: lcdc interrupt
> +- display-timings: list of different videomodes supported by the lcd
> +  panel, represented as childs, can have multiple modes supported, if
> +  only one, then it is considered native mode, if multiple modes are
> +  provided, native mode can be set explicitly, more details available
> +  @Documentation/devicetree/bindings/video/display-timing.txt
>  

Keep in mind that the text combined with...

>  Example:
>  
> @@ -13,4 +18,19 @@ lcdc@4830e000 {
>  	compatible = "ti,am3352-lcdc", "ti,da830-lcdc";
>  	reg =  <0x4830e000 0x1000>;
>  	interrupts = <36>;
> +	display-timings {
> +		800x480p62 {
> +			clock-frequency = <30000000>;
> +			hactive = <800>;
> +			vactive = <480>;
> +			hfront-porch = <39>;
> +			hback-porch = <39>;
> +			hsync-len = <47>;
> +			vback-porch = <29>;
> +			vfront-porch = <13>;
> +			vsync-len = <2>;
> +			hsync-active = <1>;
> +			vsync-active = <1>;
> +		};
> +	};
>  };
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 68ae925..94add01 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -1261,8 +1261,24 @@ static struct fb_videomode *da8xx_fb_get_videomode(struct platform_device *dev)
>  {
>  	struct da8xx_lcdc_platform_data *fb_pdata = dev->dev.platform_data;
>  	struct fb_videomode *lcdc_info;
> +	struct device_node *np = dev->dev.of_node;
>  	int i;
>  
> +	if (np) {
> +		lcdc_info = devm_kzalloc(&dev->dev,
> +					 sizeof(struct fb_videomode),
> +					 GFP_KERNEL);
> +		if (!lcdc_info) {
> +			dev_err(&dev->dev, "memory allocation failed\n");
> +			return NULL;
> +		}
> +		if (of_get_fb_videomode(np, lcdc_info, 0)) {
> +			dev_err(&dev->dev, "timings not available in DT\n");
> +			return NULL;
> +		}
> +		return lcdc_info;
> +	}

... this is not correct. You are just supporting the first display-timings
subnode (of_get_fb_videomode(..., 0)).

Regards,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* RE: [PATCHv16 5/7] fbmon: add of_videomode helpers
From: Mohammed, Afzal @ 2013-01-07  8:46 UTC (permalink / raw)
  To: Steffen Trumtrar
  Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Florian Tobias Schandinat, David Airlie,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Rob Clark, Valkeinen, Tomi, Laurent Pinchart,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Guennady Liakhovetski,
	linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20130107080648.GB23478-bIcnvbaLZ9MEGnE8C9+IrQ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 2013-01-07  8:06 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: devicetree-discuss@lists.ozlabs.org, linux-fbdev@vger.kernel.org,
	David Airlie, Florian Tobias Schandinat,
	dri-devel@lists.freedesktop.org, Rob Clark, Valkeinen, Tomi,
	Laurent Pinchart, kernel@pengutronix.de, Guennady Liakhovetski,
	linux-media@vger.kernel.org
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A93EA7FB02@DBDE01.ent.ti.com>

Hi Afzal,

On Mon, Jan 07, 2013 at 06:10:13AM +0000, Mohammed, Afzal wrote:
> Hi Steffen,
> 
> On Tue, Dec 18, 2012 at 22:34:14, Steffen Trumtrar wrote:
> > Add helper to get fb_videomode from devicetree.
> 
> >  drivers/video/fbmon.c |   42 ++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/fb.h    |    4 ++++
> 
> This breaks DaVinci (da8xx_omapl_defconfig), following change was
> required to get it build if OF_VIDEOMODE or/and FB_MODE_HELPERS
> is not defined. There may be better solutions, following was the
> one that was used by me to test this series.
> 
> ---8<----------
> 
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 58b9860..0ce30d1 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -716,9 +716,19 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb);
>  extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
>  extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
> 
> +#if defined(CONFIG_OF_VIDEOMODE) && defined(CONFIG_FB_MODE_HELPERS)
>  extern int of_get_fb_videomode(struct device_node *np,
>                                struct fb_videomode *fb,
>                                int index);
> +#else
> +static inline int of_get_fb_videomode(struct device_node *np,
> +                                     struct fb_videomode *fb,
> +                                     int index)
> +{
> +       return -EINVAL;
> +}
> +#endif
> +
>  extern int fb_videomode_from_videomode(const struct videomode *vm,
>                                        struct fb_videomode *fbmode);
> 
> ---8<----------
> 

I just did a quick "make da8xx_omapl_defconfig && make" and it builds just fine.
On what version did you apply the series?
At the moment I have the series sitting on 3.7. Didn't try any 3.8-rcx yet.
But fixing this shouldn't be a problem.

> 
> > +#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
> 
> As _OF_VIDEOMODE is a bool type CONFIG, isn't,
> 
> #ifdef CONFIG_OF_VIDEOMODE
> 
> sufficient ?
> 

Yes, that is right. But I think IS_ENABLED is the preferred way to do it, isn't it?

Regards,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Re: [PATCHv16 0/7] of: add display helper
From: Steffen Trumtrar @ 2013-01-07  7:46 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: devicetree-discuss@lists.ozlabs.org, Rob Herring,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Laurent Pinchart, Thierry Reding, Guennady Liakhovetski,
	linux-media@vger.kernel.org, Valkeinen, Tomi, Stephen Warren,
	kernel@pengutronix.de, Florian Tobias Schandinat, David Airlie,
	Rob Clark, Leela Krishna Amudala
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A93EA7FB16@DBDE01.ent.ti.com>

On Mon, Jan 07, 2013 at 06:23:54AM +0000, Mohammed, Afzal wrote:
> Hi Steffen,
> 
> On Tue, Dec 18, 2012 at 22:34:09, Steffen Trumtrar wrote:
> 
> > Finally, right in time before the end of the world on friday, v16 of the
> > display helpers.
> 
> After another big bang, your series in the previous world was tried ;)
> 
> This series has been tested on DA850 EVM, AM335x EVM, EVM-SK along
> with the fix mentioned in 5/7, there was a build breakage on default
> config on DaVinci boards with this series, fix as well as more
> details are mentioned as reply to 5/7.
> 
> With those changes or equivalent to achieve the same,
> 
> Tested-by: Afzal Mohammed <Afzal@ti.com>
>

Thanks.

Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* RE: [PATCHv16 0/7] of: add display helper
From: Mohammed, Afzal @ 2013-01-07  6:23 UTC (permalink / raw)
  To: Steffen Trumtrar, devicetree-discuss@lists.ozlabs.org
  Cc: Rob Herring, linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, Laurent Pinchart, Thierry Reding,
	Guennady Liakhovetski, linux-media@vger.kernel.org,
	Valkeinen, Tomi, Stephen Warren, kernel@pengutronix.de,
	Florian Tobias Schandinat, David Airlie, Rob Clark,
	Leela Krishna Amudala
In-Reply-To: <1355850256-16135-1-git-send-email-s.trumtrar@pengutronix.de>

SGkgU3RlZmZlbiwNCg0KT24gVHVlLCBEZWMgMTgsIDIwMTIgYXQgMjI6MzQ6MDksIFN0ZWZmZW4g
VHJ1bXRyYXIgd3JvdGU6DQoNCj4gRmluYWxseSwgcmlnaHQgaW4gdGltZSBiZWZvcmUgdGhlIGVu
ZCBvZiB0aGUgd29ybGQgb24gZnJpZGF5LCB2MTYgb2YgdGhlDQo+IGRpc3BsYXkgaGVscGVycy4N
Cg0KQWZ0ZXIgYW5vdGhlciBiaWcgYmFuZywgeW91ciBzZXJpZXMgaW4gdGhlIHByZXZpb3VzIHdv
cmxkIHdhcyB0cmllZCA7KQ0KDQpUaGlzIHNlcmllcyBoYXMgYmVlbiB0ZXN0ZWQgb24gREE4NTAg
RVZNLCBBTTMzNXggRVZNLCBFVk0tU0sgYWxvbmcNCndpdGggdGhlIGZpeCBtZW50aW9uZWQgaW4g
NS83LCB0aGVyZSB3YXMgYSBidWlsZCBicmVha2FnZSBvbiBkZWZhdWx0DQpjb25maWcgb24gRGFW
aW5jaSBib2FyZHMgd2l0aCB0aGlzIHNlcmllcywgZml4IGFzIHdlbGwgYXMgbW9yZQ0KZGV0YWls
cyBhcmUgbWVudGlvbmVkIGFzIHJlcGx5IHRvIDUvNy4NCg0KV2l0aCB0aG9zZSBjaGFuZ2VzIG9y
IGVxdWl2YWxlbnQgdG8gYWNoaWV2ZSB0aGUgc2FtZSwNCg0KVGVzdGVkLWJ5OiBBZnphbCBNb2hh
bW1lZCA8QWZ6YWxAdGkuY29tPg0KDQpSZWdhcmRzDQpBZnphbA0K

^ permalink raw reply

* RE: [PATCHv16 5/7] fbmon: add of_videomode helpers
From: Mohammed, Afzal @ 2013-01-07  6:10 UTC (permalink / raw)
  To: Steffen Trumtrar,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
  Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Airlie,
	Florian Tobias Schandinat,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Rob Clark, Valkeinen, Tomi, Laurent Pinchart,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Guennady Liakhovetski,
	linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1355850256-16135-6-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

SGkgU3RlZmZlbiwNCg0KT24gVHVlLCBEZWMgMTgsIDIwMTIgYXQgMjI6MzQ6MTQsIFN0ZWZmZW4g
VHJ1bXRyYXIgd3JvdGU6DQo+IEFkZCBoZWxwZXIgdG8gZ2V0IGZiX3ZpZGVvbW9kZSBmcm9tIGRl
dmljZXRyZWUuDQoNCj4gIGRyaXZlcnMvdmlkZW8vZmJtb24uYyB8ICAgNDIgKysrKysrKysrKysr
KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrDQo+ICBpbmNsdWRlL2xpbnV4L2ZiLmggICAg
fCAgICA0ICsrKysNCg0KVGhpcyBicmVha3MgRGFWaW5jaSAoZGE4eHhfb21hcGxfZGVmY29uZmln
KSwgZm9sbG93aW5nIGNoYW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50IGluZGV4KTsNCisjZWxzZQ0KK3N0YXRpYyBpbmxpbmUgaW50IG9mX2dldF9mYl92
aWRlb21vZGUoc3RydWN0IGRldmljZV9ub2RlICpucCwNCisgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgc3RydWN0IGZiX3ZpZGVvbW9kZSAqZmIsDQorICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCkNCit7DQorICAgICAgIHJldHVybiAtRUlO
VkFMOw0KK30NCisjZW5kaWYNCisNCiBleHRlcm4gaW50IGZiX3ZpZGVvbW9kZV9mcm9tX3ZpZGVv
bW9kZShjb25zdCBzdHJ1Y3QgdmlkZW9tb2RlICp2bSwNCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIHN0cnVjdCBmYl92aWRlb21vZGUgKmZibW9kZSk7DQoNCi0tLTg8LS0t
LS0tLS0tLQ0KDQoNCj4gKyNpZiBJU19FTkFCTEVEKENPTkZJR19PRl9WSURFT01PREUpDQoNCkFz
IF9PRl9WSURFT01PREUgaXMgYSBib29sIHR5cGUgQ09ORklHLCBpc24ndCwNCg0KI2lmZGVmIENP
TkZJR19PRl9WSURFT01PREUNCg0Kc3VmZmljaWVudCA/DQoNClJlZ2FyZHMNCkFmemFsDQo

^ permalink raw reply

* [PATCH 5/5] ARM: dts: AM33XX: Add am335x-evmsk lcdc pincontrol info
From: Afzal Mohammed @ 2013-01-07  5:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <cover.1357304150.git.afzal@ti.com>

Update pin mux information for lcd panel on AM335X-EVMSK.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 arch/arm/boot/dts/am335x-evmsk.dts |   35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index a7e017b..6275a50 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -32,7 +32,7 @@
 
 	am33xx_pinmux: pinmux@44e10800 {
 		pinctrl-names = "default";
-		pinctrl-0 = <&user_leds_s0 &gpio_keys_s0>;
+		pinctrl-0 = <&user_leds_s0 &gpio_keys_s0 &lcd_pins_s0>;
 
 		user_leds_s0: user_leds_s0 {
 			pinctrl-single,pins = <
@@ -51,6 +51,39 @@
 				0x9c 0x27	/* gpmc_ben0_cle.gpio2_5, INPUT | MODE7 */
 			>;
 		};
+
+		lcd_pins_s0: lcd_pins_s0 {
+			pinctrl-single,pins = <
+				0x20 0x01
+				0x24 0x01
+				0x28 0x01
+				0x2c 0x01
+				0x30 0x01
+				0x34 0x01
+				0x38 0x01
+				0x3c 0x01
+				0xa0 0x08
+				0xa4 0x08
+				0xa8 0x08
+				0xac 0x08
+				0xb0 0x08
+				0xb4 0x08
+				0xb8 0x08
+				0xbc 0x08
+				0xc0 0x08
+				0xc4 0x08
+				0xc8 0x08
+				0xcc 0x08
+				0xd0 0x08
+				0xd4 0x08
+				0xd8 0x08
+				0xdc 0x08
+				0xe0 0x00
+				0xe4 0x00
+				0xe8 0x00
+				0xec 0x00
+			>;
+		};
 	};
 
 	ocp {
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 4/5] ARM: dts: AM33XX: Add am335x-evmsk lcdc panel timings
From: Afzal Mohammed @ 2013-01-07  5:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <cover.1357304150.git.afzal@ti.com>

Update lcdc node with panel timings (typical) for AM335X-EVMSK.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 arch/arm/boot/dts/am335x-evmsk.dts |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index f5a6162..a7e017b 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -248,3 +248,23 @@
 		};
 	};
 };
+
+&lcdc {
+	status = "okay";
+
+	display-timings {
+		480x272p57 {
+			clock-frequency = <9000000>;
+			hactive = <480>;
+			vactive = <272>;
+			hfront-porch = <8>;
+			hback-porch = <43>;
+			hsync-len = <4>;
+			vback-porch = <12>;
+			vfront-porch = <4>;
+			vsync-len = <10>;
+			hsync-active = <1>;
+			vsync-active = <1>;
+		};
+	};
+};
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 3/5] ARM: dts: AM33XX: Add am335x-evm lcdc pincontrol info
From: Afzal Mohammed @ 2013-01-07  5:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <cover.1357304150.git.afzal@ti.com>

Update pin mux information for lcd panel on AM335X-EVM

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 arch/arm/boot/dts/am335x-evm.dts |   35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index a4229aa..25ebfc2 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -26,7 +26,7 @@
 
 	am33xx_pinmux: pinmux@44e10800 {
 		pinctrl-names = "default";
-		pinctrl-0 = <&matrix_keypad_s0 &volume_keys_s0>;
+		pinctrl-0 = <&matrix_keypad_s0 &volume_keys_s0 &lcd_pins_s0>;
 
 		matrix_keypad_s0: matrix_keypad_s0 {
 			pinctrl-single,pins = <
@@ -44,6 +44,39 @@
 				0x154 0x27	/* spi0_d0.gpio0_3, INPUT | MODE7 */
 			>;
 		};
+
+		lcd_pins_s0: lcd_pins_s0 {
+			pinctrl-single,pins = <
+				0x20 0x01
+				0x24 0x01
+				0x28 0x01
+				0x2c 0x01
+				0x30 0x01
+				0x34 0x01
+				0x38 0x01
+				0x3c 0x01
+				0xa0 0x08
+				0xa4 0x08
+				0xa8 0x08
+				0xac 0x08
+				0xb0 0x08
+				0xb4 0x08
+				0xb8 0x08
+				0xbc 0x08
+				0xc0 0x08
+				0xc4 0x08
+				0xc8 0x08
+				0xcc 0x08
+				0xd0 0x08
+				0xd4 0x08
+				0xd8 0x08
+				0xdc 0x08
+				0xe0 0x00
+				0xe4 0x00
+				0xe8 0x00
+				0xec 0x00
+			>;
+		};
 	};
 
 	ocp {
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 2/5] ARM: dts: AM33XX: Add am335x-evm lcdc panel timings
From: Afzal Mohammed @ 2013-01-07  5:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <cover.1357304150.git.afzal@ti.com>

Update lcdc node with panel timings (typical) for AM335X-EVM.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 arch/arm/boot/dts/am335x-evm.dts |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index d649644..a4229aa 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -244,3 +244,23 @@
 &cpsw_emac1 {
 	phy_id = <&davinci_mdio>, <1>;
 };
+
+&lcdc {
+	status = "okay";
+
+	display-timings {
+		800x480p62 {
+			clock-frequency = <30000000>;
+			hactive = <800>;
+			vactive = <480>;
+			hfront-porch = <39>;
+			hback-porch = <39>;
+			hsync-len = <47>;
+			vback-porch = <29>;
+			vfront-porch = <13>;
+			vsync-len = <2>;
+			hsync-active = <1>;
+			vsync-active = <1>;
+		};
+	};
+};
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 1/5] ARM: dts: AM33XX: Add lcdc node
From: Afzal Mohammed @ 2013-01-07  5:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <cover.1357304150.git.afzal@ti.com>

Add lcdc node.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 arch/arm/boot/dts/am33xx.dtsi |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index c2f14e8..432d4bb8 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -385,5 +385,13 @@
 				mac-address = [ 00 00 00 00 00 00 ];
 			};
 		};
+
+		lcdc: lcdc@4830e000 {
+			compatible = "ti,am3352-lcdc", "ti,da830-lcdc";
+			reg = <0x4830e000 0x1000>;
+			interrupts = <36>;
+			status = "disabled";
+			ti,hwmods = "lcdc";
+		};
 	};
 };
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 0/5] ARM: dts: AM33XX: lcdc support
From: Afzal Mohammed @ 2013-01-07  5:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This series add DT sources for AM335x SoC as well as AM335x based
boards.

As pinmux is an SoC specific detail rather than IP specific one,
addition of pin control has been done in a separate patch from
the one in which display timings are added. Also it may aid in
debugging in case of any issues.

This has been tested on AM335x based boards like AM335x EVM and
AM335x EVM-SK.

This series is based on v3.8-rc2.

This series has a dependency on,
1. Series v16 "of: add display helper" by,
	Steffen Trumtrar <s.trumtrar@pengutronix.de>
2. Series v2 "video: da8xx-fb: runtime timing configuration" by,
	me (Afzal Mohammed <afzal@ti.com>)
3. Series "video: da8xx-fb: DT support" by,
	me (Afzal Mohammed <afzal@ti.com>)

To test on AM335x, in addition to the above, following changes,
1. Patch "da8xx: Allow use by am33xx based devices" by,
	Pantelis Antoniou <panto@antoniou-consulting.com>
3. Series "HWMOD fixes for AM33xx PWM submodules and device tree nodes" by,
	Philip, Avinash <avinashphilip@ti.com>
would be required

A tree with all above for testing is available
 @git://gitorious.org/x0148406-public/linux-kernel.git da8xx-fb-dt


Regards
Afzal

Afzal Mohammed (5):
  ARM: dts: AM33XX: Add lcdc node
  ARM: dts: AM33XX: Add am335x-evm lcdc panel timings
  ARM: dts: AM33XX: Add am335x-evm lcdc pincontrol info
  ARM: dts: AM33XX: Add am335x-evmsk lcdc panel timings
  ARM: dts: AM33XX: Add am335x-evmsk lcdc pincontrol info

 arch/arm/boot/dts/am335x-evm.dts   |   55 +++++++++++++++++++++++++++++++++++-
 arch/arm/boot/dts/am335x-evmsk.dts |   55 +++++++++++++++++++++++++++++++++++-
 arch/arm/boot/dts/am33xx.dtsi      |    8 ++++++
 3 files changed, 116 insertions(+), 2 deletions(-)

-- 
1.7.9.5


^ permalink raw reply

* [PATCH 10/10] video: da8xx-fb: setup struct lcd_ctrl_config for dt
From: Afzal Mohammed @ 2013-01-07  5:23 UTC (permalink / raw)
  To: Florian Tobias Schandinat, Tomi Valkeinen, Grant Likely,
	Rob Herring, Rob Landley, Steffen Trumtrar, Sekhar Nori,
	Vaibhav Hiremath, linux-omap, linux-fbdev, linux-kernel,
	devicetree-discuss, linux-doc
In-Reply-To: <cover.1357304090.git.afzal@ti.com>

strcut lcd_ctrl_config information required for driver is currently
obtained via platform data. To handle DT probing, create
lcd_ctrl_config and populate it with default values, these values are
sufficient for the panels so far used with this controller to work.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 drivers/video/da8xx-fb.c |   34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 3e590d4..4a4b4dc 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1257,6 +1257,35 @@ static struct fb_ops da8xx_fb_ops = {
 	.fb_blank = cfb_blank,
 };
 
+static struct lcd_ctrl_config *da8xx_fb_create_cfg(struct platform_device *dev)
+{
+	struct lcd_ctrl_config *cfg;
+
+	cfg = devm_kzalloc(&dev->dev, sizeof(struct fb_videomode), GFP_KERNEL);
+	if (!cfg) {
+		dev_err(&dev->dev, "memory allocation failed\n");
+		return NULL;
+	}
+
+	/* default values */
+
+	if (lcd_revision = LCD_VERSION_1)
+		cfg->bpp = 16;
+	else
+		cfg->bpp = 32;
+
+	/*
+	 * For panels so far used with this LCDC, below statement is sufficient.
+	 * For new panels, if required, struct lcd_ctrl_cfg fields to be updated
+	 * with additional/modified values. Those values would have to be then
+	 * obtained from dt(requiring new dt bindings).
+	 */
+
+	cfg->panel_shade = COLOR_ACTIVE;
+
+	return cfg;
+}
+
 static struct fb_videomode *da8xx_fb_get_videomode(struct platform_device *dev)
 {
 	struct da8xx_lcdc_platform_data *fb_pdata = dev->dev.platform_data;
@@ -1348,7 +1377,10 @@ static int __devinit fb_probe(struct platform_device *device)
 		break;
 	}
 
-	lcd_cfg = (struct lcd_ctrl_config *)fb_pdata->controller_data;
+	if (device->dev.of_node)
+		lcd_cfg = da8xx_fb_create_cfg(device);
+	else
+		lcd_cfg = (struct lcd_ctrl_config *)fb_pdata->controller_data;
 
 	if (!lcd_cfg) {
 		ret = -EINVAL;
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 09/10] video: da8xx-fb: ensure pdata only for non-dt
From: Afzal Mohammed @ 2013-01-07  5:23 UTC (permalink / raw)
  To: Florian Tobias Schandinat, Tomi Valkeinen, Grant Likely,
	Rob Herring, Rob Landley, Steffen Trumtrar, Sekhar Nori,
	Vaibhav Hiremath, linux-omap, linux-fbdev, linux-kernel,
	devicetree-discuss, linux-doc
In-Reply-To: <cover.1357304090.git.afzal@ti.com>

This driver is DT probe-able, hence ensure presence of platform data
only for non-DT boot.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 drivers/video/da8xx-fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 94add01..3e590d4 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1306,7 +1306,7 @@ static int __devinit fb_probe(struct platform_device *device)
 	int ret;
 	unsigned long ulcm;
 
-	if (fb_pdata = NULL) {
+	if (fb_pdata = NULL && !device->dev.of_node) {
 		dev_err(&device->dev, "Can not get platform data\n");
 		return -ENOENT;
 	}
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 08/10] video: da8xx-fb: obtain fb_videomode info from dt
From: Afzal Mohammed @ 2013-01-07  5:23 UTC (permalink / raw)
  To: Florian Tobias Schandinat, Tomi Valkeinen, Grant Likely,
	Rob Herring, Rob Landley, Steffen Trumtrar, Sekhar Nori,
	Vaibhav Hiremath, linux-omap, linux-fbdev, linux-kernel,
	devicetree-discuss, linux-doc
In-Reply-To: <cover.1357304090.git.afzal@ti.com>

Obtain fb_videomode details for the connected lcd panel using the
display timing details present in DT.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 .../devicetree/bindings/video/fb-da8xx.txt         |   20 ++++++++++++++++++++
 drivers/video/da8xx-fb.c                           |   16 ++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/Documentation/devicetree/bindings/video/fb-da8xx.txt b/Documentation/devicetree/bindings/video/fb-da8xx.txt
index 581e014..eeb935b 100644
--- a/Documentation/devicetree/bindings/video/fb-da8xx.txt
+++ b/Documentation/devicetree/bindings/video/fb-da8xx.txt
@@ -6,6 +6,11 @@ Required properties:
 	AM335x SoC's - "ti,am3352-lcdc", "ti,da830-lcdc"
 - reg: Address range of lcdc register set
 - interrupts: lcdc interrupt
+- display-timings: list of different videomodes supported by the lcd
+  panel, represented as childs, can have multiple modes supported, if
+  only one, then it is considered native mode, if multiple modes are
+  provided, native mode can be set explicitly, more details available
+  @Documentation/devicetree/bindings/video/display-timing.txt
 
 Example:
 
@@ -13,4 +18,19 @@ lcdc@4830e000 {
 	compatible = "ti,am3352-lcdc", "ti,da830-lcdc";
 	reg =  <0x4830e000 0x1000>;
 	interrupts = <36>;
+	display-timings {
+		800x480p62 {
+			clock-frequency = <30000000>;
+			hactive = <800>;
+			vactive = <480>;
+			hfront-porch = <39>;
+			hback-porch = <39>;
+			hsync-len = <47>;
+			vback-porch = <29>;
+			vfront-porch = <13>;
+			vsync-len = <2>;
+			hsync-active = <1>;
+			vsync-active = <1>;
+		};
+	};
 };
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 68ae925..94add01 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1261,8 +1261,24 @@ static struct fb_videomode *da8xx_fb_get_videomode(struct platform_device *dev)
 {
 	struct da8xx_lcdc_platform_data *fb_pdata = dev->dev.platform_data;
 	struct fb_videomode *lcdc_info;
+	struct device_node *np = dev->dev.of_node;
 	int i;
 
+	if (np) {
+		lcdc_info = devm_kzalloc(&dev->dev,
+					 sizeof(struct fb_videomode),
+					 GFP_KERNEL);
+		if (!lcdc_info) {
+			dev_err(&dev->dev, "memory allocation failed\n");
+			return NULL;
+		}
+		if (of_get_fb_videomode(np, lcdc_info, 0)) {
+			dev_err(&dev->dev, "timings not available in DT\n");
+			return NULL;
+		}
+		return lcdc_info;
+	}
+
 	for (i = 0, lcdc_info = known_lcd_panels;
 		i < ARRAY_SIZE(known_lcd_panels); i++, lcdc_info++) {
 		if (strcmp(fb_pdata->type, lcdc_info->name) = 0)
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 07/10] video: da8xx-fb: invoke platform callback safely
From: Afzal Mohammed @ 2013-01-07  5:23 UTC (permalink / raw)
  To: Florian Tobias Schandinat, Tomi Valkeinen, Grant Likely,
	Rob Herring, Rob Landley, Steffen Trumtrar, Sekhar Nori,
	Vaibhav Hiremath, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-doc-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cover.1357304090.git.afzal-l0cyMroinI0@public.gmane.org>

Ensure that platform data is present before checking whether platform
callback is present (the one used to control backlight). So far this
was not an issue as driver was purely non-DT triggered, but now DT
support has been added.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 drivers/video/da8xx-fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index d10479f..68ae925 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1351,7 +1351,7 @@ static int __devinit fb_probe(struct platform_device *device)
 	par->dev = &device->dev;
 	par->lcdc_clk = fb_clk;
 	par->lcd_fck_rate = clk_get_rate(fb_clk);
-	if (fb_pdata->panel_power_ctrl) {
+	if (fb_pdata && fb_pdata->panel_power_ctrl) {
 		par->panel_power_ctrl = fb_pdata->panel_power_ctrl;
 		par->panel_power_ctrl(1);
 	}
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 06/10] video: da8xx-fb: minimal dt support
From: Afzal Mohammed @ 2013-01-07  5:23 UTC (permalink / raw)
  To: Florian Tobias Schandinat, Tomi Valkeinen, Grant Likely,
	Rob Herring, Rob Landley, Steffen Trumtrar, Sekhar Nori,
	Vaibhav Hiremath, linux-omap, linux-fbdev, linux-kernel,
	devicetree-discuss, linux-doc
In-Reply-To: <cover.1357304090.git.afzal@ti.com>

Driver is provided a means to have the probe triggered by DT.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
 .../devicetree/bindings/video/fb-da8xx.txt         |   16 ++++++++++++++++
 drivers/video/da8xx-fb.c                           |    7 +++++++
 2 files changed, 23 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fb-da8xx.txt

diff --git a/Documentation/devicetree/bindings/video/fb-da8xx.txt b/Documentation/devicetree/bindings/video/fb-da8xx.txt
new file mode 100644
index 0000000..581e014
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/fb-da8xx.txt
@@ -0,0 +1,16 @@
+TI LCD Controller on DA830/DA850/AM335x SoC's
+
+Required properties:
+- compatible:
+	DA830 - "ti,da830-lcdc"
+	AM335x SoC's - "ti,am3352-lcdc", "ti,da830-lcdc"
+- reg: Address range of lcdc register set
+- interrupts: lcdc interrupt
+
+Example:
+
+lcdc@4830e000 {
+	compatible = "ti,am3352-lcdc", "ti,da830-lcdc";
+	reg =  <0x4830e000 0x1000>;
+	interrupts = <36>;
+};
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 991d9e3..d10479f 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1599,6 +1599,12 @@ static int fb_resume(struct platform_device *dev)
 #define fb_resume NULL
 #endif
 
+static const struct of_device_id da8xx_fb_of_match[] = {
+	{.compatible = "ti,da830-lcdc", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, da8xx_fb_of_match);
+
 static struct platform_driver da8xx_fb_driver = {
 	.probe = fb_probe,
 	.remove = __devexit_p(fb_remove),
@@ -1607,6 +1613,7 @@ static struct platform_driver da8xx_fb_driver = {
 	.driver = {
 		   .name = DRIVER_NAME,
 		   .owner = THIS_MODULE,
+		   .of_match_table = of_match_ptr(da8xx_fb_of_match),
 		   },
 };
 
-- 
1.7.9.5


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox