From patchwork Sat Feb 9 10:40:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Geyer X-Patchwork-Id: 10804425 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 59E03746 for ; Sat, 9 Feb 2019 10:40:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BE382AE5E for ; Sat, 9 Feb 2019 10:40:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FD392AE74; Sat, 9 Feb 2019 10:40:43 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 5D22C2AE5E for ; Sat, 9 Feb 2019 10:40:42 +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: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:In-Reply-To:References: List-Owner; bh=EFIwX19fHBTRLtp7frEcfhp/3ECI+w8zsqsS8gXzYG8=; b=M7gdZZ6u7Ty18/ BrU+0xVbqtMmg/kJp/WYYSyE0Eue7ZOOhqWnHeGhQp9v96PDXK263H2n4MUAtptWtbeF0crIX2eNt p3RLA8nUYi71gHcnKbMStiSS5l03T0ga4V7Qlgsx3MNd16wh5nw4Z3hW1lzNiwHyYsgLdIq3YNMzA KTjIzqdgadJGEjwIwRle/5vFwzJ5dVuwMKWe7JjCAnzp/nov8YGSxfEeWJxMW0IjNs6AasCnBLnB+ +mnC0of3NFZl/jWpI/3f9FGRaFd1VQ8+F6fi/Jinv31IippMWcPgyZEag8dn3optfgrs9OCABTyxV w/+MioLU/gAQsWq5ys/Q==; 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 1gsQ3q-0001ly-An; Sat, 09 Feb 2019 10:40:38 +0000 Received: from h1.radempa.de ([176.9.142.194] helo=mail.cosmopool.net) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gsQ3m-0001lD-PW for linux-arm-kernel@lists.infradead.org; Sat, 09 Feb 2019 10:40:36 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.cosmopool.net (Postfix) with ESMTP id 86FCE9007B2; Sat, 9 Feb 2019 11:40:29 +0100 (CET) Received: from mail.cosmopool.net ([127.0.0.1]) by localhost (mail.b.radempa.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wCbEjPcByYKs; Sat, 9 Feb 2019 11:40:28 +0100 (CET) Received: from hdev.ccbib.org (unknown [IPv6:2a01:4f8:160:20c1::10:110]) by mail.cosmopool.net (Postfix) with SMTP id C641F900286; Sat, 9 Feb 2019 11:40:27 +0100 (CET) Received: by hdev.ccbib.org (sSMTP sendmail emulation); Sat, 09 Feb 2019 10:40:27 +0000 From: Harald Geyer To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Subject: [PATCHv4] arm64: dts: allwinner: a64: teres-i: enable backlight Date: Sat, 9 Feb 2019 10:40:18 +0000 Message-Id: <20190209104018.6765-1-harald@ccbib.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190209_024034_974976_B4E00164 X-CRM114-Status: GOOD ( 10.85 ) 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, linux-arm-kernel@lists.infradead.org, Harald Geyer 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 Enable pwm and add a pretty standard backlight node. The regulator is always on, but we include it anyway, because it is required by the binding document. Signed-off-by: Harald Geyer --- Changes since v3: * Adjust brightness-levels to follow closer to an exponential law * Change default value to have a similar brightness to what we had before. Changes since v2: * Drop all the other stuff that got merged a year ago. * Rebased on current sunxi/for-next branch * Add power-supply property (just to conform to the binding) * Use slightly different brightness-levels Actually I tried omitting brightness-levels completely, as it is now optional. However automatic calculation gives unreasonable results (depending on the exact value of pwm period). A report has been sent to the author of the code. .../arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts index 7b7b14ba58e6..0ec46b969a75 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts @@ -21,6 +21,15 @@ serial0 = &uart0; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 0>; + power-supply = <®_dcdc1>; + brightness-levels = <0 5 7 10 14 20 28 40 56 80 112>; + default-brightness-level = <5>; + enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ + }; + chosen { stdout-path = "serial0:115200n8"; @@ -131,6 +140,10 @@ status = "okay"; }; +&pwm { + status = "okay"; +}; + &r_rsb { status = "okay";