devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 4/5] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets
Date: Sun, 20 Sep 2015 08:30:50 -0400	[thread overview]
Message-ID: <1442752251-20744-5-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1442752251-20744-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

From: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.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 <wens-jdAy2FN1RRM@public.gmane.org>
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 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 6f8a8bb..f342736 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 <dt-bindings/pwm/pwm.h>
+
 / {
 	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 = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
 	mmc0_cd_pin_q8: mmc0_cd_pin@0 {
 		allwinner,pins = "PB4";
 		allwinner,function = "gpio_in";
-- 
2.4.3

  parent reply	other threads:[~2015-09-20 12:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-20 12:30 [PATCH 0/5] ARM: dts: sunxi: Add backlight node to q8 tablets Hans de Goede
     [not found] ` <1442752251-20744-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-20 12:30   ` [PATCH 1/5] ARM: dts: sun5i: Add PWM controller node for A13/A10s Hans de Goede
     [not found]     ` <1442752251-20744-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-22 14:28       ` Maxime Ripard
2015-09-20 12:30   ` [PATCH 2/5] ARM: dts: sun5i: Add PWM channel 0 pinmux setting " Hans de Goede
     [not found]     ` <1442752251-20744-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-22 14:29       ` Maxime Ripard
2015-09-20 12:30   ` [PATCH 3/5] ARM: dts: sunxi: Enable PWM controller on Q8 format tablets Hans de Goede
2015-09-20 12:30   ` Hans de Goede [this message]
     [not found]     ` <1442752251-20744-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-22 14:44       ` [PATCH 4/5] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 " Maxime Ripard
2015-09-20 12:30   ` [PATCH 5/5] ARM: dts: sun5i: Add backlight node to sun5i-q8-common.dtsi Hans de Goede
     [not found]     ` <1442752251-20744-6-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-20 14:46       ` Chen-Yu Tsai
     [not found]         ` <CAGb2v66Bg60p8T3dzF6ymo-rTEMK4yUVZsuaOjCXapPBQRn6eg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-20 15:14           ` Hans de Goede
     [not found]             ` <55FECD38.9010503-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-20 15:21               ` Hans de Goede
2015-12-19 10:54     ` 8001010
     [not found]       ` <5df61312-cf32-43d4-8aba-485acf66787d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-12-22  3:21         ` Chen-Yu Tsai
2015-12-21 10:56   ` [PATCH 0/5] ARM: dts: sunxi: Add backlight node to q8 tablets Silvio Pellicano
     [not found]     ` <fc4adcf5-4362-4d4c-b42e-729922c79f65-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-12-21 12:59       ` Hans de Goede
     [not found]         ` <5677F7CF.3050308-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-01  0:17           ` Silvio Pellicano
2016-01-11 10:34         ` [linux-sunxi] " 8001010
     [not found]           ` <5693852A.1060604-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-01-11 11:09             ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442752251-20744-5-git-send-email-hdegoede@redhat.com \
    --to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).