diff mbox series

[v4,06/27] dt-bindings: mfd: add samsung,s2dos05

Message ID 20240913-starqltechn_integration_upstream-v4-6-2d2efd5c5877@gmail.com
State New
Headers show
Series This is continued work on Samsung S9(SM-9600) starqltechn | expand

Commit Message

Dzmitry Sankouski Sept. 13, 2024, 3:07 p.m. UTC
Add samsung,s2dos05 MFD module binding.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>

---
Changes in v4:
- split long(>80) lines
- fix indentation
- merge with regulators binding
- drop pmic suffix
- drop unused labels in example
- correct description
---
 .../devicetree/bindings/mfd/samsung,s2dos05.yaml   | 99 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 100 insertions(+)

Comments

Krzysztof Kozlowski Sept. 16, 2024, 9:13 a.m. UTC | #1
On Fri, Sep 13, 2024 at 06:07:49PM +0300, Dzmitry Sankouski wrote:
> Add samsung,s2dos05 MFD module binding.
> 
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> 
> ---
> Changes in v4:
> - split long(>80) lines
> - fix indentation
> - merge with regulators binding
> - drop pmic suffix
> - drop unused labels in example
> - correct description
> ---
>  .../devicetree/bindings/mfd/samsung,s2dos05.yaml   | 99 ++++++++++++++++++++++
>  MAINTAINERS                                        |  1 +
>  2 files changed, 100 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml b/Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml
> new file mode 100644
> index 000000000000..534434002045
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/samsung,s2dos05.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung S2DOS05 Power Management IC
> +
> +maintainers:
> +  - Dzmitry Sankouski <dsankouski@gmail.com>
> +
> +description:
> +  This is a device tree bindings for S2DOS family of Power Management IC (PMIC).

Drop this sentence, not really useful. I know that I put it into other
Samsung PMIC bindings, but let's don't grow this pattern.

> +
> +  The S2DOS05 is a companion power management IC for the panel and touchscreen
> +  in smart phones. Provides voltage regulators and
> +  ADC for power/current measurements.
> +
> +  Regulator section has 4 LDO and 1 BUCK regulators and also
> +  provides ELVDD, ELVSS, AVDD lines.

What are these? Input supplies?

> +
> +properties:
> +  compatible:
> +    const: samsung,s2dos05
> +
> +  reg:
> +    maxItems: 1
> +
> +  regulators:
> +    patternProperties:
> +      "^buck1|ldo[1-4]$":

s/buck1/buck/

> +        type: object
> +        $ref: /schemas/regulator/regulator.yaml#
> +        unevaluatedProperties: false
> +
> +        required:
> +          - regulator-name
> +
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - regulators
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      pmic@60 {
> +        compatible = "samsung,s2dos05";
> +        reg = <0x60>;
> +
> +            regulators {

Messed indentation.

Use 4 spaces for example indentation.

> +                ldo1 {
> +                    regulator-name = "s2dos05-ldo1";

Such name is useless, so it's a clear sign you should not require it. If
you keep it in example, then say something useful - see your DTS.

> +                    regulator-min-microvolt = <1500000>;
> +                    regulator-max-microvolt = <2000000>;
> +                    regulator-active-discharge = <0x1>;
> +                };

...

> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 59d027591e34..92135252264a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -20465,6 +20465,7 @@ L:	linux-samsung-soc@vger.kernel.org
>  S:	Maintained
>  B:	mailto:linux-samsung-soc@vger.kernel.org
>  F:	Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml
> +F:	Documentation/devicetree/bindings/mfd/samsung,s2dos*.yaml
>  F:	Documentation/devicetree/bindings/mfd/samsung,s2m*.yaml

Maybe just change this pattern to s2*.yaml ?

>  F:	Documentation/devicetree/bindings/mfd/samsung,s5m*.yaml
>  F:	Documentation/devicetree/bindings/regulator/samsung,s2m*.yaml
> 
> -- 
> 2.39.2
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml b/Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml
new file mode 100644
index 000000000000..534434002045
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/samsung,s2dos05.yaml
@@ -0,0 +1,99 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/samsung,s2dos05.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S2DOS05 Power Management IC
+
+maintainers:
+  - Dzmitry Sankouski <dsankouski@gmail.com>
+
+description:
+  This is a device tree bindings for S2DOS family of Power Management IC (PMIC).
+
+  The S2DOS05 is a companion power management IC for the panel and touchscreen
+  in smart phones. Provides voltage regulators and
+  ADC for power/current measurements.
+
+  Regulator section has 4 LDO and 1 BUCK regulators and also
+  provides ELVDD, ELVSS, AVDD lines.
+
+properties:
+  compatible:
+    const: samsung,s2dos05
+
+  reg:
+    maxItems: 1
+
+  regulators:
+    patternProperties:
+      "^buck1|ldo[1-4]$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml#
+        unevaluatedProperties: false
+
+        required:
+          - regulator-name
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      pmic@60 {
+        compatible = "samsung,s2dos05";
+        reg = <0x60>;
+
+            regulators {
+                ldo1 {
+                    regulator-name = "s2dos05-ldo1";
+                    regulator-min-microvolt = <1500000>;
+                    regulator-max-microvolt = <2000000>;
+                    regulator-active-discharge = <0x1>;
+                };
+
+                ldo2 {
+                    regulator-name = "s2dos05-ldo2";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-active-discharge = <0x1>;
+                    regulator-boot-on;
+                };
+
+                ldo3 {
+                    regulator-name = "s2dos05-ldo3";
+                    regulator-min-microvolt = <3000000>;
+                    regulator-max-microvolt = <3000000>;
+                    regulator-active-discharge = <0x1>;
+                    regulator-boot-on;
+                };
+
+                ldo4 {
+                    regulator-name = "s2dos05-ldo4";
+                    regulator-min-microvolt = <2700000>;
+                    regulator-max-microvolt = <3775000>;
+                    regulator-active-discharge = <0x1>;
+                };
+
+                buck1 {
+                    regulator-name = "s2dos05-buck1";
+                    regulator-min-microvolt = <850000>;
+                    regulator-max-microvolt = <2100000>;
+                    regulator-active-discharge = <0x1>;
+                };
+            };
+        };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 59d027591e34..92135252264a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20465,6 +20465,7 @@  L:	linux-samsung-soc@vger.kernel.org
 S:	Maintained
 B:	mailto:linux-samsung-soc@vger.kernel.org
 F:	Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml
+F:	Documentation/devicetree/bindings/mfd/samsung,s2dos*.yaml
 F:	Documentation/devicetree/bindings/mfd/samsung,s2m*.yaml
 F:	Documentation/devicetree/bindings/mfd/samsung,s5m*.yaml
 F:	Documentation/devicetree/bindings/regulator/samsung,s2m*.yaml