From patchwork Wed Mar 13 15:24:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 2263711 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F1575DF215 for ; Wed, 13 Mar 2013 15:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932865Ab3CMPYS (ORCPT ); Wed, 13 Mar 2013 11:24:18 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:60664 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932391Ab3CMPYS (ORCPT ); Wed, 13 Mar 2013 11:24:18 -0400 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3ZQxfk4BBWz3hhVV; Wed, 13 Mar 2013 16:24:14 +0100 (CET) X-Auth-Info: Wzocr1QdD633ehq5wNUd1seHUKlhI/fSN5EFFwARA6o= Received: from localhost (p4FC46B80.dip.t-dialin.net [79.196.107.128]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 3ZQxfk1Cfmzbc0c; Wed, 13 Mar 2013 16:24:14 +0100 (CET) From: Anatolij Gustschin To: linux-fbdev@vger.kernel.org Cc: Timur Tabi , Florian Tobias Schandinat , devicetree-discuss@lists.ozlabs.org, Grant Likely , Rob Herring , Anatolij Gustschin Subject: [PATCH] fbdev: fsl-diu-fb: optionally configure frame buffer depth in DT Date: Wed, 13 Mar 2013 16:24:09 +0100 Message-Id: <1363188249-29341-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.5.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Add support for 'depth' property to configure default frame buffer color depth over device tree. Signed-off-by: Anatolij Gustschin --- .../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");