linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Afzal Mohammed <afzal@ti.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>, Sekhar Nori <nsekhar@ti.com>,
	Vaibhav Hiremath <hvaibhav@ti.com>,
	linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 08/10] video: da8xx-fb: obtain fb_videomode info from dt
Date: Mon, 07 Jan 2013 09:11:31 +0000	[thread overview]
Message-ID: <20130107091131.GC23478@pengutronix.de> (raw)
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 |

  reply	other threads:[~2013-01-07  9:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07  5:22 [PATCH 00/10] video: da8xx-fb: DT support Afzal Mohammed
     [not found] ` <cover.1357304090.git.afzal-l0cyMroinI0@public.gmane.org>
2013-01-07  5:22   ` [PATCH 01/10] video: da8xx-fb: fix 24bpp raster configuration Afzal Mohammed
2013-01-07  5:22   ` [PATCH 02/10] video: da8xx-fb: enable sync lost intr for v2 ip Afzal Mohammed
2013-01-07  5:22   ` [PATCH 03/10] video: da8xx-fb: use devres Afzal Mohammed
2013-01-07  5:23   ` [PATCH 07/10] video: da8xx-fb: invoke platform callback safely Afzal Mohammed
2013-01-07  5:22 ` [PATCH 04/10] video: da8xx-fb: ensure non-null cfg in pdata Afzal Mohammed
2013-01-07  5:23 ` [PATCH 05/10] video: da8xx-fb: reorganize panel detection Afzal Mohammed
2013-01-07  5:23 ` [PATCH 06/10] video: da8xx-fb: minimal dt support Afzal Mohammed
2013-01-07  5:23 ` [PATCH 08/10] video: da8xx-fb: obtain fb_videomode info from dt Afzal Mohammed
2013-01-07  9:11   ` Steffen Trumtrar [this message]
     [not found]     ` <20130107091131.GC23478-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-01-07  9:21       ` Mohammed, Afzal
     [not found]         ` <C8443D0743D26F4388EA172BF4E2A7A93EA7FC7A-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-01-15 13:59           ` Mohammed, Afzal
2013-01-07  5:23 ` [PATCH 09/10] video: da8xx-fb: ensure pdata only for non-dt Afzal Mohammed
2013-01-07  5:23 ` [PATCH 10/10] video: da8xx-fb: setup struct lcd_ctrl_config for dt Afzal Mohammed

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=20130107091131.GC23478@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=FlorianSchandinat@gmx.de \
    --cc=afzal@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=hvaibhav@ti.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=tomi.valkeinen@ti.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 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).