diff mbox series

[v3,1/4] dt-bindings: mfd: Add nxp bbnsm

Message ID 20230103074742.2324924-2-ping.bai@nxp.com (mailing list archive)
State Superseded
Headers show
Series Add nxp bbnsm module support | expand

Commit Message

Jacky Bai Jan. 3, 2023, 7:47 a.m. UTC
Add binding for NXP BBNSM(Battery-Backed Non-Secure Module).

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
---
  - v2 changes:
    - remove the redundant 'bindings' string
    - add ref to rtc.yaml
    - add start-year property
    - rename 'regmap' to 'nxp,bbnsm-regmap' and add description & type define
    - add header files including in the example and correct the indentation

  -v3 changes:
    - remove the 'nxp,bbnsm-regmap' property, get the regmap directly from the
      parent node in rtc/pwrkey driver
---
 .../devicetree/bindings/mfd/nxp,bbnsm.yaml    | 99 +++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml

Comments

Rob Herring Jan. 8, 2023, 9:05 p.m. UTC | #1
On Tue, Jan 03, 2023 at 03:47:39PM +0800, Jacky Bai wrote:
> Add binding for NXP BBNSM(Battery-Backed Non-Secure Module).
> 
> Signed-off-by: Jacky Bai <ping.bai@nxp.com>
> ---
>   - v2 changes:
>     - remove the redundant 'bindings' string
>     - add ref to rtc.yaml
>     - add start-year property
>     - rename 'regmap' to 'nxp,bbnsm-regmap' and add description & type define
>     - add header files including in the example and correct the indentation
> 
>   -v3 changes:
>     - remove the 'nxp,bbnsm-regmap' property, get the regmap directly from the
>       parent node in rtc/pwrkey driver
> ---
>  .../devicetree/bindings/mfd/nxp,bbnsm.yaml    | 99 +++++++++++++++++++
>  1 file changed, 99 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml b/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
> new file mode 100644
> index 000000000000..bcd8fbc6e297
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/nxp,bbnsm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP Battery-Backed Non-Secure Module
> +
> +maintainers:
> +  - Jacky Bai <ping.bai@nxp.com>
> +
> +description: |
> +  NXP BBNSM serves as non-volatile logic and storage for the system.
> +  it Intergrates RTC & ON/OFF control.
> +  The RTC can retain its state and continues counting even when the
> +  main chip is power down. A time alarm is generated once the most
> +  significant 32 bits of the real-time counter match the value in the
> +  Time Alarm register.
> +  The ON/OFF logic inside the BBNSM allows for connecting directly to
> +  a PMIC or other voltage regulator device. both smart PMIC mode and
> +  Dumb PMIC mode supported.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - nxp,bbnsm

Is this a standalone device or block in an SoC. In the latter case, this 
needs to be SoC specific.

> +      - const: syscon
> +      - const: simple-mfd
> +
> +  reg:
> +    maxItems: 1
> +
> +  rtc:
> +    type: object
> +    $ref: /schemas/rtc/rtc.yaml#
> +
> +    properties:
> +      compatible:
> +        const: nxp,bbnsm-rtc
> +
> +      interrupts:
> +        maxItems: 1
> +
> +      start-year: true
> +
> +    required:
> +      - compatible
> +      - interrupts
> +
> +    additionalProperties: false
> +
> +  pwrkey:
> +    type: object
> +    $ref: /schemas/input/input.yaml#
> +
> +    properties:
> +      compatible:
> +        const: nxp,bbnsm-pwrkey
> +
> +      interrupts:
> +        maxItems: 1
> +
> +      linux,code: true
> +
> +    required:
> +      - compatible
> +      - interrupts
> +
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - rtc
> +  - pwrkey
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/input/linux-event-codes.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    bbnsm: bbnsm@44440000 {
> +        compatible = "nxp,bbnsm", "syscon", "simple-mfd";
> +        reg = <0x44440000 0x10000>;
> +
> +        bbnsm_rtc: rtc {
> +            compatible = "nxp,bbnsm-rtc";
> +            interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
> +        };
> +
> +        bbnsm_pwrkey: pwrkey {
> +            compatible = "nxp,bbnsm-pwrkey";
> +            interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
> +            linux,code = <KEY_POWER>;
> +        };
> +    };
> -- 
> 2.37.1
> 
>
Jacky Bai Jan. 9, 2023, 2:16 a.m. UTC | #2
> Subject: Re: [PATCH v3 1/4] dt-bindings: mfd: Add nxp bbnsm
> 
> On Tue, Jan 03, 2023 at 03:47:39PM +0800, Jacky Bai wrote:
> > Add binding for NXP BBNSM(Battery-Backed Non-Secure Module).
> >
> > Signed-off-by: Jacky Bai <ping.bai@nxp.com>
> > ---
> >   - v2 changes:
> >     - remove the redundant 'bindings' string
> >     - add ref to rtc.yaml
> >     - add start-year property
> >     - rename 'regmap' to 'nxp,bbnsm-regmap' and add description & type
> define
> >     - add header files including in the example and correct the
> > indentation
> >
> >   -v3 changes:
> >     - remove the 'nxp,bbnsm-regmap' property, get the regmap directly
> from the
> >       parent node in rtc/pwrkey driver
> > ---
> >  .../devicetree/bindings/mfd/nxp,bbnsm.yaml    | 99
> +++++++++++++++++++
> >  1 file changed, 99 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
> > b/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
> > new file mode 100644
> > index 000000000000..bcd8fbc6e297
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
> > @@ -0,0 +1,99 @@

...

> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - enum:
> > +          - nxp,bbnsm
> 
> Is this a standalone device or block in an SoC. In the latter case, this needs to
> be SoC specific.

it is an IP block in SoC, currently used on NXP i.MX SoC. I will change it to SoC specific in v4.

BR
> 
> > +      - const: syscon
> > +      - const: simple-mfd
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  rtc:
> > +    type: object
> > +    $ref: /schemas/rtc/rtc.yaml#
> > +
> > +    properties:
> > +      compatible:
> > +        const: nxp,bbnsm-rtc
> > +
> > +      interrupts:
> > +        maxItems: 1
> > +
> > +      start-year: true
> > +
> > +    required:
> > +      - compatible
> > +      - interrupts
> > +
> > +    additionalProperties: false
> > +
> > +  pwrkey:
> > +    type: object
> > +    $ref: /schemas/input/input.yaml#
> > +
> > +    properties:
> > +      compatible:
> > +        const: nxp,bbnsm-pwrkey
> > +
> > +      interrupts:
> > +        maxItems: 1
> > +
> > +      linux,code: true
> > +
> > +    required:
> > +      - compatible
> > +      - interrupts
> > +
> > +    additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - rtc
> > +  - pwrkey
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/input/linux-event-codes.h>
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +
> > +    bbnsm: bbnsm@44440000 {
> > +        compatible = "nxp,bbnsm", "syscon", "simple-mfd";
> > +        reg = <0x44440000 0x10000>;
> > +
> > +        bbnsm_rtc: rtc {
> > +            compatible = "nxp,bbnsm-rtc";
> > +            interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
> > +        };
> > +
> > +        bbnsm_pwrkey: pwrkey {
> > +            compatible = "nxp,bbnsm-pwrkey";
> > +            interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
> > +            linux,code = <KEY_POWER>;
> > +        };
> > +    };
> > --
> > 2.37.1
> >
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml b/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
new file mode 100644
index 000000000000..bcd8fbc6e297
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/nxp,bbnsm.yaml
@@ -0,0 +1,99 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/nxp,bbnsm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP Battery-Backed Non-Secure Module
+
+maintainers:
+  - Jacky Bai <ping.bai@nxp.com>
+
+description: |
+  NXP BBNSM serves as non-volatile logic and storage for the system.
+  it Intergrates RTC & ON/OFF control.
+  The RTC can retain its state and continues counting even when the
+  main chip is power down. A time alarm is generated once the most
+  significant 32 bits of the real-time counter match the value in the
+  Time Alarm register.
+  The ON/OFF logic inside the BBNSM allows for connecting directly to
+  a PMIC or other voltage regulator device. both smart PMIC mode and
+  Dumb PMIC mode supported.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - nxp,bbnsm
+      - const: syscon
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+  rtc:
+    type: object
+    $ref: /schemas/rtc/rtc.yaml#
+
+    properties:
+      compatible:
+        const: nxp,bbnsm-rtc
+
+      interrupts:
+        maxItems: 1
+
+      start-year: true
+
+    required:
+      - compatible
+      - interrupts
+
+    additionalProperties: false
+
+  pwrkey:
+    type: object
+    $ref: /schemas/input/input.yaml#
+
+    properties:
+      compatible:
+        const: nxp,bbnsm-pwrkey
+
+      interrupts:
+        maxItems: 1
+
+      linux,code: true
+
+    required:
+      - compatible
+      - interrupts
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - rtc
+  - pwrkey
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/input/linux-event-codes.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    bbnsm: bbnsm@44440000 {
+        compatible = "nxp,bbnsm", "syscon", "simple-mfd";
+        reg = <0x44440000 0x10000>;
+
+        bbnsm_rtc: rtc {
+            compatible = "nxp,bbnsm-rtc";
+            interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+        };
+
+        bbnsm_pwrkey: pwrkey {
+            compatible = "nxp,bbnsm-pwrkey";
+            interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+            linux,code = <KEY_POWER>;
+        };
+    };