diff mbox

[v2,4/8] arm64: dts: r8a7796: salvator-x: Add panel backlight support

Message ID 1493303863-23719-5-git-send-email-ulrich.hecht+renesas@gmail.com (mailing list archive)
State Accepted
Delegated to: Simon Horman
Headers show

Commit Message

Ulrich Hecht April 27, 2017, 2:37 p.m. UTC
The panel backlight is controlled through a GPIO and a PWM channel.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Laurent Pinchart April 27, 2017, 2:43 p.m. UTC | #1
Hi Ulrich,

Thank you for the patch.

On Thursday 27 Apr 2017 16:37:39 Ulrich Hecht wrote:
> The panel backlight is controlled through a GPIO and a PWM channel.
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 22 ++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts index 14d9e51..abda84c
> 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> @@ -133,6 +133,11 @@
>  		function = "i2c2";
>  	};
> 
> +	pwm1_pins: pwm {
> +		groups = "pwm1_a";
> +		function = "pwm1";
> +	};
> +
>  	sdhi0_pins: sd0 {
>  		groups = "sdhi0_data4", "sdhi0_ctrl";
>  		function = "sdhi0";
> @@ -183,6 +188,16 @@
>  		interrupt-parent = <&gpio2>;
>  		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
>  	};
> +
> +	backlight: backlight {
> +		compatible = "pwm-backlight";
> +		pwms = <&pwm1 0 50000>;
> +
> +		brightness-levels = <256 128 64 16 8 4 0>;
> +		default-brightness-level = <6>;
> +
> +		enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
> +	};
>  };
> 
>  &extal_clk {
> @@ -235,6 +250,13 @@
>  	status = "okay";
>  };
> 
> +&pwm1 {
> +	pinctrl-0 = <&pwm1_pins>;
> +	pinctrl-names = "default";
> +
> +	status = "okay";
> +};
> +
>  &scif1 {
>  	pinctrl-0 = <&scif1_pins>;
>  	pinctrl-names = "default";
Laurent Pinchart May 13, 2017, 6:56 p.m. UTC | #2
Hi Simon,

I'm afraid you added nodes in the wrong places when applying the patch to 
salvator-x.dtsi :-( Please see below.

On Thursday 27 Apr 2017 17:43:56 Laurent Pinchart wrote:
> Hi Ulrich,
> 
> Thank you for the patch.
> 
> On Thursday 27 Apr 2017 16:37:39 Ulrich Hecht wrote:
> > The panel backlight is controlled through a GPIO and a PWM channel.
> > 
> > Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> > 
> >  arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 22 ++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> > b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts index
> > 14d9e51..abda84c
> > 100644
> > --- a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> > +++ b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> > @@ -133,6 +133,11 @@
> >  		function = "i2c2";
> >  	};
> > 
> > +	pwm1_pins: pwm {
> > +		groups = "pwm1_a";
> > +		function = "pwm1";
> > +	};
> > +

This is alphabetically ordered here and isn't anymore in your devel branch.

> >  	sdhi0_pins: sd0 {
> >  		groups = "sdhi0_data4", "sdhi0_ctrl";
> >  		function = "sdhi0";
> > @@ -183,6 +188,16 @@
> >  		interrupt-parent = <&gpio2>;
> >  		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
> >  	};
> > +
> > +	backlight: backlight {
> > +		compatible = "pwm-backlight";
> > +		pwms = <&pwm1 0 50000>;
> > +
> > +		brightness-levels = <256 128 64 16 8 4 0>;
> > +		default-brightness-level = <6>;
> > +
> > +		enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
> > +	};

The backlight node needs to be added as a child of the root node, while you've 
added it to the DU node in your devel branch.

> >  };
> >  
> >  &extal_clk {
> > @@ -235,6 +250,13 @@
> >  	status = "okay";
> >  };
> > 
> > +&pwm1 {
> > +	pinctrl-0 = <&pwm1_pins>;
> > +	pinctrl-names = "default";
> > +
> > +	status = "okay";
> > +};
> > +

This is alphabetically ordered here and isn't anymore in your devel branch.

Can you rebase your devel branch to fix this ?

> >  &scif1 {
> >  	pinctrl-0 = <&scif1_pins>;
> >  	pinctrl-names = "default";
Geert Uytterhoeven Sept. 5, 2017, 3:08 p.m. UTC | #3
Hi Ulrich,

On Thu, Apr 27, 2017 at 4:37 PM, Ulrich Hecht
<ulrich.hecht+renesas@gmail.com> wrote:
> The panel backlight is controlled through a GPIO and a PWM channel.
>
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> ---
>  arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> index 14d9e51..abda84c 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
> @@ -133,6 +133,11 @@
>                 function = "i2c2";
>         };
>
> +       pwm1_pins: pwm {
> +               groups = "pwm1_a";
> +               function = "pwm1";
> +       };
> +
>         sdhi0_pins: sd0 {
>                 groups = "sdhi0_data4", "sdhi0_ctrl";
>                 function = "sdhi0";
> @@ -183,6 +188,16 @@
>                 interrupt-parent = <&gpio2>;
>                 interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
>         };
> +
> +       backlight: backlight {
> +               compatible = "pwm-backlight";
> +               pwms = <&pwm1 0 50000>;
> +
> +               brightness-levels = <256 128 64 16 8 4 0>;
> +               default-brightness-level = <6>;
> +
> +               enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
> +       };
>  };

This prints the following warning:

pwm-backlight backlight: backlight supply power not found, using dummy regulator

According to Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt,
the "power-supply" property is required.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
index 14d9e51..abda84c 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
@@ -133,6 +133,11 @@ 
 		function = "i2c2";
 	};
 
+	pwm1_pins: pwm {
+		groups = "pwm1_a";
+		function = "pwm1";
+	};
+
 	sdhi0_pins: sd0 {
 		groups = "sdhi0_data4", "sdhi0_ctrl";
 		function = "sdhi0";
@@ -183,6 +188,16 @@ 
 		interrupt-parent = <&gpio2>;
 		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
 	};
+
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm1 0 50000>;
+
+		brightness-levels = <256 128 64 16 8 4 0>;
+		default-brightness-level = <6>;
+
+		enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 &extal_clk {
@@ -235,6 +250,13 @@ 
 	status = "okay";
 };
 
+&pwm1 {
+	pinctrl-0 = <&pwm1_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+};
+
 &scif1 {
 	pinctrl-0 = <&scif1_pins>;
 	pinctrl-names = "default";