Skip to contentSkip to conversation

Add PWM and backlight support for Colibri VF61 modules

PATCH Superseded Bhuvanchandra DV 2 participants 7 messages Sep 19, 2014 – Sep 22, 2014 Device tree bindings

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add PWM and backlight support for Colibri VF61 modules

Changes since v1:
[1] Sorted the node names alphabetically.
[2] Updated the node name 'bl: backlight' to 'backlight: bl'.
[3] Dropped the leading space in 'pwm-names' property of backlight.

Bhuvanchandra DV (2):
ARM: dts: vf610-colibri: Add PWM support
ARM: dts: vf610-colibri: Add backlight support

 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |   14 ++++++++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |   33 +++++++++++++++++++++++++--
 2 files changed, 45 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/2 ARM: dts: vf610-colibri: Add PWM support

The Colibri standard defines four pins as PWM outputs, two of them (PWM A and C) are routed to FTM instance 0 and the other two (PWM B and D) are routed to FTM instance 1. Hence enable both FTM instances for the Colibri module and mux the four pins accordingly.

---
 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    8 +++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |   31 +++++++++++++++++++++++----
 2 files changed, 35 insertions(+), 4 deletions(-)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +8 -0
index 7fb3066..00f63d9 100644
@@ -33,6 +33,14 @@
 	status = "okay";
 };
 
+&pwm0 {
+	status = "okay";
+};
+
+&pwm1 {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
arch/arm/boot/dts/vf610-colibri.dtsi +27 -4
index 0cd8343..560cd69 100644
@@ -13,10 +13,6 @@
 	model = "Toradex Colibri VF61 COM";
 	compatible = "toradex,vf610-colibri_vf61", "fsl,vf610";
 
-	memory {
-		reg = <0x80000000 0x10000000>;
-	};
-
 	clocks {
 		enet_ext {
 			compatible = "fixed-clock";
@@ -25,6 +21,9 @@
 		};
 	};
 
+	memory {
+		reg = <0x80000000 0x10000000>;
+	};
 };
 
 &esdhc1 {
@@ -44,6 +43,16 @@
 	arm,tag-latency = <3 2 3>;
 };
 
+&pwm0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0>;
+};
+
+&pwm1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart0>;
@@ -97,6 +106,20 @@
 			>;
 		};
 
+		pinctrl_pwm0: pwm0grp {
+			fsl,pins = <
+				VF610_PAD_PTB0__FTM0_CH0		0x1182
+				VF610_PAD_PTB1__FTM0_CH1		0x1182
+			>;
+		};
+
+		pinctrl_pwm1: pwm1grp {
+			fsl,pins = <
+				VF610_PAD_PTB8__FTM1_CH0		0x1182
+				VF610_PAD_PTB9__FTM1_CH1		0x1182
+			>;
+		};
+
 		pinctrl_uart0: uart0grp {
 			fsl,pins = <
 				VF610_PAD_PTB10__UART0_TX		0x21a2
Signature · 1 line
1.7.9.5
Acked-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] ARM: dts: vf610-colibri: Add PWM support

Am 2014-09-19 15:38, schrieb Bhuvanchandra DV:

Quoted 48 lines

The Colibri standard defines four pins as PWM outputs, two of them (PWM A and C) are routed to FTM instance 0 and the other two (PWM B and D) are routed to FTM instance 1. Hence enable both FTM instances for the Colibri module and mux the four pins accordingly.

---
 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    8 +++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |   31 +++++++++++++++++++++++----
 2 files changed, 35 insertions(+), 4 deletions(-)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +8 -0
index 7fb3066..00f63d9 100644
@@ -33,6 +33,14 @@
 	status = "okay";
 };
 
+&pwm0 {
+	status = "okay";
+};
+
+&pwm1 {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
arch/arm/boot/dts/vf610-colibri.dtsi +0 -4
index 0cd8343..560cd69 100644
@@ -13,10 +13,6 @@
 	model = "Toradex Colibri VF61 COM";
 	compatible = "toradex,vf610-colibri_vf61", "fsl,vf610";
 
-	memory {
-		reg = <0x80000000 0x10000000>;
-	};
-
 	clocks {
 		enet_ext {
 			compatible = "fixed-clock";

arch/arm/boot/dts/vf610-colibri.dtsi line 26

Quoted 6 lines
arch/arm/boot/dts/vf610-colibri.dtsi +3 -0
@@ -25,6 +21,9 @@
 		};
 	};
 
+	memory {
+		reg = <0x80000000 0x10000000>;
+	};

Memory is a bit an exception here: In almost all device tree this is the first node after model/compatible. Also, it's generally not allowed to make changes outside of the topic (PWM in this case)... Hence I would drop this change.

The rest

Quoted 41 lines
arch/arm/boot/dts/vf610-colibri.dtsi +24 -0
 };
 
 &esdhc1 {
@@ -44,6 +43,16 @@
 	arm,tag-latency = <3 2 3>;
 };
 
+&pwm0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0>;
+};
+
+&pwm1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart0>;
@@ -97,6 +106,20 @@
 			>;
 		};
 
+		pinctrl_pwm0: pwm0grp {
+			fsl,pins = <
+				VF610_PAD_PTB0__FTM0_CH0		0x1182
+				VF610_PAD_PTB1__FTM0_CH1		0x1182
+			>;
+		};
+
+		pinctrl_pwm1: pwm1grp {
+			fsl,pins = <
+				VF610_PAD_PTB8__FTM1_CH0		0x1182
+				VF610_PAD_PTB9__FTM1_CH1		0x1182
+			>;
+		};
+
 		pinctrl_uart0: uart0grp {
 			fsl,pins = <
 				VF610_PAD_PTB10__UART0_TX		0x21a2
#3 lore raw

Re: [PATCH v2 1/2] ARM: dts: vf610-colibri: Add PWM support

Quoted 60 lines · Stefan Agner

Am 2014-09-19 15:38, schrieb Bhuvanchandra DV:

Quoted 48 lines

The Colibri standard defines four pins as PWM outputs, two of them (PWM A and C) are routed to FTM instance 0 and the other two (PWM B and D) are routed to FTM instance 1. Hence enable both FTM instances for the Colibri module and mux the four pins accordingly.

---
 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    8 +++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |   31 +++++++++++++++++++++++----
 2 files changed, 35 insertions(+), 4 deletions(-)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +8 -0
index 7fb3066..00f63d9 100644
@@ -33,6 +33,14 @@
 	status = "okay";
 };
 
+&pwm0 {
+	status = "okay";
+};
+
+&pwm1 {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
arch/arm/boot/dts/vf610-colibri.dtsi +0 -4
index 0cd8343..560cd69 100644
@@ -13,10 +13,6 @@
 	model = "Toradex Colibri VF61 COM";
 	compatible = "toradex,vf610-colibri_vf61", "fsl,vf610";
 
-	memory {
-		reg = <0x80000000 0x10000000>;
-	};
-
 	clocks {
 		enet_ext {
 			compatible = "fixed-clock";

arch/arm/boot/dts/vf610-colibri.dtsi line 26

Quoted 6 lines
arch/arm/boot/dts/vf610-colibri.dtsi +3 -0
@@ -25,6 +21,9 @@
 		};
 	};
 
+	memory {
+		reg = <0x80000000 0x10000000>;
+	};

Memory is a bit an exception here: In almost all device tree this is the first node after model/compatible. Also, it's generally not allowed to make changes outside of the topic (PWM in this case)... Hence I would drop this change.

Quoted 2 lines

The rest

OK. Will drop the change.

Quoted 41 lines
Quoted 41 lines
arch/arm/boot/dts/vf610-colibri.dtsi +24 -0
 };
 
 &esdhc1 {
@@ -44,6 +43,16 @@
 	arm,tag-latency = <3 2 3>;
 };
 
+&pwm0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0>;
+};
+
+&pwm1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart0>;
@@ -97,6 +106,20 @@
 			>;
 		};
 
+		pinctrl_pwm0: pwm0grp {
+			fsl,pins = <
+				VF610_PAD_PTB0__FTM0_CH0		0x1182
+				VF610_PAD_PTB1__FTM0_CH1		0x1182
+			>;
+		};
+
+		pinctrl_pwm1: pwm1grp {
+			fsl,pins = <
+				VF610_PAD_PTB8__FTM1_CH0		0x1182
+				VF610_PAD_PTB9__FTM1_CH1		0x1182
+			>;
+		};
+
 		pinctrl_uart0: uart0grp {
 			fsl,pins = <
 				VF610_PAD_PTB10__UART0_TX		0x21a2
#4 lore raw

PATCH v2 2/2 ARM: dts: vf610-colibri: Add backlight support

In reply to Bhuvanchandra DV
---
 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    6 ++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |    6 ++++++
 2 files changed, 12 insertions(+)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +6 -0
index 00f63d9..711cf82 100644
@@ -19,6 +19,12 @@
 	};
 };
 
+&bl {
+	brightness-levels = <0 4 8 16 32 64 128 255>;
+	default-brightness-level = <6>;
+	status  = "okay";
+};
+
 &esdhc1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_esdhc1>;
arch/arm/boot/dts/vf610-colibri.dtsi +6 -0
index 560cd69..20b1c15 100644
@@ -13,6 +13,12 @@
 	model = "Toradex Colibri VF61 COM";
 	compatible = "toradex,vf610-colibri_vf61", "fsl,vf610";
 
+	bl: backlight {
+		compitable = "pwm-backlight";
+		pwms = <&pwm0 0 5000000 0>;
+		status = "disabled";
+	};
+
 	clocks {
 		enet_ext {
 			compatible = "fixed-clock";
Signature · 1 line
1.7.9.5
Acked-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] ARM: dts: vf610-colibri: Add backlight support

Am 2014-09-19 15:38, schrieb Bhuvanchandra DV:

Quoted 30 lines
---
 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    6 ++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |    6 ++++++
 2 files changed, 12 insertions(+)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +6 -0
index 00f63d9..711cf82 100644
@@ -19,6 +19,12 @@
 	};
 };
 
+&bl {
+	brightness-levels = <0 4 8 16 32 64 128 255>;
+	default-brightness-level = <6>;
+	status  = "okay";
+};
+
 &esdhc1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_esdhc1>;
arch/arm/boot/dts/vf610-colibri.dtsi +0 -0
index 560cd69..20b1c15 100644

arch/arm/boot/dts/vf610-colibri.dtsi line 21

Quoted 9 lines
arch/arm/boot/dts/vf610-colibri.dtsi +6 -0
@@ -13,6 +13,12 @@
 	model = "Toradex Colibri VF61 COM";
 	compatible = "toradex,vf610-colibri_vf61", "fsl,vf610";
 
+	bl: backlight {
+		compitable = "pwm-backlight";
+		pwms = <&pwm0 0 5000000 0>;
+		status = "disabled";
+	};
+

Typo, "compitable" is not a valid property...

When this is fixed,

Quoted 3 lines
arch/arm/boot/dts/vf610-colibri.dtsi +0 -0
 	clocks {
 		enet_ext {
 			compatible = "fixed-clock";
#6 lore raw

Re: [PATCH v2 2/2] ARM: dts: vf610-colibri: Add backlight support

Quoted 42 lines · Stefan Agner

Am 2014-09-19 15:38, schrieb Bhuvanchandra DV:

Quoted 30 lines
---
 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    6 ++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |    6 ++++++
 2 files changed, 12 insertions(+)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +6 -0
index 00f63d9..711cf82 100644
@@ -19,6 +19,12 @@
 	};
 };
 
+&bl {
+	brightness-levels = <0 4 8 16 32 64 128 255>;
+	default-brightness-level = <6>;
+	status  = "okay";
+};
+
 &esdhc1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_esdhc1>;
arch/arm/boot/dts/vf610-colibri.dtsi +0 -0
index 560cd69..20b1c15 100644

arch/arm/boot/dts/vf610-colibri.dtsi line 21

Quoted 9 lines
arch/arm/boot/dts/vf610-colibri.dtsi +6 -0
@@ -13,6 +13,12 @@
 	model = "Toradex Colibri VF61 COM";
 	compatible = "toradex,vf610-colibri_vf61", "fsl,vf610";
 
+	bl: backlight {
+		compitable = "pwm-backlight";
+		pwms = <&pwm0 0 5000000 0>;
+		status = "disabled";
+	};
+

Typo, "compitable" is not a valid property...

Quoted 2 lines

When this is fixed,

Thanks for pointing it out. Will update accordingly.

Quoted 3 lines
Quoted 3 lines
arch/arm/boot/dts/vf610-colibri.dtsi +0 -0
 	clocks {
 		enet_ext {
 			compatible = "fixed-clock";