linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Update PWM support on stm32mp157 boards
@ 2019-11-05 12:52 Fabrice Gasnier
  2019-11-05 12:52 ` [PATCH 1/4] ARM: dts: stm32: add pwm sleep pin muxing for stm32mp157c-ed1 Fabrice Gasnier
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Fabrice Gasnier @ 2019-11-05 12:52 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

This series update PWM support on stm32mp157c-ev1 and stm32mp157a-dk1
boards, e.g. add pinmuxing and use them in board device-tree.
- Add PWM sleep pins that can be used on stm32mp157c-ev1 board
- Add PWM pins that can be used on stm32mp157a-dk1 board
- Add PWM pinctrl sleep state on stm32mp157c-ev1 board
- Add PWM support on stm32mp157a-dk1 board

Fabrice Gasnier (4):
  ARM: dts: stm32: add pwm sleep pin muxing for stm32mp157c-ed1
  ARM: dts: stm32: add pwm pin muxing for stm32mp157a-dk1
  ARM: dts: stm32: add pwm sleep pins to stm32mp157c-ev1
  ARM: dts: stm32: add support for PWM on stm32mp157a-dk1

 arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 99 +++++++++++++++++++++++++++++++
 arch/arm/boot/dts/stm32mp157a-dk1.dts     | 85 ++++++++++++++++++++++++++
 arch/arm/boot/dts/stm32mp157c-ev1.dts     |  9 ++-
 3 files changed, 190 insertions(+), 3 deletions(-)

-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/4] ARM: dts: stm32: add pwm sleep pin muxing for stm32mp157c-ed1
  2019-11-05 12:52 [PATCH 0/4] Update PWM support on stm32mp157 boards Fabrice Gasnier
@ 2019-11-05 12:52 ` Fabrice Gasnier
  2019-11-05 12:52 ` [PATCH 2/4] ARM: dts: stm32: add pwm pin muxing for stm32mp157a-dk1 Fabrice Gasnier
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Fabrice Gasnier @ 2019-11-05 12:52 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

Add PWM pinctrl definitions used in low-power (sleep) mode on
stm32mp157c-ed1.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
index 1e45b75..de5679f 100644
--- a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
@@ -596,6 +596,12 @@
 				};
 			};
 
+			pwm2_sleep_pins_a: pwm2-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('A', 3, ANALOG)>; /* TIM2_CH4 */
+				};
+			};
+
 			pwm8_pins_a: pwm8-0 {
 				pins {
 					pinmux = <STM32_PINMUX('I', 2, AF3)>; /* TIM8_CH4 */
@@ -605,6 +611,12 @@
 				};
 			};
 
+			pwm8_sleep_pins_a: pwm8-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('I', 2, ANALOG)>; /* TIM8_CH4 */
+				};
+			};
+
 			pwm12_pins_a: pwm12-0 {
 				pins {
 					pinmux = <STM32_PINMUX('H', 6, AF2)>; /* TIM12_CH1 */
@@ -614,6 +626,12 @@
 				};
 			};
 
+			pwm12_sleep_pins_a: pwm12-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('H', 6, ANALOG)>; /* TIM12_CH1 */
+				};
+			};
+
 			qspi_clk_pins_a: qspi-clk-0 {
 				pins {
 					pinmux = <STM32_PINMUX('F', 10, AF9)>; /* QSPI_CLK */
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/4] ARM: dts: stm32: add pwm pin muxing for stm32mp157a-dk1
  2019-11-05 12:52 [PATCH 0/4] Update PWM support on stm32mp157 boards Fabrice Gasnier
  2019-11-05 12:52 ` [PATCH 1/4] ARM: dts: stm32: add pwm sleep pin muxing for stm32mp157c-ed1 Fabrice Gasnier
@ 2019-11-05 12:52 ` Fabrice Gasnier
  2019-11-05 12:52 ` [PATCH 3/4] ARM: dts: stm32: add pwm sleep pins to stm32mp157c-ev1 Fabrice Gasnier
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Fabrice Gasnier @ 2019-11-05 12:52 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

Add all PWM pinctrl definitions that can be used on stm32mp157a-dk1 board.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 81 +++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
index de5679f..0f42ab1 100644
--- a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
@@ -587,6 +587,25 @@
 				};
 			};
 
+			pwm1_pins_a: pwm1-0 {
+				pins {
+					pinmux = <STM32_PINMUX('E', 9, AF1)>, /* TIM1_CH1 */
+						 <STM32_PINMUX('E', 11, AF1)>, /* TIM1_CH2 */
+						 <STM32_PINMUX('E', 14, AF1)>; /* TIM1_CH4 */
+					bias-pull-down;
+					drive-push-pull;
+					slew-rate = <0>;
+				};
+			};
+
+			pwm1_sleep_pins_a: pwm1-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('E', 9, ANALOG)>, /* TIM1_CH1 */
+						 <STM32_PINMUX('E', 11, ANALOG)>, /* TIM1_CH2 */
+						 <STM32_PINMUX('E', 14, ANALOG)>; /* TIM1_CH4 */
+				};
+			};
+
 			pwm2_pins_a: pwm2-0 {
 				pins {
 					pinmux = <STM32_PINMUX('A', 3, AF1)>; /* TIM2_CH4 */
@@ -602,6 +621,68 @@
 				};
 			};
 
+			pwm3_pins_a: pwm3-0 {
+				pins {
+					pinmux = <STM32_PINMUX('C', 7, AF2)>; /* TIM3_CH2 */
+					bias-pull-down;
+					drive-push-pull;
+					slew-rate = <0>;
+				};
+			};
+
+			pwm3_sleep_pins_a: pwm3-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('C', 7, ANALOG)>; /* TIM3_CH2 */
+				};
+			};
+
+			pwm4_pins_a: pwm4-0 {
+				pins {
+					pinmux = <STM32_PINMUX('D', 14, AF2)>, /* TIM4_CH3 */
+						 <STM32_PINMUX('D', 15, AF2)>; /* TIM4_CH4 */
+					bias-pull-down;
+					drive-push-pull;
+					slew-rate = <0>;
+				};
+			};
+
+			pwm4_sleep_pins_a: pwm4-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('D', 14, ANALOG)>, /* TIM4_CH3 */
+						 <STM32_PINMUX('D', 15, ANALOG)>; /* TIM4_CH4 */
+				};
+			};
+
+			pwm4_pins_b: pwm4-1 {
+				pins {
+					pinmux = <STM32_PINMUX('D', 13, AF2)>; /* TIM4_CH2 */
+					bias-pull-down;
+					drive-push-pull;
+					slew-rate = <0>;
+				};
+			};
+
+			pwm4_sleep_pins_b: pwm4-sleep-1 {
+				pins {
+					pinmux = <STM32_PINMUX('D', 13, ANALOG)>; /* TIM4_CH2 */
+				};
+			};
+
+			pwm5_pins_a: pwm5-0 {
+				pins {
+					pinmux = <STM32_PINMUX('H', 11, AF2)>; /* TIM5_CH2 */
+					bias-pull-down;
+					drive-push-pull;
+					slew-rate = <0>;
+				};
+			};
+
+			pwm5_sleep_pins_a: pwm5-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('H', 11, ANALOG)>; /* TIM5_CH2 */
+				};
+			};
+
 			pwm8_pins_a: pwm8-0 {
 				pins {
 					pinmux = <STM32_PINMUX('I', 2, AF3)>; /* TIM8_CH4 */
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/4] ARM: dts: stm32: add pwm sleep pins to stm32mp157c-ev1
  2019-11-05 12:52 [PATCH 0/4] Update PWM support on stm32mp157 boards Fabrice Gasnier
  2019-11-05 12:52 ` [PATCH 1/4] ARM: dts: stm32: add pwm sleep pin muxing for stm32mp157c-ed1 Fabrice Gasnier
  2019-11-05 12:52 ` [PATCH 2/4] ARM: dts: stm32: add pwm pin muxing for stm32mp157a-dk1 Fabrice Gasnier
@ 2019-11-05 12:52 ` Fabrice Gasnier
  2019-11-05 12:52 ` [PATCH 4/4] ARM: dts: stm32: add support for PWM on stm32mp157a-dk1 Fabrice Gasnier
  2019-11-15 10:37 ` [PATCH 0/4] Update PWM support on stm32mp157 boards Alexandre Torgue
  4 siblings, 0 replies; 6+ messages in thread
From: Fabrice Gasnier @ 2019-11-05 12:52 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

Add pinctrl sleep state for PWM on stm32mp157c-ev1 board.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 arch/arm/boot/dts/stm32mp157c-ev1.dts | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
index 2baae5f..7ab5dbd 100644
--- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
@@ -305,7 +305,8 @@
 	status = "disabled";
 	pwm {
 		pinctrl-0 = <&pwm2_pins_a>;
-		pinctrl-names = "default";
+		pinctrl-1 = <&pwm2_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
 		status = "okay";
 	};
 	timer@1 {
@@ -319,7 +320,8 @@
 	status = "disabled";
 	pwm {
 		pinctrl-0 = <&pwm8_pins_a>;
-		pinctrl-names = "default";
+		pinctrl-1 = <&pwm8_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
 		status = "okay";
 	};
 	timer@7 {
@@ -333,7 +335,8 @@
 	status = "disabled";
 	pwm {
 		pinctrl-0 = <&pwm12_pins_a>;
-		pinctrl-names = "default";
+		pinctrl-1 = <&pwm12_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
 		status = "okay";
 	};
 	timer@11 {
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/4] ARM: dts: stm32: add support for PWM on stm32mp157a-dk1
  2019-11-05 12:52 [PATCH 0/4] Update PWM support on stm32mp157 boards Fabrice Gasnier
                   ` (2 preceding siblings ...)
  2019-11-05 12:52 ` [PATCH 3/4] ARM: dts: stm32: add pwm sleep pins to stm32mp157c-ev1 Fabrice Gasnier
@ 2019-11-05 12:52 ` Fabrice Gasnier
  2019-11-15 10:37 ` [PATCH 0/4] Update PWM support on stm32mp157 boards Alexandre Torgue
  4 siblings, 0 replies; 6+ messages in thread
From: Fabrice Gasnier @ 2019-11-05 12:52 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	fabrice.gasnier, linux-stm32, linux-arm-kernel

Add PWM support on stm32mp157a-dk1 board. There are several timers channels
made available on GPIO expansion and arduino connectors:
- Add PWM and trigger support (these timers can also be used as trigger
  for ADC).
It's easier then to configure them all. But keep them disabled by default,
so the pins are kept in their initial state to lower power consumption.
This way they can also be used as GPIO.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 arch/arm/boot/dts/stm32mp157a-dk1.dts | 85 +++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp157a-dk1.dts b/arch/arm/boot/dts/stm32mp157a-dk1.dts
index 984a47c..d4e37ab 100644
--- a/arch/arm/boot/dts/stm32mp157a-dk1.dts
+++ b/arch/arm/boot/dts/stm32mp157a-dk1.dts
@@ -502,6 +502,91 @@
 	status = "okay";
 };
 
+&timers1 {
+	/* spare dmas for other usage */
+	/delete-property/dmas;
+	/delete-property/dma-names;
+	status = "disabled";
+	pwm {
+		pinctrl-0 = <&pwm1_pins_a>;
+		pinctrl-1 = <&pwm1_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
+		status = "okay";
+	};
+	timer@0 {
+		status = "okay";
+	};
+};
+
+&timers3 {
+	/delete-property/dmas;
+	/delete-property/dma-names;
+	status = "disabled";
+	pwm {
+		pinctrl-0 = <&pwm3_pins_a>;
+		pinctrl-1 = <&pwm3_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
+		status = "okay";
+	};
+	timer@2 {
+		status = "okay";
+	};
+};
+
+&timers4 {
+	/delete-property/dmas;
+	/delete-property/dma-names;
+	status = "disabled";
+	pwm {
+		pinctrl-0 = <&pwm4_pins_a &pwm4_pins_b>;
+		pinctrl-1 = <&pwm4_sleep_pins_a &pwm4_sleep_pins_b>;
+		pinctrl-names = "default", "sleep";
+		status = "okay";
+	};
+	timer@3 {
+		status = "okay";
+	};
+};
+
+&timers5 {
+	/delete-property/dmas;
+	/delete-property/dma-names;
+	status = "disabled";
+	pwm {
+		pinctrl-0 = <&pwm5_pins_a>;
+		pinctrl-1 = <&pwm5_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
+		status = "okay";
+	};
+	timer@4 {
+		status = "okay";
+	};
+};
+
+&timers6 {
+	/delete-property/dmas;
+	/delete-property/dma-names;
+	status = "disabled";
+	timer@5 {
+		status = "okay";
+	};
+};
+
+&timers12 {
+	/delete-property/dmas;
+	/delete-property/dma-names;
+	status = "disabled";
+	pwm {
+		pinctrl-0 = <&pwm12_pins_a>;
+		pinctrl-1 = <&pwm12_sleep_pins_a>;
+		pinctrl-names = "default", "sleep";
+		status = "okay";
+	};
+	timer@11 {
+		status = "okay";
+	};
+};
+
 &uart4 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart4_pins_a>;
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/4] Update PWM support on stm32mp157 boards
  2019-11-05 12:52 [PATCH 0/4] Update PWM support on stm32mp157 boards Fabrice Gasnier
                   ` (3 preceding siblings ...)
  2019-11-05 12:52 ` [PATCH 4/4] ARM: dts: stm32: add support for PWM on stm32mp157a-dk1 Fabrice Gasnier
@ 2019-11-15 10:37 ` Alexandre Torgue
  4 siblings, 0 replies; 6+ messages in thread
From: Alexandre Torgue @ 2019-11-15 10:37 UTC (permalink / raw)
  To: Fabrice Gasnier
  Cc: mark.rutland, devicetree, linux-kernel, robh+dt, mcoquelin.stm32,
	linux-stm32, linux-arm-kernel

Hi Fabrice

On 11/5/19 1:52 PM, Fabrice Gasnier wrote:
> This series update PWM support on stm32mp157c-ev1 and stm32mp157a-dk1
> boards, e.g. add pinmuxing and use them in board device-tree.
> - Add PWM sleep pins that can be used on stm32mp157c-ev1 board
> - Add PWM pins that can be used on stm32mp157a-dk1 board
> - Add PWM pinctrl sleep state on stm32mp157c-ev1 board
> - Add PWM support on stm32mp157a-dk1 board
> 
> Fabrice Gasnier (4):
>    ARM: dts: stm32: add pwm sleep pin muxing for stm32mp157c-ed1
>    ARM: dts: stm32: add pwm pin muxing for stm32mp157a-dk1
>    ARM: dts: stm32: add pwm sleep pins to stm32mp157c-ev1
>    ARM: dts: stm32: add support for PWM on stm32mp157a-dk1
> 
>   arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 99 +++++++++++++++++++++++++++++++
>   arch/arm/boot/dts/stm32mp157a-dk1.dts     | 85 ++++++++++++++++++++++++++
>   arch/arm/boot/dts/stm32mp157c-ev1.dts     |  9 ++-
>   3 files changed, 190 insertions(+), 3 deletions(-)
> 

Series applied on stm32-next. I just rename patch1 to be more coherent 
with your explanation done in cover letter.

Regards
Alex

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-11-15 10:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 12:52 [PATCH 0/4] Update PWM support on stm32mp157 boards Fabrice Gasnier
2019-11-05 12:52 ` [PATCH 1/4] ARM: dts: stm32: add pwm sleep pin muxing for stm32mp157c-ed1 Fabrice Gasnier
2019-11-05 12:52 ` [PATCH 2/4] ARM: dts: stm32: add pwm pin muxing for stm32mp157a-dk1 Fabrice Gasnier
2019-11-05 12:52 ` [PATCH 3/4] ARM: dts: stm32: add pwm sleep pins to stm32mp157c-ev1 Fabrice Gasnier
2019-11-05 12:52 ` [PATCH 4/4] ARM: dts: stm32: add support for PWM on stm32mp157a-dk1 Fabrice Gasnier
2019-11-15 10:37 ` [PATCH 0/4] Update PWM support on stm32mp157 boards Alexandre Torgue

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