From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753269AbbIRHhK (ORCPT ); Fri, 18 Sep 2015 03:37:10 -0400 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:40436 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbbIRHfs (ORCPT ); Fri, 18 Sep 2015 03:35:48 -0400 From: Chen-Yu Tsai To: Maxime Ripard Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Hans de Goede Subject: [PATCH 4/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets Date: Fri, 18 Sep 2015 15:35:39 +0800 Message-Id: <1442561739-6824-5-git-send-email-wens@csie.org> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1442561739-6824-1-git-send-email-wens@csie.org> References: <1442561739-6824-1-git-send-email-wens@csie.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The LCD backlight on the A23/A33 Q8 format tablets is enabled with a GPIO controlled regulator, and brightness controlled with the SoC's PWM controller. The backlight is powered from the AXP223 PMIC's DC1SW output, which is not supported yet. A proper bootloader is required to enable it. The brightness levels are arbitrary. The FEX files do not have such information. As such, actual brightness levels may differ from device to device. Signed-off-by: Chen-Yu Tsai --- arch/arm/boot/dts/sun8i-q8-common.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-q8-common.dtsi b/arch/arm/boot/dts/sun8i-q8-common.dtsi index 4c2d0b459d6f..8a56ff567911 100644 --- a/arch/arm/boot/dts/sun8i-q8-common.dtsi +++ b/arch/arm/boot/dts/sun8i-q8-common.dtsi @@ -41,11 +41,24 @@ */ #include "sunxi-q8-common.dtsi" +#include + / { aliases { serial0 = &r_uart; }; + backlight: backlight { + compatible = "pwm-backlight"; + pinctrl-names = "default"; + pinctrl-0 = <&bl_en_pin_q8>; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; + default-brightness-level = <8>; + enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ + /* backlight is powered by AXP223 DC1SW */ + }; + chosen { stdout-path = "serial0:115200n8"; }; @@ -62,6 +75,13 @@ }; &pio { + bl_en_pin_q8: bl_en_pin@0 { + allwinner,pins = "PH6"; + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; + }; + mmc0_cd_pin_q8: mmc0_cd_pin@0 { allwinner,pins = "PB4"; allwinner,function = "gpio_in"; -- 2.5.1