From patchwork Wed Mar 5 16:23:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 25769 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 89780203C3 for ; Wed, 5 Mar 2014 16:23:46 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf2765263pdj.7 for ; Wed, 05 Mar 2014 08:23:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=t1SJL7lxy26LvFYEPKbxA0okfv3l85HVtFBafYJgDNY=; b=DfrssiIAbu17OlaYp47L+ZxrEM5nsDkHSeAZBV/Xfu5CgTLo7JDmgMexRHAVZxZW2n 8ZS0Mgd5/c2uS+D9Tj+SihxP4iQYh6JXfcdqI5wFsnKGiU2GPDG2YJOFa2ZzBbYxt0fJ x0at84J8AndnqJaHmjZagK/OI/01OKbOy2vQhZvrl66trY+6ApySAwwIxv7Pof26lX9c 4PSbvi7doq7pjKXuYQqtiHeyMHxPSLGUJ2v+OWakt6SChI7BAU0rhTReHetu5g+u3wqP md2FDbwxxZH3bibvGEmKawD8+LMkt8RHF66uRBZUSK8hKZXgpnlAgbPg5xUH2ZlO5edj 6Oug== X-Gm-Message-State: ALoCoQlp3g5lDpDYliDXlLT9keY8DcnMbKwDn/ZvCxqewhXfp/Mn3imAPCmrs7jjZ/wgfxPhybgW X-Received: by 10.66.241.8 with SMTP id we8mr3235756pac.16.1394036625753; Wed, 05 Mar 2014 08:23:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.115 with SMTP id b106ls418093qgd.97.gmail; Wed, 05 Mar 2014 08:23:45 -0800 (PST) X-Received: by 10.58.12.169 with SMTP id z9mr20571veb.61.1394036625492; Wed, 05 Mar 2014 08:23:45 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id dq2si164482veb.69.2014.03.05.08.23.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Mar 2014 08:23:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so1281235veb.32 for ; Wed, 05 Mar 2014 08:23:45 -0800 (PST) X-Received: by 10.58.54.35 with SMTP id g3mr49142vep.46.1394036625351; Wed, 05 Mar 2014 08:23:45 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp31136vck; Wed, 5 Mar 2014 08:23:44 -0800 (PST) X-Received: by 10.66.176.143 with SMTP id ci15mr7736512pac.35.1394036622897; Wed, 05 Mar 2014 08:23:42 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si2865344pbh.37.2014.03.05.08.23.42; Wed, 05 Mar 2014 08:23:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753061AbaCEQXl (ORCPT + 1 other); Wed, 5 Mar 2014 11:23:41 -0500 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:56380 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752841AbaCEQXj (ORCPT ); Wed, 5 Mar 2014 11:23:39 -0500 Received: from hornet.Cambridge.Arm.com (hornet.cambridge.arm.com [10.2.201.45]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 2F6D313F69F; Wed, 5 Mar 2014 10:23:35 -0600 (CST) From: Pawel Moll To: linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Will Deacon , Jonathan Austin , Arnd Bergmann , Linus Walleij , Mark Rutland , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Russell King , Pawel Moll Subject: [PATCH v5 1/2] video: ARM CLCD: Add DT support Date: Wed, 5 Mar 2014 16:23:25 +0000 Message-Id: <1394036606-17784-1-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-fbdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pawel.moll@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch adds basic DT bindings for the PL11x CLCD cells and make their fbdev driver use them. Signed-off-by: Pawel Moll --- Changes since v4: - simplified the pads description property and made it optional Changes since v3: - changed wording and order of interrupt-names and interrupts properties documentation - changed wording of arm,pl11x,framebuffer-base property documentation - cleaned up binding documentation indentation Changes since v2: - replaced video-ram phandle with arm,pl11x,framebuffer-base - replaced panel-* properties with arm,pl11x,panel-data-pads - replaced max-framebuffer-size with max-memory-bandwidth - modified clcdfb_of_init_tft_panel() to use the pads data and take differences between PL110 and PL110 into account Changes since v1: - minor code cleanups as suggested by Sylwester Nawrocki .../devicetree/bindings/video/arm,pl11x.txt | 83 ++++++++ drivers/video/Kconfig | 1 + drivers/video/amba-clcd.c | 219 +++++++++++++++++++++ 3 files changed, 303 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/arm,pl11x.txt diff --git a/Documentation/devicetree/bindings/video/arm,pl11x.txt b/Documentation/devicetree/bindings/video/arm,pl11x.txt new file mode 100644 index 0000000..75da7b7 --- /dev/null +++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt @@ -0,0 +1,83 @@ +* ARM PrimeCell Color LCD Controller PL110/PL111 + +See also Documentation/devicetree/bindings/arm/primecell.txt + +Required properties: + +- compatible: must be one of: + "arm,pl110", "arm,primecell" + "arm,pl111", "arm,primecell" + +- reg: base address and size of the control registers block + +- interrupt-names: either the single entry "combined" representing a + combined interrupt output (CLCDINTR), or the four entries + "mbe", "vcomp", "lnbu", "fuf" representing the individual + CLCDMBEINTR, CLCDVCOMPINTR, CLCDLNBUINTR, CLCDFUFINTR interrupts + +- interrupts: contains an interrupt specifier for each entry in + interrupt-names + +- clocks-names: should contain "clcdclk" and "apb_pclk" + +- clocks: contains phandle and clock specifier pairs for the entries + in the clock-names property. See + Documentation/devicetree/binding/clock/clock-bindings.txt + +Optional properties: + +- arm,pl11x,framebuffer-base: a pair of two 32-bit values, address and size, + defining the framebuffer that must be used; if not present, the + framebuffer may be located anywhere in the memory + +- arm,pl11x,tft-r0g0b0-pads: when connected to a TFT panel, an array of three + 32-bit values, defining the way CLD pads are wired up; this implicitly + defines available color modes, for example: + - PL111 TFT 4:4:4 panel: + arm,pl11x,tft-r0g0b0-pads = <4 15 20>; + - PL110 TFT (1:)5:5:5 panel: + arm,pl11x,tft-r0g0b0-pads = <1 7 13>; + - PL111 TFT (1:)5:5:5 panel: + arm,pl11x,tft-r0g0b0-pads = <3 11 19>; + - PL111 TFT 5:6:5 panel: + arm,pl11x,tft-r0g0b0-pads = <3 10 19>; + - PL110 and PL111 TFT 8:8:8 panel: + arm,pl11x,tft-r0g0b0-pads = <0 8 16>; + - PL110 and PL111 TFT 8:8:8 panel, R & B components swapped: + arm,pl11x,tft-r0g0b0-pads = <16 8 0>; + +- max-memory-bandwidth: maximum bandwidth in bytes per second that the + cell's memory interface can handle + +- display-timings: standard display timings sub-node, defining possible + video modes of a connected panel; for details see + Documentation/devicetree/bindings/video/display-timing.txt + +Example: + + clcd@1f0000 { + compatible = "arm,pl111", "arm,primecell"; + reg = <0x1f0000 0x1000>; + interrupt-names = "combined"; + interrupts = <14>; + clock-names = "clcdclk", "apb_pclk"; + clocks = <&v2m_oscclk1>, <&smbclk>; + + arm,pl11x,framebuffer-base = <0x18000000 0x00800000>; + arm,pl11x,tft-r0g0b0-pads = <0 8 16>; + max-memory-bandwidth = <36864000>; /* bps, 640x480@60 16bpp */ + display-timings { + native-mode = <&v2m_clcd_timing0>; + v2m_clcd_timing0: vga { + clock-frequency = <25175000>; + hactive = <640>; + hback-porch = <40>; + hfront-porch = <24>; + hsync-len = <96>; + vactive = <480>; + vback-porch = <32>; + vfront-porch = <11>; + vsync-len = <2>; + }; + }; + }; diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index dade5b7..c1d25c9 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -317,6 +317,7 @@ config FB_ARMCLCD select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select VIDEOMODE_HELPERS if OF help This framebuffer device driver is for the ARM PrimeCell PL110 Colour LCD controller. ARM PrimeCells provide the building diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 14d6b37..5a165dd 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -26,6 +26,11 @@ #include #include #include +#include +#include +#include +#include