diff mbox series

[v6,1/3] dt-bindings: clk: vc5: Add properties for configuring the SD/OE pin

Message ID 20210723231306.674310-1-sean.anderson@seco.com
State Superseded
Headers show
Series [v6,1/3] dt-bindings: clk: vc5: Add properties for configuring the SD/OE pin | expand

Commit Message

Sean Anderson July 23, 2021, 11:13 p.m. UTC
These properties allow configuring the SD/OE pin as described in the
datasheet.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

Changes in v6:
- Use tri-state properties

Changes in v5:
- Don't use dummy if's for oneOfs under allOfs

Changes in v4:
- Specify that bindings should specify these properties, but don't make
  any guarantees about the driver's behavior when they are not present.
- Clarify description of idt,(en|dis)able-shutdown properties.
- Make opposing properties mutually exclusive.
- Add these properties to the example.

Changes in v3:
- Add idt,disable-shutdown and idt,output-enable-active-low to allow for
  a default of not changing the SP/SH bits at all.

Changes in v2:
- Rename idt,sd-active-high to idt,output-enable-active-high
- Add idt,enable-shutdown

 .../bindings/clock/idt,versaclock5.yaml       | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)

Comments

Rob Herring (Arm) July 26, 2021, 9:53 p.m. UTC | #1
On Fri, 23 Jul 2021 19:13:04 -0400, Sean Anderson wrote:
> These properties allow configuring the SD/OE pin as described in the

> datasheet.

> 

> Signed-off-by: Sean Anderson <sean.anderson@seco.com>

> ---

> 

> Changes in v6:

> - Use tri-state properties

> 

> Changes in v5:

> - Don't use dummy if's for oneOfs under allOfs

> 

> Changes in v4:

> - Specify that bindings should specify these properties, but don't make

>   any guarantees about the driver's behavior when they are not present.

> - Clarify description of idt,(en|dis)able-shutdown properties.

> - Make opposing properties mutually exclusive.

> - Add these properties to the example.

> 

> Changes in v3:

> - Add idt,disable-shutdown and idt,output-enable-active-low to allow for

>   a default of not changing the SP/SH bits at all.

> 

> Changes in v2:

> - Rename idt,sd-active-high to idt,output-enable-active-high

> - Add idt,enable-shutdown

> 

>  .../bindings/clock/idt,versaclock5.yaml       | 40 +++++++++++++++++++

>  1 file changed, 40 insertions(+)

> 


Reviewed-by: Rob Herring <robh@kernel.org>
Luca Ceresoli July 31, 2021, 2:43 p.m. UTC | #2
On 24/07/21 01:13, Sean Anderson wrote:
> These properties allow configuring the SD/OE pin as described in the

> datasheet.

> 

> Signed-off-by: Sean Anderson <sean.anderson@seco.com>


Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>


-- 
Luca
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/clock/idt,versaclock5.yaml b/Documentation/devicetree/bindings/clock/idt,versaclock5.yaml
index 28675b0b80f1..e9fc781a21b5 100644
--- a/Documentation/devicetree/bindings/clock/idt,versaclock5.yaml
+++ b/Documentation/devicetree/bindings/clock/idt,versaclock5.yaml
@@ -30,6 +30,20 @@  description: |
     3 -- OUT3
     4 -- OUT4
 
+  The idt,shutdown and idt,output-enable-active properties control the
+  SH (en_global_shutdown) and SP bits of the Primary Source and Shutdown
+  Register, respectively. Their behavior is summarized by the following
+  table:
+
+  SH SP Output when the SD/OE pin is Low/High
+  == == =====================================
+   0  0 Active/Inactive
+   0  1 Inactive/Active
+   1  0 Active/Shutdown
+   1  1 Inactive/Shutdown
+
+  The case where SH and SP are both 1 is likely not very interesting.
+
 maintainers:
   - Luca Ceresoli <luca@lucaceresoli.net>
 
@@ -64,6 +78,26 @@  properties:
     maximum: 22760
     description: Optional load capacitor for XTAL1 and XTAL2
 
+  idt,shutdown:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1]
+    description: |
+      If 1, this enables the shutdown functionality: the chip will be
+      shut down if the SD/OE pin is driven high. If 0, this disables the
+      shutdown functionality: the chip will never be shut down based on
+      the value of the SD/OE pin. This property corresponds to the SH
+      bit of the Primary Source and Shutdown Register.
+
+  idt,output-enable-active:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1]
+    description: |
+      If 1, this enables output when the SD/OE pin is high, and disables
+      output when the SD/OE pin is low. If 0, this disables output when
+      the SD/OE pin is high, and enables output when the SD/OE pin is
+      low. This corresponds to the SP bit of the Primary Source and
+      Shutdown Register.
+
 patternProperties:
   "^OUT[1-4]$":
     type: object
@@ -89,6 +123,8 @@  required:
   - compatible
   - reg
   - '#clock-cells'
+  - idt,shutdown
+  - idt,output-enable-active
 
 allOf:
   - if:
@@ -138,6 +174,10 @@  examples:
             clocks = <&ref25m>;
             clock-names = "xin";
 
+            /* Set the SD/OE pin's settings */
+            idt,shutdown = <0>;
+            idt,output-enable-active = <0>;
+
             OUT1 {
                 idt,drive-mode = <VC5_CMOSD>;
                 idt,voltage-microvolts = <1800000>;