All of lore.kernel.org
 help / color / mirror / Atom feed
From: Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>
To: Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Cc: Russell King <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
	linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>
Subject: [PATCH 5/5] ARM: dts: sun6i: add pwm backlight for reference design tablet
Date: Tue, 11 Oct 2016 14:34:49 +0800	[thread overview]
Message-ID: <20161011063449.54775-5-icenowy@aosc.xyz> (raw)
In-Reply-To: <20161011063449.54775-1-icenowy-ymACFijhrKM@public.gmane.org>

The reference tablet design of sun6i uses pwm0 to control the backlight.

As we have PWM support for sun6i now, enable the backlight control.

Signed-off-by: Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>
---
 .../boot/dts/sun6i-reference-design-tablet.dtsi    | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi b/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi
index c3fcf16..aa96acf 100644
--- a/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi
+++ b/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi
@@ -45,6 +45,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
+#include <dt-bindings/pwm/pwm.h>
 
 / {
 	aliases {
@@ -54,6 +55,16 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pinctrl-names = "default";
+		pinctrl-0 = <&bl_en_pin>;
+		pwms = <&pwm0 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 0 25 GPIO_ACTIVE_HIGH>; /* PA25 */
+	};
 };
 
 &cpu0 {
@@ -76,6 +87,13 @@
 };
 
 &pio {
+	bl_en_pin: bl_en_pin@0 {
+		allwinner,pins = "PA25";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
 	mmc0_cd_pin_e708_q1: mmc0_cd_pin@0 {
 		allwinner,pins = "PA8";
 		allwinner,function = "gpio_in";
@@ -91,6 +109,12 @@
 	};
 };
 
+&pwm0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm0_pins>;
+	status = "okay";
+};
+
 &p2wi {
 	status = "okay";
 
-- 
2.10.1

  parent reply	other threads:[~2016-10-11  6:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11  6:34 [PATCH 1/5] dt-bindings: add binding for Allwinner sun6i(A31) PWM controller Icenowy Zheng
     [not found] ` <20161011063449.54775-1-icenowy-ymACFijhrKM@public.gmane.org>
2016-10-11  6:34   ` [PATCH 2/5] pwm: Add Allwinner A31 SoC support Icenowy Zheng
2016-10-11  9:02     ` [linux-sunxi] " LABBE Corentin
2016-10-11  9:02       ` LABBE Corentin
2016-10-11 12:45     ` Maxime Ripard
2016-10-11 12:45       ` Maxime Ripard
2016-10-11  6:34   ` [PATCH 3/5] ARM: dts: sun6i: add PWM controller Icenowy Zheng
2016-10-11  6:34   ` [PATCH 4/5] ARM: dts: sun6i: add pinmux for PWM0 Icenowy Zheng
2016-10-11  6:34   ` Icenowy Zheng [this message]
2016-10-12  4:20 [PATCH 1/5] dt-bindings: add binding for Allwinner A31 SoC PWM controller Icenowy Zheng
     [not found] ` <20161012042059.40015-1-icenowy-ymACFijhrKM@public.gmane.org>
2016-10-12  4:20   ` [PATCH 5/5] ARM: dts: sun6i: add pwm backlight for reference design tablet Icenowy Zheng

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=20161011063449.54775-5-icenowy@aosc.xyz \
    --to=icenowy-ymacfijhrkm@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.