linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets
@ 2015-09-18  7:35 Chen-Yu Tsai
  2015-09-18  7:35 ` [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33 Chen-Yu Tsai
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18  7:35 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel, linux-sunxi, Hans de Goede

Hi Maxime,

This series adds support for the PWM controlled backlight on the
A23/A33 Q8 tablets. The A23/A33 SoCs have the same PWM controller
as the A20, and the tablets use it to dim the LCD backlight.

The patches are pretty self-explaining.

Hans, could you test this on your TZX 723Q4? It's FEX file uses
a lower PWM frequency.


Regards
ChenYu


Chen-Yu Tsai (4):
  ARM: dts: sun8i: Add PWM controller node for A23/A33
  ARM: dts: sun8i: Add PWM channel 0 pinmux setting for A23/A33
  ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets
  ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format
    tablets

 arch/arm/boot/dts/sun8i-a23-a33.dtsi   | 15 +++++++++++++++
 arch/arm/boot/dts/sun8i-q8-common.dtsi | 26 ++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

-- 
2.5.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33
  2015-09-18  7:35 [PATCH 0/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets Chen-Yu Tsai
@ 2015-09-18  7:35 ` Chen-Yu Tsai
  2015-09-18 15:29   ` [linux-sunxi] " Hans de Goede
  2015-09-18 19:24   ` Maxime Ripard
  2015-09-18  7:35 ` [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting " Chen-Yu Tsai
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18  7:35 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel, linux-sunxi, Hans de Goede

A23/A33 have a PWM controller that is compatible to the one on the A20.
Add a device node for it.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun8i-a23-a33.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
index 27a925ec17d2..e7054304018a 100644
--- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
@@ -466,6 +466,14 @@
 			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		pwm: pwm@01c21400 {
+			compatible = "allwinner,sun7i-a20-pwm";
+			reg = <0x01c21400 0xc>;
+			clocks = <&osc24M>;
+			#pwm-cells = <3>;
+			status = "disabled";
+		};
+
 		lradc: lradc@01c22800 {
 			compatible = "allwinner,sun4i-a10-lradc-keys";
 			reg = <0x01c22800 0x100>;
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting for A23/A33
  2015-09-18  7:35 [PATCH 0/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets Chen-Yu Tsai
  2015-09-18  7:35 ` [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33 Chen-Yu Tsai
@ 2015-09-18  7:35 ` Chen-Yu Tsai
  2015-09-18 15:30   ` [linux-sunxi] " Hans de Goede
  2015-09-18  7:35 ` [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets Chen-Yu Tsai
  2015-09-18  7:35 ` [PATCH 4/4] ARM: dts: sun8i: Add pwm-backlight device for " Chen-Yu Tsai
  3 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18  7:35 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel, linux-sunxi, Hans de Goede

The PWM controller has 2 outputs, with one usable pin for each.

Add a pinmux setting for the first channel. This is often used
for backlight dimming on tablets.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun8i-a23-a33.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
index e7054304018a..8f4db82084c5 100644
--- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
@@ -412,6 +412,13 @@
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
+			pwm0_pins: pwm0 {
+				allwinner,pins = "PH0";
+				allwinner,function = "pwm0";
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
 			i2c0_pins_a: i2c0@0 {
 				allwinner,pins = "PH2", "PH3";
 				allwinner,function = "i2c0";
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets
  2015-09-18  7:35 [PATCH 0/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets Chen-Yu Tsai
  2015-09-18  7:35 ` [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33 Chen-Yu Tsai
  2015-09-18  7:35 ` [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting " Chen-Yu Tsai
@ 2015-09-18  7:35 ` Chen-Yu Tsai
  2015-09-18 15:32   ` [linux-sunxi] " Hans de Goede
  2015-09-18  7:35 ` [PATCH 4/4] ARM: dts: sun8i: Add pwm-backlight device for " Chen-Yu Tsai
  3 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18  7:35 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel, linux-sunxi, Hans de Goede

A23/A33 based Q8 format tablets use channel 0 of the PWM controller for
backlight dimming.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun8i-q8-common.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-q8-common.dtsi b/arch/arm/boot/dts/sun8i-q8-common.dtsi
index 6f8a8bb4e9bb..4c2d0b459d6f 100644
--- a/arch/arm/boot/dts/sun8i-q8-common.dtsi
+++ b/arch/arm/boot/dts/sun8i-q8-common.dtsi
@@ -70,6 +70,12 @@
 	};
 };
 
+&pwm {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm0_pins>;
+	status = "okay";
+};
+
 &r_uart {
 	pinctrl-names = "default";
 	pinctrl-0 = <&r_uart_pins_a>;
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets
  2015-09-18  7:35 [PATCH 0/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2015-09-18  7:35 ` [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets Chen-Yu Tsai
@ 2015-09-18  7:35 ` Chen-Yu Tsai
  3 siblings, 0 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18  7:35 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel, linux-sunxi, Hans de Goede

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@csie.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 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 <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.5.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [linux-sunxi] [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33
  2015-09-18  7:35 ` [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33 Chen-Yu Tsai
@ 2015-09-18 15:29   ` Hans de Goede
  2015-09-18 19:24   ` Maxime Ripard
  1 sibling, 0 replies; 13+ messages in thread
From: Hans de Goede @ 2015-09-18 15:29 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard; +Cc: linux-arm-kernel, linux-kernel, linux-sunxi

Hi,

Good stuff, thanks for working on this.

On 09/18/2015 03:35 AM, Chen-Yu Tsai wrote:
> A23/A33 have a PWM controller that is compatible to the one on the A20.
> Add a device node for it.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   arch/arm/boot/dts/sun8i-a23-a33.dtsi | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> index 27a925ec17d2..e7054304018a 100644
> --- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> +++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> @@ -466,6 +466,14 @@
>   			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
>   		};
>
> +		pwm: pwm@01c21400 {
> +			compatible = "allwinner,sun7i-a20-pwm";
> +			reg = <0x01c21400 0xc>;
> +			clocks = <&osc24M>;
> +			#pwm-cells = <3>;
> +			status = "disabled";
> +		};
> +
>   		lradc: lradc@01c22800 {
>   			compatible = "allwinner,sun4i-a10-lradc-keys";
>   			reg = <0x01c22800 0x100>;
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [linux-sunxi] [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting for A23/A33
  2015-09-18  7:35 ` [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting " Chen-Yu Tsai
@ 2015-09-18 15:30   ` Hans de Goede
  2015-09-18 16:18     ` Chen-Yu Tsai
  0 siblings, 1 reply; 13+ messages in thread
From: Hans de Goede @ 2015-09-18 15:30 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard; +Cc: linux-arm-kernel, linux-kernel, linux-sunxi

Hi,

On 09/18/2015 03:35 AM, Chen-Yu Tsai wrote:
> The PWM controller has 2 outputs, with one usable pin for each.
>
> Add a pinmux setting for the first channel. This is often used
> for backlight dimming on tablets.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>   arch/arm/boot/dts/sun8i-a23-a33.dtsi | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> index e7054304018a..8f4db82084c5 100644
> --- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> +++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> @@ -412,6 +412,13 @@
>   				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>   			};
>
> +			pwm0_pins: pwm0 {

This should be "pwm0_pins_a: pwm0@0" so as to be consistent with the a10 / a20 dtsi
files.

Regards,

Hans

> +				allwinner,pins = "PH0";
> +				allwinner,function = "pwm0";
> +				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
> +				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> +			};
> +
>   			i2c0_pins_a: i2c0@0 {
>   				allwinner,pins = "PH2", "PH3";
>   				allwinner,function = "i2c0";
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [linux-sunxi] [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets
  2015-09-18  7:35 ` [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets Chen-Yu Tsai
@ 2015-09-18 15:32   ` Hans de Goede
  2015-09-18 16:25     ` Chen-Yu Tsai
  0 siblings, 1 reply; 13+ messages in thread
From: Hans de Goede @ 2015-09-18 15:32 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard; +Cc: linux-arm-kernel, linux-kernel, linux-sunxi

Hi,

On 09/18/2015 03:35 AM, Chen-Yu Tsai wrote:
> A23/A33 based Q8 format tablets use channel 0 of the PWM controller for
> backlight dimming.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>   arch/arm/boot/dts/sun8i-q8-common.dtsi | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-q8-common.dtsi b/arch/arm/boot/dts/sun8i-q8-common.dtsi
> index 6f8a8bb4e9bb..4c2d0b459d6f 100644
> --- a/arch/arm/boot/dts/sun8i-q8-common.dtsi
> +++ b/arch/arm/boot/dts/sun8i-q8-common.dtsi
> @@ -70,6 +70,12 @@
>   	};
>   };
>
> +&pwm {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pwm0_pins>;
> +	status = "okay";
> +};
> +
>   &r_uart {
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&r_uart_pins_a>;
>

I've a feeling this should be in sunxi-q8-common.dtsi not sun8i-q8-common.dtsi, which requires adding a pwm
node to sun5i.dtsi I'll look into this.

Regards,

Hans



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [linux-sunxi] [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting for A23/A33
  2015-09-18 15:30   ` [linux-sunxi] " Hans de Goede
@ 2015-09-18 16:18     ` Chen-Yu Tsai
  2015-09-18 19:33       ` Maxime Ripard
  0 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18 16:18 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Chen-Yu Tsai, Maxime Ripard, linux-arm-kernel, linux-kernel, linux-sunxi

On Fri, Sep 18, 2015 at 11:30 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
> On 09/18/2015 03:35 AM, Chen-Yu Tsai wrote:
>>
>> The PWM controller has 2 outputs, with one usable pin for each.
>>
>> Add a pinmux setting for the first channel. This is often used
>> for backlight dimming on tablets.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>   arch/arm/boot/dts/sun8i-a23-a33.dtsi | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
>> b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
>> index e7054304018a..8f4db82084c5 100644
>> --- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
>> @@ -412,6 +412,13 @@
>>                                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>>                         };
>>
>> +                       pwm0_pins: pwm0 {
>
>
> This should be "pwm0_pins_a: pwm0@0" so as to be consistent with the a10 /
> a20 dtsi
> files.

This is the only possible setting. I do not see why we need "_a" for the
label and "@0" for the name. IMHO they are used to avoid name clashes when
there are multiple possible pinmux settings.


Regards
ChenYu

> Regards,
>
> Hans
>
>
>> +                               allwinner,pins = "PH0";
>> +                               allwinner,function = "pwm0";
>> +                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
>> +                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>> +                       };
>> +
>>                         i2c0_pins_a: i2c0@0 {
>>                                 allwinner,pins = "PH2", "PH3";
>>                                 allwinner,function = "i2c0";
>>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [linux-sunxi] [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets
  2015-09-18 15:32   ` [linux-sunxi] " Hans de Goede
@ 2015-09-18 16:25     ` Chen-Yu Tsai
  2015-09-19 21:39       ` Hans de Goede
  0 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2015-09-18 16:25 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Chen-Yu Tsai, Maxime Ripard, linux-arm-kernel, linux-kernel, linux-sunxi

On Fri, Sep 18, 2015 at 11:32 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
> On 09/18/2015 03:35 AM, Chen-Yu Tsai wrote:
>>
>> A23/A33 based Q8 format tablets use channel 0 of the PWM controller for
>> backlight dimming.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>   arch/arm/boot/dts/sun8i-q8-common.dtsi | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-q8-common.dtsi
>> b/arch/arm/boot/dts/sun8i-q8-common.dtsi
>> index 6f8a8bb4e9bb..4c2d0b459d6f 100644
>> --- a/arch/arm/boot/dts/sun8i-q8-common.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-q8-common.dtsi
>> @@ -70,6 +70,12 @@
>>         };
>>   };
>>
>> +&pwm {
>> +       pinctrl-names = "default";
>> +       pinctrl-0 = <&pwm0_pins>;
>> +       status = "okay";
>> +};
>> +
>>   &r_uart {
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&r_uart_pins_a>;
>>
>
> I've a feeling this should be in sunxi-q8-common.dtsi not
> sun8i-q8-common.dtsi, which requires adding a pwm
> node to sun5i.dtsi I'll look into this.

It probably should. IIRC sun5i PWM has only one channel as opposed to
2 on A10/A20.


ChenYu

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33
  2015-09-18  7:35 ` [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33 Chen-Yu Tsai
  2015-09-18 15:29   ` [linux-sunxi] " Hans de Goede
@ 2015-09-18 19:24   ` Maxime Ripard
  1 sibling, 0 replies; 13+ messages in thread
From: Maxime Ripard @ 2015-09-18 19:24 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: linux-arm-kernel, linux-kernel, linux-sunxi, Hans de Goede

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

On Fri, Sep 18, 2015 at 03:35:36PM +0800, Chen-Yu Tsai wrote:
> A23/A33 have a PWM controller that is compatible to the one on the A20.
> Add a device node for it.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [linux-sunxi] [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting for A23/A33
  2015-09-18 16:18     ` Chen-Yu Tsai
@ 2015-09-18 19:33       ` Maxime Ripard
  0 siblings, 0 replies; 13+ messages in thread
From: Maxime Ripard @ 2015-09-18 19:33 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: Hans de Goede, linux-arm-kernel, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]

On Sat, Sep 19, 2015 at 12:18:04AM +0800, Chen-Yu Tsai wrote:
> On Fri, Sep 18, 2015 at 11:30 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> > Hi,
> >
> > On 09/18/2015 03:35 AM, Chen-Yu Tsai wrote:
> >>
> >> The PWM controller has 2 outputs, with one usable pin for each.
> >>
> >> Add a pinmux setting for the first channel. This is often used
> >> for backlight dimming on tablets.
> >>
> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >> ---
> >>   arch/arm/boot/dts/sun8i-a23-a33.dtsi | 7 +++++++
> >>   1 file changed, 7 insertions(+)
> >>
> >> diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> >> b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> >> index e7054304018a..8f4db82084c5 100644
> >> --- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> >> +++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
> >> @@ -412,6 +412,13 @@
> >>                                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
> >>                         };
> >>
> >> +                       pwm0_pins: pwm0 {
> >
> >
> > This should be "pwm0_pins_a: pwm0@0" so as to be consistent with the a10 /
> > a20 dtsi
> > files.
> 
> This is the only possible setting. I do not see why we need "_a" for the
> label and "@0" for the name. IMHO they are used to avoid name clashes when
> there are multiple possible pinmux settings.

Yep, sounds reasonable, I applied the patch.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [linux-sunxi] [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets
  2015-09-18 16:25     ` Chen-Yu Tsai
@ 2015-09-19 21:39       ` Hans de Goede
  0 siblings, 0 replies; 13+ messages in thread
From: Hans de Goede @ 2015-09-19 21:39 UTC (permalink / raw)
  To: wens; +Cc: Maxime Ripard, linux-arm-kernel, linux-kernel, linux-sunxi

Hi,

On 09/18/2015 12:25 PM, Chen-Yu Tsai wrote:
> On Fri, Sep 18, 2015 at 11:32 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>> Hi,
>>
>> On 09/18/2015 03:35 AM, Chen-Yu Tsai wrote:
>>>
>>> A23/A33 based Q8 format tablets use channel 0 of the PWM controller for
>>> backlight dimming.
>>>
>>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>>> ---
>>>    arch/arm/boot/dts/sun8i-q8-common.dtsi | 6 ++++++
>>>    1 file changed, 6 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/sun8i-q8-common.dtsi
>>> b/arch/arm/boot/dts/sun8i-q8-common.dtsi
>>> index 6f8a8bb4e9bb..4c2d0b459d6f 100644
>>> --- a/arch/arm/boot/dts/sun8i-q8-common.dtsi
>>> +++ b/arch/arm/boot/dts/sun8i-q8-common.dtsi
>>> @@ -70,6 +70,12 @@
>>>          };
>>>    };
>>>
>>> +&pwm {
>>> +       pinctrl-names = "default";
>>> +       pinctrl-0 = <&pwm0_pins>;
>>> +       status = "okay";
>>> +};
>>> +
>>>    &r_uart {
>>>          pinctrl-names = "default";
>>>          pinctrl-0 = <&r_uart_pins_a>;
>>>
>>
>> I've a feeling this should be in sunxi-q8-common.dtsi not
>> sun8i-q8-common.dtsi, which requires adding a pwm
>> node to sun5i.dtsi I'll look into this.
>
> It probably should.

Which means the name of the pinctrl node should be the same
on both, hence my request to rename that. Anyways Maxime
has already merged that now, I'll workaround it and / or
do a followup patch.

> IIRC sun5i PWM has only one channel as opposed to
> 2 on A10/A20.

Nope sun5i has 2 channels, but the second channel is
only routed to the outside on A10s, not on A13.

Regards,

Hans


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-09-19 21:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18  7:35 [PATCH 0/4] ARM: dts: sun8i: Add pwm-backlight device for A23/A33 Q8 format tablets Chen-Yu Tsai
2015-09-18  7:35 ` [PATCH 1/4] ARM: dts: sun8i: Add PWM controller node for A23/A33 Chen-Yu Tsai
2015-09-18 15:29   ` [linux-sunxi] " Hans de Goede
2015-09-18 19:24   ` Maxime Ripard
2015-09-18  7:35 ` [PATCH 2/4] ARM: dts: sun8i: Add PWM channel 0 pinmux setting " Chen-Yu Tsai
2015-09-18 15:30   ` [linux-sunxi] " Hans de Goede
2015-09-18 16:18     ` Chen-Yu Tsai
2015-09-18 19:33       ` Maxime Ripard
2015-09-18  7:35 ` [PATCH 3/4] ARM: dts: sun8i: Enable PWM controller on A23/A33 Q8 format tablets Chen-Yu Tsai
2015-09-18 15:32   ` [linux-sunxi] " Hans de Goede
2015-09-18 16:25     ` Chen-Yu Tsai
2015-09-19 21:39       ` Hans de Goede
2015-09-18  7:35 ` [PATCH 4/4] ARM: dts: sun8i: Add pwm-backlight device for " Chen-Yu Tsai

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).