diff mbox series

[1/2] dt-bindings: pwm: Document Airoha EN7581 PWM

Message ID 6a95b1d7fb90045a51a0cf51b9fafff26790904b.1723264979.git.lorenzo@kernel.org (mailing list archive)
State New, archived
Headers show
Series Add PWM support to EN7581 | expand

Commit Message

Lorenzo Bianconi Aug. 10, 2024, 4:48 a.m. UTC
From: Christian Marangi <ansuelsmth@gmail.com>

Document required property for the Airoha EN7581 PWM. The device
requires 3 different address for the sgpio, flash and cycle config.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../bindings/pwm/airoha,en7581-pwm.yaml       | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml

Comments

Krzysztof Kozlowski Aug. 10, 2024, 11:36 a.m. UTC | #1
On 10/08/2024 06:48, Lorenzo Bianconi wrote:
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pwm@1fbf0224 {
> +        compatible = "airoha,en7581-pwm";
> +        reg = <0x1fbf0224 0x10>,
> +              <0x1fbf0238 0x28>,
> +              <0x1fbf0298 0x8>;

These look almost continuous, so I wonder what's in between? E.g.
between 0x1fbf0224+10=0x1fbf0234 and 0x1fbf0238?

Rest looks good.

Best regards,
Krzysztof
Lorenzo Bianconi Aug. 10, 2024, 5:18 p.m. UTC | #2
On Aug 10, Krzysztof Kozlowski wrote:
> On 10/08/2024 06:48, Lorenzo Bianconi wrote:
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    pwm@1fbf0224 {
> > +        compatible = "airoha,en7581-pwm";
> > +        reg = <0x1fbf0224 0x10>,
> > +              <0x1fbf0238 0x28>,
> > +              <0x1fbf0298 0x8>;
> 
> These look almost continuous, so I wonder what's in between? E.g.
> between 0x1fbf0224+10=0x1fbf0234 and 0x1fbf0238?

register 0x1fbf0234 will be used by pinctrl driver (I will post it soon) for
pwm muxing. The issue here is clock, pinctrl, gpio, pwm and (future) serdes
registers are all interleaved in a non-regular fashion in the following
IO space:

- <0x1fa20000 - 0x1fa20384> 
- <0x1fb00000 - 0x1fb0096c>
- <0x1fbf0200 - 0x1fbf02bc>

So in order to avoid conflicts we need a sparse mapping.

Regards,
Lorenzo

> 
> Rest looks good.
> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Aug. 11, 2024, 12:26 p.m. UTC | #3
On 10/08/2024 06:48, Lorenzo Bianconi wrote:
> From: Christian Marangi <ansuelsmth@gmail.com>
> 
> Document required property for the Airoha EN7581 PWM. The device
> requires 3 different address for the sgpio, flash and cycle config.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml b/Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml
new file mode 100644
index 000000000000..52470668f90e
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml
@@ -0,0 +1,42 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/airoha,en7581-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha EN7581 PWM
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  compatible:
+    const: airoha,en7581-pwm
+
+  reg:
+    items:
+      - description: sgpio config address
+      - description: flash config address
+      - description: cycle config address
+
+  "#pwm-cells":
+    const: 3
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    pwm@1fbf0224 {
+        compatible = "airoha,en7581-pwm";
+        reg = <0x1fbf0224 0x10>,
+              <0x1fbf0238 0x28>,
+              <0x1fbf0298 0x8>;
+        #pwm-cells = <3>;
+    };