linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl
@ 2015-12-02 22:11 Stefan Agner
  2015-12-02 22:11 ` [PATCH 2/2] ARM: dts: vf-colibri: add CAN support Stefan Agner
  2015-12-14  2:18 ` [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl Shawn Guo
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Agner @ 2015-12-02 22:11 UTC (permalink / raw)
  To: shawnguo, kernel; +Cc: devicetree, linux-arm-kernel, linux-kernel, Stefan Agner

Split PWM pins into separate pinctrl nodes to allow overrides which
select pins individually. This is useful for carrier boards which use
only one pin for PWM and would like to use the other pin for a
different purpose.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/boot/dts/vf-colibri.dtsi | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
index e5949b9..924b660 100644
--- a/arch/arm/boot/dts/vf-colibri.dtsi
+++ b/arch/arm/boot/dts/vf-colibri.dtsi
@@ -74,12 +74,12 @@
 
 &pwm0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_pwm0>;
+	pinctrl-0 = <&pinctrl_pwm0_a &pinctrl_pwm0_c>;
 };
 
 &pwm1 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_pwm1>;
+	pinctrl-0 = <&pinctrl_pwm1_b &pinctrl_pwm1_d>;
 };
 
 &uart0 {
@@ -195,16 +195,26 @@
 			>;
 		};
 
-		pinctrl_pwm0: pwm0grp {
+		pinctrl_pwm0_a: pwm0agrp {
 			fsl,pins = <
 				VF610_PAD_PTB0__FTM0_CH0		0x1182
+			>;
+		};
+
+		pinctrl_pwm0_c: pwm0cgrp {
+			fsl,pins = <
 				VF610_PAD_PTB1__FTM0_CH1		0x1182
 			>;
 		};
 
-		pinctrl_pwm1: pwm1grp {
+		pinctrl_pwm1_b: pwm1bgrp {
 			fsl,pins = <
 				VF610_PAD_PTB8__FTM1_CH0		0x1182
+			>;
+		};
+
+		pinctrl_pwm1_d: pwm1dgrp {
+			fsl,pins = <
 				VF610_PAD_PTB9__FTM1_CH1		0x1182
 			>;
 		};
-- 
2.6.2


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

* [PATCH 2/2] ARM: dts: vf-colibri: add CAN support
  2015-12-02 22:11 [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl Stefan Agner
@ 2015-12-02 22:11 ` Stefan Agner
  2015-12-14  2:26   ` Shawn Guo
  2015-12-14  2:18 ` [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl Shawn Guo
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Agner @ 2015-12-02 22:11 UTC (permalink / raw)
  To: shawnguo, kernel; +Cc: devicetree, linux-arm-kernel, linux-kernel, Stefan Agner

Add Colibri standard pinmux for FlexCAN controller instances. CAN
is not a standard Colibri feature, but the datasheet predefines
pins which provide CAN (compatible across some modules). Hence,
add the pinmux on module level.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/boot/dts/vf-colibri.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
index 924b660..4f798a8 100644
--- a/arch/arm/boot/dts/vf-colibri.dtsi
+++ b/arch/arm/boot/dts/vf-colibri.dtsi
@@ -23,6 +23,18 @@
 	status = "okay";
 };
 
+&can0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flexcan0>;
+	status = "disabled";
+};
+
+&can1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flexcan1>;
+	status = "disabled";
+};
+
 &dspi1 {
 	bus-num = <1>;
 	pinctrl-names = "default";
@@ -125,6 +137,20 @@
 
 &iomuxc {
 	vf610-colibri {
+		pinctrl_flexcan0: can0grp {
+			fsl,pins = <
+				VF610_PAD_PTB14__CAN0_RX	0x31F1
+				VF610_PAD_PTB15__CAN0_TX	0x31F2
+			>;
+		};
+
+		pinctrl_flexcan1: can1grp {
+			fsl,pins = <
+				VF610_PAD_PTB16__CAN1_RX	0x31F1
+				VF610_PAD_PTB17__CAN1_TX	0x31F2
+			>;
+		};
+
 		pinctrl_gpio_ext: gpio_ext {
 			fsl,pins = <
 				VF610_PAD_PTD10__GPIO_89	0x22ed /* EXT_IO_0 */
-- 
2.6.2


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

* Re: [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl
  2015-12-02 22:11 [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl Stefan Agner
  2015-12-02 22:11 ` [PATCH 2/2] ARM: dts: vf-colibri: add CAN support Stefan Agner
@ 2015-12-14  2:18 ` Shawn Guo
  2015-12-14  2:53   ` Stefan Agner
  1 sibling, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2015-12-14  2:18 UTC (permalink / raw)
  To: Stefan Agner; +Cc: kernel, devicetree, linux-arm-kernel, linux-kernel

On Wed, Dec 02, 2015 at 02:11:46PM -0800, Stefan Agner wrote:
> Split PWM pins into separate pinctrl nodes to allow overrides which
> select pins individually. This is useful for carrier boards which use
> only one pin for PWM and would like to use the other pin for a
> different purpose.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
>  arch/arm/boot/dts/vf-colibri.dtsi | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
> index e5949b9..924b660 100644
> --- a/arch/arm/boot/dts/vf-colibri.dtsi
> +++ b/arch/arm/boot/dts/vf-colibri.dtsi
> @@ -74,12 +74,12 @@
>  
>  &pwm0 {
>  	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_pwm0>;
> +	pinctrl-0 = <&pinctrl_pwm0_a &pinctrl_pwm0_c>;
>  };
>  
>  &pwm1 {
>  	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_pwm1>;
> +	pinctrl-0 = <&pinctrl_pwm1_b &pinctrl_pwm1_d>;
>  };

It may make more sense to define these pwm nodes in the final board
level dts with only defining the pins that are actually used on the
board.

Shawn

>  
>  &uart0 {
> @@ -195,16 +195,26 @@
>  			>;
>  		};
>  
> -		pinctrl_pwm0: pwm0grp {
> +		pinctrl_pwm0_a: pwm0agrp {
>  			fsl,pins = <
>  				VF610_PAD_PTB0__FTM0_CH0		0x1182
> +			>;
> +		};
> +
> +		pinctrl_pwm0_c: pwm0cgrp {
> +			fsl,pins = <
>  				VF610_PAD_PTB1__FTM0_CH1		0x1182
>  			>;
>  		};
>  
> -		pinctrl_pwm1: pwm1grp {
> +		pinctrl_pwm1_b: pwm1bgrp {
>  			fsl,pins = <
>  				VF610_PAD_PTB8__FTM1_CH0		0x1182
> +			>;
> +		};
> +
> +		pinctrl_pwm1_d: pwm1dgrp {
> +			fsl,pins = <
>  				VF610_PAD_PTB9__FTM1_CH1		0x1182
>  			>;
>  		};
> -- 
> 2.6.2
> 
> 

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

* Re: [PATCH 2/2] ARM: dts: vf-colibri: add CAN support
  2015-12-02 22:11 ` [PATCH 2/2] ARM: dts: vf-colibri: add CAN support Stefan Agner
@ 2015-12-14  2:26   ` Shawn Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2015-12-14  2:26 UTC (permalink / raw)
  To: Stefan Agner; +Cc: kernel, devicetree, linux-arm-kernel, linux-kernel

On Wed, Dec 02, 2015 at 02:11:47PM -0800, Stefan Agner wrote:
> Add Colibri standard pinmux for FlexCAN controller instances. CAN
> is not a standard Colibri feature, but the datasheet predefines
> pins which provide CAN (compatible across some modules). Hence,
> add the pinmux on module level.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Applied, thanks.

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

* Re: [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl
  2015-12-14  2:18 ` [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl Shawn Guo
@ 2015-12-14  2:53   ` Stefan Agner
  2015-12-21 13:46     ` Shawn Guo
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Agner @ 2015-12-14  2:53 UTC (permalink / raw)
  To: Shawn Guo; +Cc: kernel, devicetree, linux-arm-kernel, linux-kernel

On 2015-12-13 18:18, Shawn Guo wrote:
> On Wed, Dec 02, 2015 at 02:11:46PM -0800, Stefan Agner wrote:
>> Split PWM pins into separate pinctrl nodes to allow overrides which
>> select pins individually. This is useful for carrier boards which use
>> only one pin for PWM and would like to use the other pin for a
>> different purpose.
>>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>> ---
>>  arch/arm/boot/dts/vf-colibri.dtsi | 18 ++++++++++++++----
>>  1 file changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
>> index e5949b9..924b660 100644
>> --- a/arch/arm/boot/dts/vf-colibri.dtsi
>> +++ b/arch/arm/boot/dts/vf-colibri.dtsi
>> @@ -74,12 +74,12 @@
>>
>>  &pwm0 {
>>  	pinctrl-names = "default";
>> -	pinctrl-0 = <&pinctrl_pwm0>;
>> +	pinctrl-0 = <&pinctrl_pwm0_a &pinctrl_pwm0_c>;
>>  };
>>
>>  &pwm1 {
>>  	pinctrl-names = "default";
>> -	pinctrl-0 = <&pinctrl_pwm1>;
>> +	pinctrl-0 = <&pinctrl_pwm1_b &pinctrl_pwm1_d>;
>>  };
> 
> It may make more sense to define these pwm nodes in the final board
> level dts with only defining the pins that are actually used on the
> board.

Well, if we follow that policy, we would have to remove almost anything
from the -colibri.dtsi device trees...

The Colibri standard defines standard functionality, which is kept
compatible across modules with different SoC's. However, on almost all
pins different functionality is available, and we have some customer
which make use that....

So far we followed the policy that we define the pin/device
configuration of the standard functionality in the -colibri.dtsi files
(since this is the most used functionality). This allows us to also
"bug-fix" standard functionality without having to touch customers
(often out-of-tree) device trees.

This change is not different from that approach, it merely splits the
pin configuration in two individual pinctrl nodes. This makes sense for
PWM signals since they can be used individually (compared to, lets say,
I2C, where it is more like "all or nothing")...  It turned out that
several customers used PWM<A> for the display back light, while using
PWM<C> in a different function, therefor that change.

--
Stefan

>>
>>  &uart0 {
>> @@ -195,16 +195,26 @@
>>  			>;
>>  		};
>>
>> -		pinctrl_pwm0: pwm0grp {
>> +		pinctrl_pwm0_a: pwm0agrp {
>>  			fsl,pins = <
>>  				VF610_PAD_PTB0__FTM0_CH0		0x1182
>> +			>;
>> +		};
>> +
>> +		pinctrl_pwm0_c: pwm0cgrp {
>> +			fsl,pins = <
>>  				VF610_PAD_PTB1__FTM0_CH1		0x1182
>>  			>;
>>  		};
>>
>> -		pinctrl_pwm1: pwm1grp {
>> +		pinctrl_pwm1_b: pwm1bgrp {
>>  			fsl,pins = <
>>  				VF610_PAD_PTB8__FTM1_CH0		0x1182
>> +			>;
>> +		};
>> +
>> +		pinctrl_pwm1_d: pwm1dgrp {
>> +			fsl,pins = <
>>  				VF610_PAD_PTB9__FTM1_CH1		0x1182
>>  			>;
>>  		};
>> --
>> 2.6.2
>>
>>

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

* Re: [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl
  2015-12-14  2:53   ` Stefan Agner
@ 2015-12-21 13:46     ` Shawn Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2015-12-21 13:46 UTC (permalink / raw)
  To: Stefan Agner; +Cc: kernel, devicetree, linux-arm-kernel, linux-kernel

On Sun, Dec 13, 2015 at 06:53:35PM -0800, Stefan Agner wrote:
> On 2015-12-13 18:18, Shawn Guo wrote:
> > On Wed, Dec 02, 2015 at 02:11:46PM -0800, Stefan Agner wrote:
> >> Split PWM pins into separate pinctrl nodes to allow overrides which
> >> select pins individually. This is useful for carrier boards which use
> >> only one pin for PWM and would like to use the other pin for a
> >> different purpose.
> >>
> >> Signed-off-by: Stefan Agner <stefan@agner.ch>
> >> ---
> >>  arch/arm/boot/dts/vf-colibri.dtsi | 18 ++++++++++++++----
> >>  1 file changed, 14 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
> >> index e5949b9..924b660 100644
> >> --- a/arch/arm/boot/dts/vf-colibri.dtsi
> >> +++ b/arch/arm/boot/dts/vf-colibri.dtsi
> >> @@ -74,12 +74,12 @@
> >>
> >>  &pwm0 {
> >>  	pinctrl-names = "default";
> >> -	pinctrl-0 = <&pinctrl_pwm0>;
> >> +	pinctrl-0 = <&pinctrl_pwm0_a &pinctrl_pwm0_c>;
> >>  };
> >>
> >>  &pwm1 {
> >>  	pinctrl-names = "default";
> >> -	pinctrl-0 = <&pinctrl_pwm1>;
> >> +	pinctrl-0 = <&pinctrl_pwm1_b &pinctrl_pwm1_d>;
> >>  };
> > 
> > It may make more sense to define these pwm nodes in the final board
> > level dts with only defining the pins that are actually used on the
> > board.
> 
> Well, if we follow that policy, we would have to remove almost anything
> from the -colibri.dtsi device trees...
> 
> The Colibri standard defines standard functionality, which is kept
> compatible across modules with different SoC's. However, on almost all
> pins different functionality is available, and we have some customer
> which make use that....
> 
> So far we followed the policy that we define the pin/device
> configuration of the standard functionality in the -colibri.dtsi files
> (since this is the most used functionality). This allows us to also
> "bug-fix" standard functionality without having to touch customers
> (often out-of-tree) device trees.
> 
> This change is not different from that approach, it merely splits the
> pin configuration in two individual pinctrl nodes. This makes sense for
> PWM signals since they can be used individually (compared to, lets say,
> I2C, where it is more like "all or nothing")...  It turned out that
> several customers used PWM<A> for the display back light, while using
> PWM<C> in a different function, therefor that change.

Okay, sounds reasonable.  But please be consistent on the naming.  I
would expect the pin groups named in scheme
pinctrl_<device><0,1,2...>_<a,b,c...>.  That said, in this case of pwm,
they should be something like below.

 - pinctrl_pwm0_a
 - pinctrl_pwm0_b
 - pinctrl_pwm1_a
 - pinctrl_pwm1_b

Shawn

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

end of thread, other threads:[~2015-12-21 13:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02 22:11 [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl Stefan Agner
2015-12-02 22:11 ` [PATCH 2/2] ARM: dts: vf-colibri: add CAN support Stefan Agner
2015-12-14  2:26   ` Shawn Guo
2015-12-14  2:18 ` [PATCH 1/2] ARM: dts: vf-colibri: split PWM pinctrl Shawn Guo
2015-12-14  2:53   ` Stefan Agner
2015-12-21 13:46     ` Shawn Guo

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