From patchwork Wed Nov 7 18:18:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10672857 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 A4B8D13A4 for ; Wed, 7 Nov 2018 18:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9687E2CD96 for ; Wed, 7 Nov 2018 18:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89F652CD98; Wed, 7 Nov 2018 18:20:35 +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 362552CD6C for ; Wed, 7 Nov 2018 18:20:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 396BD6E3F4; Wed, 7 Nov 2018 18:20:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from leonov.paulk.fr (leonov.paulk.fr [185.233.101.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 67B206E3F4 for ; Wed, 7 Nov 2018 18:20:32 +0000 (UTC) Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id C04A3BFA47 for ; Wed, 7 Nov 2018 19:20:30 +0100 (CET) Received: by gagarine.paulk.fr (Postfix, from userid 114) id C64A9C1093; Wed, 7 Nov 2018 19:20:29 +0100 (CET) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 05746C1070; Wed, 7 Nov 2018 19:17:59 +0100 (CET) From: Paul Kocialkowski To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH NOT FOR MERGE v3 8/8] ARM: dts: sun7i-a20-bananapi: Add bindings for the LeMaker 3.5" LCD Date: Wed, 7 Nov 2018 19:18:43 +0100 Message-Id: <20181107181843.27628-9-contact@paulk.fr> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181107181843.27628-1-contact@paulk.fr> References: <20181107181843.27628-1-contact@paulk.fr> MIME-Version: 1.0 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: Mark Rutland , Mark Van den Borre , Gerry Demaret , David Airlie , linux-sunxi@googlegroups.com, Rob Herring , Paul Kocialkowski , Maxime Ripard , Chen-Yu Tsai , Thierry Reding Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This adds the backlight panel, power, pwm and tcon0 device-tree bindings required for supporting the 3.5" LCD from LeMaker on the BananaPi M1. The brightness levels are adjusted with a gamma curve using a 1.8 power, with indices from 0 to 100 and values ranging from 0 to 255, such as: level = (index / 100)^1.8 * 255 Signed-off-by: Paul Kocialkowski --- arch/arm/boot/dts/sun7i-a20-bananapi.dts | 71 ++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts index 70dfc4ac0bb5..ac6c3e988203 100644 --- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts +++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts @@ -48,6 +48,7 @@ #include #include +#include / { model = "LeMaker Banana Pi"; @@ -63,6 +64,57 @@ stdout-path = "serial0:115200n8"; }; + + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 0>; + /* This table uses a gamma curve with a 1.8 power. */ + brightness-levels = < 0 1 1 1 1 1 2 2 + 3 3 4 5 6 6 7 8 + 9 11 12 13 14 15 17 18 + 20 21 23 24 26 27 29 31 + 33 35 37 39 41 43 45 47 + 49 51 54 56 58 61 63 66 + 68 71 73 76 79 81 84 87 + 90 93 96 99 102 105 108 111 + 114 117 121 124 127 131 134 138 + 141 145 148 152 156 159 163 167 + 171 175 178 182 186 190 194 198 + 203 207 211 215 219 224 228 233 + 237 241 246 250 255>; + default-brightness-level = <50>; + enable-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ + }; + + panel: panel { + compatible = "lemaker,bl035-rgb-002"; + #address-cells = <1>; + #size-cells = <0>; + power-supply = <&panel_power>; + backlight = <&backlight>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + panel_input: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_out_panel>; + }; + }; + }; + + panel_power: panel_power { + compatible = "regulator-fixed"; + regulator-name = "panel-power"; + regulator-min-microvolt = <10400000>; + regulator-max-microvolt = <10400000>; + gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ + enable-active-high; + regulator-boot-on; + }; + hdmi-connector { compatible = "hdmi-connector"; type = "a"; @@ -275,6 +327,12 @@ }; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pins_a>; + status = "okay"; +}; + #include "axp209.dtsi" ®_dcdc2 { @@ -322,6 +380,19 @@ status = "okay"; }; +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd0_rgb888_pins>; + status = "okay"; +}; + +&tcon0_out { + tcon0_out_panel: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>;