From patchwork Fri Sep 7 04:19:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 10591605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB53E5A4 for ; Fri, 7 Sep 2018 04:24:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A7E92ADA7 for ; Fri, 7 Sep 2018 04:24:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E46E2ADAD; Fri, 7 Sep 2018 04:24:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C8742ADA7 for ; Fri, 7 Sep 2018 04:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mUOOt9tg65LS5J2RiwrQp67WoLb/C+fekCEeSMcGU3o=; b=DFC64DeE79Ts/h +hthzbmfWMtHpZW9Y6xMZq9Ib0i0UFl3Ht9UquqxlFKM52+WdUQRQCYzXTepwZcy+XqH8gnflS8bu wvbbhUzWpQWZE/I/TxwjFvuVbUKgJRKuQLRk3vTO67GaNWLieGMn2lTJLxzSsdAMlJeFE+fqCyLsK 5jlyaTCIk3yX+u3rraFcFTuOIPWgPNjH1JKdRop6/aGiXBTVU1W1y3ixAorm/N8zt0ObrIz9iA3ME vfni9McMExoM0y9yn21BjG+0fQ9ztf0F0V1qFxCRqEp1wlgwGPHwyQZ/ksJ0c1yUffhYoLs5hPRXW ai5dPP2ocQ8hKqhrlDBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fy8Jp-0001MA-Nn; Fri, 07 Sep 2018 04:24:29 +0000 Received: from mirror2.csie.ntu.edu.tw ([140.112.30.76] helo=wens.csie.org) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fy8Fk-0006q4-Ey for linux-arm-kernel@lists.infradead.org; Fri, 07 Sep 2018 04:20:18 +0000 Received: by wens.csie.org (Postfix, from userid 1000) id DA90A5FD94; Fri, 7 Sep 2018 12:19:50 +0800 (CST) From: Chen-Yu Tsai To: Thierry Reding , David Airlie , Rob Herring , Mark Rutland , Maxime Ripard Subject: [PATCH v2 6/6] [DO NOT MERGE] ARM: dts: sun7i: bananapi-m1-plus: Enable Bananapi 7" 800x480 RGB LCD panel Date: Fri, 7 Sep 2018 12:19:48 +0800 Message-Id: <20180907041948.19913-7-wens@csie.org> X-Mailer: git-send-email 2.19.0.rc1 In-Reply-To: <20180907041948.19913-1-wens@csie.org> References: <20180907041948.19913-1-wens@csie.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180906_212016_713640_2290F86B X-CRM114-Status: GOOD ( 14.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Jonathan Liu , linux-sunxi@googlegroups.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The BPI-M1+ has an FPC connector for connecting an RGB (parallel) or LVDS LCD panel. One of the compatible panels is a 7" 800x480 RGB panel from Bananapi. The backlight can be controlled by driving a PWM signal from the SoC at different duty cycles. The LCD enable pin does not seem to do anything, but it is nevertheless included for completeness. There is also a FT5306 capacitive touchscreen controller. This should not be confused with the other 7" LCD that is LVDS based and has a resolution of 1024x600. This patch enables all of the above for the BPI-M1+. Signed-off-by: Chen-Yu Tsai --- .../boot/dts/sun7i-a20-bananapi-m1-plus.dts | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts b/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts index 763cb03033c4..9fa58adade56 100644 --- a/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts +++ b/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts @@ -47,6 +47,7 @@ #include "sunxi-common-regulators.dtsi" #include #include +#include / { model = "Banana Pi BPI-M1-Plus"; @@ -71,6 +72,29 @@ }; }; + lcd_backlight: lcd-backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 20000 PWM_POLARITY_INVERTED>; /* 50 kHz */ + enable-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */ + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; + default-brightness-level = <8>; + }; + + lcd_panel: lcd-panel { + compatible = "bananapi,s070wv20-ct16", "simple-panel"; + power-supply = <®_vcc5v0>; /* Actually driven from IPSOUT */ + /* This doesn't do anything for this particular connector */ + enable-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ + + port { + backlight = <&lcd_backlight>; + + lcd_panel_input: endpoint { + remote-endpoint = <&tcon0_out_lcd>; + }; + }; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -173,6 +197,20 @@ status = "okay"; }; +&i2c3 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c3_pins_a>; + status = "okay"; + + touchscreen@38 { + compatible = "edt,edt-ft5306", "edt,edt-ft5x06"; + reg = <0x38>; + interrupt-parent = <&pio>; + interrupts = <7 7 IRQ_TYPE_EDGE_FALLING>; /* PH7 */ + reset-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */ + }; +}; + &ir0 { pinctrl-names = "default"; pinctrl-0 = <&ir0_rx_pins_a>; @@ -249,6 +287,12 @@ }; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pins_a>; + status = "okay"; +}; + ®_dcdc2 { regulator-always-on; regulator-min-microvolt = <1000000>; @@ -278,6 +322,18 @@ status = "okay"; }; +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd0_rgb888_pins>; +}; + +&tcon0_out { + tcon0_out_lcd: endpoint@0 { + reg = <0>; + remote-endpoint = <&lcd_panel_input>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>;