From patchwork Thu Apr 19 09:32:25 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: 10349375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8AEEC60244 for ; Thu, 19 Apr 2018 09:32:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B2BC2877B for ; Thu, 19 Apr 2018 09:32:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7004628790; Thu, 19 Apr 2018 09:32:59 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E5D72877B for ; Thu, 19 Apr 2018 09:32:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 560806E62B; Thu, 19 Apr 2018 09:32:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53E386E617 for ; Thu, 19 Apr 2018 09:32:37 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id AD5025FDF6; Thu, 19 Apr 2018 17:32:29 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , David Airlie , Thierry Reding , Rob Herring , Mark Rutland Subject: [PATCH 6/6] [DO NOT MERGE] ARM: dts: sun7i: bananapi-m1-plus: Enable Bananapi 7" 800x480 RGB LCD panel Date: Thu, 19 Apr 2018 17:32:25 +0800 Message-Id: <20180419093225.614-7-wens@csie.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419093225.614-1-wens@csie.org> References: <20180419093225.614-1-wens@csie.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Jonathan Liu , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 | 61 +++++++++++++++++++ 1 file changed, 61 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..58a923bfa6ef 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,34 @@ }; }; + 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"; + /* This doesn't do anything for this particular panel */ + enable-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + backlight = <&lcd_backlight>; + #address-cells = <1>; + #size-cells = <0>; + + lcd_panel_input: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_out_lcd>; + }; + }; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -173,6 +202,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 +292,12 @@ }; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pins_a>; + status = "okay"; +}; + ®_dcdc2 { regulator-always-on; regulator-min-microvolt = <1000000>; @@ -278,6 +327,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>;