Skip to contentSkip to conversation

Add PWM and backlight support for Colibri VF61 modules

PATCH In review Bhuvanchandra DV 3 participants 8 messages Sep 22, 2014 – Sep 29, 2014 Device tree bindings

lore
Share & tools
lore
#0 lore raw

v3 cover Add PWM and backlight support for Colibri VF61 modules

Changes since v2:
[1] Droped the changes done in the root node.
[2] Fix typo in backlight node.

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        |   29 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 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        |   24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
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 +24 -0
index 0cd8343..1f73c1c 100644
@@ -44,6 +44,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 +107,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
#2 lore raw

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

Quoted 6 lines · Bhuvanchandra DV

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.

You should add Stefan's ACK tag.

Quoted 11 lines
---
 arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    8 ++++++++
 arch/arm/boot/dts/vf610-colibri.dtsi        |   24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +0 -0
index 7fb3066..00f63d9 100644
@@ -33,6 +33,14 @@
 	status = "okay";

arch/arm/boot/dts/vf610-colibri-eval-v3.dts line 43

Quoted 10 lines
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +8 -0
 };
 
+&pwm0 {
+	status = "okay";
+};
+
+&pwm1 {
+	status = "okay";
+};
+

I was trying to apply the patches, but found pwm1 is not available in vf610.dtsi at all. What tree is your patch generated against? Or did I miss any prerequisite patches?

Shawn

Quoted 48 lines
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +0 -0
 &uart0 {
 	status = "okay";
 };
arch/arm/boot/dts/vf610-colibri.dtsi +24 -0
index 0cd8343..1f73c1c 100644
@@ -44,6 +44,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 +107,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
#3 lore raw

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

Quoted 3 lines · Shawn Guo <shawn.guo <at> freescale.com> writes:

I was trying to apply the patches, but found pwm1 is not available in vf610.dtsi at all. What tree is your patch generated against? Or did I miss any prerequisite patches?

Yes, I guess for some reason he dropped that one from v3:

http://article.gmane.org/gmane.linux.ports.arm.kernel/357293

#4 lore raw

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

In reply to Shawn Guo
Quoted 8 lines · Shawn Guo
Quoted 6 lines · Bhuvanchandra DV

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.

You should add Stefan's ACK tag.

Ok

Quoted 25 lines
Quoted 11 lines
---
  arch/arm/boot/dts/vf610-colibri-eval-v3.dts |    8 ++++++++
  arch/arm/boot/dts/vf610-colibri.dtsi        |   24 ++++++++++++++++++++++++
  2 files changed, 32 insertions(+)
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +0 -0
index 7fb3066..00f63d9 100644
@@ -33,6 +33,14 @@
  	status = "okay";

arch/arm/boot/dts/vf610-colibri-eval-v3.dts line 43

Quoted 10 lines
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +8 -0
  };
 
+&pwm0 {
+	status = "okay";
+};
+
+&pwm1 {
+	status = "okay";
+};
+

I was trying to apply the patches, but found pwm1 is not available in vf610.dtsi at all. What tree is your patch generated against? Or did I miss any prerequisite patches?

Quoted 1 line

Shawn

One prerequisite patch(PATCH 1/3) was missed. Available over here:
https://lkml.org/lkml/2014/9/17/86

Quoted 48 lines
Quoted 48 lines
arch/arm/boot/dts/vf610-colibri-eval-v3.dts +0 -0
  &uart0 {
  	status = "okay";
  };
arch/arm/boot/dts/vf610-colibri.dtsi +24 -0
index 0cd8343..1f73c1c 100644
@@ -44,6 +44,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 +107,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
#5 lore raw

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

Quoted 2 lines · BhuvanChandra.DV

One prerequisite patch(PATCH 1/3) was missed. Available over here:
https://lkml.org/lkml/2014/9/17/86

For any prerequisite patches that haven't been applied, you should either include it in your series or mention the dependency in the cover letter.

For this thime, I just picked the prerequisite and applied these two with Stefan's ACK.

Shawn

#6 lore raw

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

Quoted 6 lines · Shawn Guo
Quoted 2 lines · BhuvanChandra.DV

One prerequisite patch(PATCH 1/3) was missed. Available over here:
https://lkml.org/lkml/2014/9/17/86

For any prerequisite patches that haven't been applied, you should either include it in your series or mention the dependency in the cover letter.

OK

Quoted 2 lines

For this thime, I just picked the prerequisite and applied these two with Stefan's ACK.

Thanks Shawn

Quoted 2 lines

Shawn

#7 lore raw

PATCH v3 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        |    5 +++++
 2 files changed, 11 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 +5 -0
index 1f73c1c..807953b 100644
@@ -25,6 +25,11 @@
 		};
 	};
 
+	bl: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm0 0 5000000 0>;
+		status = "disabled";
+	};
 };
 
 &esdhc1 {
Signature · 1 line
1.7.9.5