devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
To: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Florian Tobias Schandinat
	<FlorianSchandinat-Mmb7MZpHnFY@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Timur Tabi <timur-N01EOCouUvQ@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH] fbdev: fsl-diu-fb: optionally configure frame buffer depth in DT
Date: Wed, 13 Mar 2013 16:24:09 +0100	[thread overview]
Message-ID: <1363188249-29341-1-git-send-email-agust@denx.de> (raw)

Add support for 'depth' property to configure default frame
buffer color depth over device tree.

Signed-off-by: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
---
 .../devicetree/bindings/powerpc/fsl/diu.txt        |    2 ++
 drivers/video/fsl-diu-fb.c                         |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/powerpc/fsl/diu.txt b/Documentation/devicetree/bindings/powerpc/fsl/diu.txt
index b66cb6d..502aae5 100644
--- a/Documentation/devicetree/bindings/powerpc/fsl/diu.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/diu.txt
@@ -12,6 +12,7 @@ Required properties:
   services interrupts for this device.
 
 Optional properties:
+- depth : default frame buffer color depth
 - edid : verbatim EDID data block describing attached display.
   Data from the detailed timing descriptor will be used to
   program the display controller.
@@ -30,5 +31,6 @@ Example for MPC5121:
 		reg = <0x2100 0x100>;
 		interrupts = <64 0x8>;
 		interrupt-parent = <&ipic>;
+		depth = <16>;
 		edid = [edid-data];
 	};
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 41fbd94..2287817 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1534,6 +1534,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
 	const void *prop;
 	unsigned int i;
 	int ret;
+	u32 depth;
 
 	data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
 				   &dma_addr, GFP_DMA | __GFP_ZERO);
@@ -1584,6 +1585,21 @@ static int fsl_diu_probe(struct platform_device *pdev)
 		data->has_edid = true;
 	}
 
+	if (!of_property_read_u32(np, "depth", &depth)) {
+		switch (depth) {
+		case 32:
+		case 24:
+		case 16:
+		case 8:
+			default_bpp = depth;
+			break;
+		default:
+			dev_err(&pdev->dev,
+				"%s: invalid depth property\n",
+				np->full_name);
+		}
+	}
+
 	data->diu_reg = of_iomap(np, 0);
 	if (!data->diu_reg) {
 		dev_err(&pdev->dev, "cannot map DIU registers\n");
-- 
1.7.5.4

                 reply	other threads:[~2013-03-13 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1363188249-29341-1-git-send-email-agust@denx.de \
    --to=agust-ynqeqjnshbs@public.gmane.org \
    --cc=FlorianSchandinat-Mmb7MZpHnFY@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=timur-N01EOCouUvQ@public.gmane.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).