Skip to contentSkip to conversation

dt-bindings: pwm: rockchip: add interrupts property

RFC PATCH In review Johan Jonker 2 participants 3 messages Sep 29, 2022 – Oct 3, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 dt-bindings: pwm: rockchip: add interrupts property

The Rockchip SoCs have 4 or more built-in PWM channels.

Configurable to operate in capture mode.
Measures the high/low polarity effective cycles of this input waveform Generates a single interrupt at the transition of input waveform polarity

Configurable to operate in continuous mode or one-shot mode. One-shot operation will produce N + 1 periods of the waveform, where N is the repeat counter value, and generates a single interrupt at the end of operation.
Continuous mode generates the waveform continuously and
do not generates any interrupts.

Older SoCs have an interrupt for each node.
Newer models share an interrupt.

Add interrupts property to the pwm-rockchip.yaml file. DT describes hardware. Rockchip PWM driver support for interrupts might not available.

---
 Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml +3 -0
index f2d1dc7e7..f7634069d 100644
@@ -37,6 +37,9 @@ properties:
   reg:
     maxItems: 1
 
+  interrupts:
+    maxItems: 1
+
   clocks:
     minItems: 1
     maxItems: 2
Signature · 1 line
2.20.1
maintainer Acked-by on v1 1/2
#1 lore raw
Quoted 16 lines · Johan Jonker

The Rockchip SoCs have 4 or more built-in PWM channels.

Configurable to operate in capture mode.
Measures the high/low polarity effective cycles of this input waveform Generates a single interrupt at the transition of input waveform polarity

Configurable to operate in continuous mode or one-shot mode. One-shot operation will produce N + 1 periods of the waveform, where N is the repeat counter value, and generates a single interrupt at the end of operation.
Continuous mode generates the waveform continuously and
do not generates any interrupts.

Older SoCs have an interrupt for each node.
Newer models share an interrupt.

Quoted 9 lines

Add interrupts property to the pwm-rockchip.yaml file. DT describes hardware. Rockchip PWM driver support for interrupts might not available.

---
 Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml | 3 +++
 1 file changed, 3 insertions(+)
#2 lore raw
In reply to Johan Jonker
Quoted 14 lines · Johan Jonker

The Rockchip SoCs have 4 or more built-in PWM channels.

Configurable to operate in capture mode.
Measures the high/low polarity effective cycles of this input waveform Generates a single interrupt at the transition of input waveform polarity

Configurable to operate in continuous mode or one-shot mode. One-shot operation will produce N + 1 periods of the waveform, where N is the repeat counter value, and generates a single interrupt at the end of operation.
Continuous mode generates the waveform continuously and
do not generates any interrupts.

Quoted 2 lines

Older SoCs have an interrupt for each node.
Newer models share an interrupt.

As mentioned by Robin the common interrupt status registers are located outside the PWM node reg range.
The Rockchip PWM driver is only focused on continuous mode, while these interrupts only for "Capture mode" and "One-shot mode" and need a different handling. Interrupts without reg resources is not going to work well,
so I think this patch can go in the garbage bin.

Quoted 15 lines

Add interrupts property to the pwm-rockchip.yaml file. DT describes hardware. Rockchip PWM driver support for interrupts might not available.

---
 Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml +0 -0
index f2d1dc7e7..f7634069d 100644

Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml properties: · line 45

Quoted 9 lines
Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml +3 -0
@@ -37,6 +37,9 @@ properties:
   reg:
     maxItems: 1
 
+  interrupts:
+    maxItems: 1
+
   clocks:
     minItems: 1
     maxItems: 2

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip