Skip to contentSkip to conversation

arm: dts: lpc32xx: Set motor control PWM clock as required one

PATCH In review Vladimir Zapolskiy 3 participants 7 messages Dec 28, 2025 – Jan 20

Subsystems (4)
lore
Share & tools
lore

Vladimir Zapolskiy

author maintainer
#0 lore raw

cover arm: dts: lpc32xx: Set motor control PWM clock as required one

Motor Control PWM depends on its own supply clock, the clock gate control is present in TIMCLK_CTRL1 register.

Vladimir Zapolskiy (2):
dt-bindings: pwm: nxp,lpc32xx-pwm: Specify clocks property as mandatory
arm: dts: lpc32xx: add clocks property to Motor Control PWM device tree node

 Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml | 4 ++++
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi                     | 1 +
 2 files changed, 5 insertions(+)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/2 dt-bindings: pwm: nxp,lpc32xx-pwm: Specify clocks property as mandatory

Both described in the binding PWM controllers depend on supply clocks, thus it's necessary to specify 'clocks' property in the correspondent device tree nodes.

---
 Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml +4 -0
index d8ebb0735c96..cdd83ac29caf 100644
@@ -27,6 +27,7 @@ properties:
 required:
   - compatible
   - reg
+  - clocks
   - '#pwm-cells'
 
 allOf:
@@ -36,9 +37,12 @@ unevaluatedProperties: false
 
 examples:
   - |
+    #include <dt-bindings/clock/lpc32xx-clock.h>
+
     pwm@4005c000 {
         compatible = "nxp,lpc3220-pwm";
         reg = <0x4005c000 0x4>;
+        clocks = <&clk LPC32XX_CLK_PWM1>;
         #pwm-cells = <3>;
     };
 
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: pwm: nxp,lpc32xx-pwm: Specify clocks property as mandatory

Quoted 9 lines · Vladimir Zapolskiy

Both described in the binding PWM controllers depend on supply clocks, thus it's necessary to specify 'clocks' property in the correspondent device tree nodes.

---
 Documentation/devicetree/bindings/pwm/nxp,lpc3220-pwm.yaml | 4 ++++
 1 file changed, 4 insertions(+)
#3 lore raw

Re: [PATCH 1/2] dt-bindings: pwm: nxp,lpc32xx-pwm: Specify clocks property as mandatory

In reply to Vladimir Zapolskiy

Hello,

Quoted 5 lines · Vladimir Zapolskiy

Both described in the binding PWM controllers depend on supply clocks, thus it's necessary to specify 'clocks' property in the correspondent device tree nodes.

LGTM, I applied it with Rob's Ack to

https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next

as 6.20-rc1 material.

Best regards
Uwe

author maintainer
#4 lore raw

PATCH 2/2 arm: dts: lpc32xx: add clocks property to Motor Control PWM device tree node

In reply to Vladimir Zapolskiy

Motor Control PWM depends on its own supply clock, the clock gate control is present in TIMCLK_CTRL1 register.

---
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi +1 -0
index 39af48470ed5..abd401fda94e 100644
@@ -304,6 +304,7 @@ i2c2: i2c@400a8000 {
 			mpwm: pwm@400e8000 {
 				compatible = "nxp,lpc3220-motor-pwm";
 				reg = <0x400e8000 0x78>;
+				clocks = <&clk LPC32XX_CLK_MCPWM>;
 				#pwm-cells = <3>;
 				status = "disabled";
 			};
Signature · 1 line
2.43.0
maintainer
#5 lore raw

Re: [PATCH 2/2] arm: dts: lpc32xx: add clocks property to Motor Control PWM device tree node

Quoted 2 lines · Vladimir Zapolskiy

Motor Control PWM depends on its own supply clock, the clock gate control is present in TIMCLK_CTRL1 register.

You say it is required, so does that mean this hasn't ever worked? Or it happened to work because something else turned on the clock?

Quoted 1 line

Fixes tag?

Quoted 20 lines
---
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi +1 -0
index 39af48470ed5..abd401fda94e 100644
@@ -304,6 +304,7 @@ i2c2: i2c@400a8000 {
 			mpwm: pwm@400e8000 {
 				compatible = "nxp,lpc3220-motor-pwm";
 				reg = <0x400e8000 0x78>;
+				clocks = <&clk LPC32XX_CLK_MCPWM>;
 				#pwm-cells = <3>;
 				status = "disabled";
 			};
Signature · 1 line
2.43.0
author maintainer
#6 lore raw

Re: [PATCH 2/2] arm: dts: lpc32xx: add clocks property to Motor Control PWM device tree node

Quoted 6 lines · Rob Herring
Quoted 2 lines · Vladimir Zapolskiy

Motor Control PWM depends on its own supply clock, the clock gate control is present in TIMCLK_CTRL1 register.

You say it is required, so does that mean this hasn't ever worked? Or it happened to work because something else turned on the clock?

There is no upstream driver for this particular PWM controller, I'm about to submit one though, and so far I've completed my review of its dt properties.

Quoted 3 lines
Quoted 1 line

Fixes tag?

It'd make sense, however as I've said above formally there is no fixed runtime bug, if the scope is limited to the upstream only.

Fixes b7d41c937ed7 ("ARM: LPC32xx: Add the motor PWM to base dts file")
Quoted 20 lines
Quoted 20 lines
---
  arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 1 +
  1 file changed, 1 insertion(+)
arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi +1 -0
index 39af48470ed5..abd401fda94e 100644
@@ -304,6 +304,7 @@ i2c2: i2c@400a8000 {
  			mpwm: pwm@400e8000 {
  				compatible = "nxp,lpc3220-motor-pwm";
  				reg = <0x400e8000 0x78>;
+				clocks = <&clk LPC32XX_CLK_MCPWM>;
  				#pwm-cells = <3>;
  				status = "disabled";
  			};
Signature · 1 line
2.43.0
Signature · 2 lines
Best wishes,
Vladimir