devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089
       [not found] <20220102211124.18435-1-laurent.pinchart+renesas@ideasonboard.com>
@ 2022-01-02 21:11 ` Laurent Pinchart
  2022-01-04 14:26   ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2022-01-02 21:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Watson Chow, Liam Girdwood, Mark Brown, Laurent Pinchart,
	Rob Herring, devicetree

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The MAX20086-MAX20089 are dual/quad power protectors for cameras. Add
corresponding DT bindings.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .../bindings/regulator/maxim,max20086.yaml    | 116 ++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max20086.yaml

diff --git a/Documentation/devicetree/bindings/regulator/maxim,max20086.yaml b/Documentation/devicetree/bindings/regulator/maxim,max20086.yaml
new file mode 100644
index 000000000000..4663716e47a4
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/maxim,max20086.yaml
@@ -0,0 +1,116 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/maxim,max20086.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim Integrated MAX20086-MAX20089 Camera Power Protector
+
+maintainers:
+  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+
+description: |
+  The MAX20086-MAX20089 are dual/quad camera power protectors, designed to
+  deliver power over coax for radar and camera modules. They support
+  software-configurable output switching and monitoring. The output voltage and
+  current limit are fixed by the hardware design.
+
+properties:
+  compatible:
+    enum:
+      - maxim,max20086
+      - maxim,max20087
+      - maxim,max20088
+      - maxim,max20089
+
+  reg:
+    maxItems: 1
+
+  enable-gpios:
+    maxItems: 1
+    description: GPIO connected to the EN pin, active high
+
+  in-supply:
+    description: Input supply for the camera outputs (IN pin, 3.0V to 15.0V)
+
+  vdd-supply:
+    description: Input supply for the device (VDD pin, 3.0V to 5.5V)
+
+  regulators:
+    type: object
+
+    patternProperties:
+      "^OUT[1-4]$":
+        type: object
+        $ref: regulator.yaml#
+
+    required:
+      - OUT1
+      - OUT2
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - in-supply
+  - vdd-supply
+  - regulators
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - maxim,max20086
+              - maxim,max20087
+    then:
+      properties:
+        regulators:
+          required:
+            - OUT3
+            - OUT4
+    else:
+      properties:
+        regulators:
+          properties:
+            OUT3: false
+            OUT4: false
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@28 {
+            compatible = "maxim,max20087";
+            reg = <0x28>;
+
+            in-supply = <&reg_12v0>;
+            vdd-supply = <&reg_3v3>;
+
+            enable-gpios = <&gpio 108 GPIO_ACTIVE_HIGH>;
+
+            regulators {
+                OUT1 {
+                    regulator-name = "VOUT1";
+                };
+                OUT2 {
+                    regulator-name = "VOUT2";
+                };
+                OUT3 {
+                    regulator-name = "VOUT3";
+                };
+                OUT4 {
+                    regulator-name = "VOUT4";
+                };
+            };
+        };
+    };
+...
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089
  2022-01-02 21:11 ` [PATCH 1/2] dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089 Laurent Pinchart
@ 2022-01-04 14:26   ` Mark Brown
  2022-01-04 14:43     ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2022-01-04 14:26 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-kernel, Watson Chow, Liam Girdwood, Laurent Pinchart,
	Rob Herring, devicetree

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

On Sun, Jan 02, 2022 at 11:11:23PM +0200, Laurent Pinchart wrote:

> +    patternProperties:
> +      "^OUT[1-4]$":
> +        type: object
> +        $ref: regulator.yaml#
> +
> +    required:
> +      - OUT1
> +      - OUT2

Why are we requiring that there be machine constraints for the
individual regulators?  There's already a problem with people just
using the maximum possible control a regulator has as the default for
devices without regard to what the specific system can support.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089
  2022-01-04 14:26   ` Mark Brown
@ 2022-01-04 14:43     ` Laurent Pinchart
  2022-01-04 14:49       ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2022-01-04 14:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Watson Chow, Liam Girdwood, Rob Herring, devicetree

Hi Mark,

Thank you for the review.

On Tue, Jan 04, 2022 at 02:26:45PM +0000, Mark Brown wrote:
> On Sun, Jan 02, 2022 at 11:11:23PM +0200, Laurent Pinchart wrote:
> 
> > +    patternProperties:
> > +      "^OUT[1-4]$":
> > +        type: object
> > +        $ref: regulator.yaml#
> > +
> > +    required:
> > +      - OUT1
> > +      - OUT2
> 
> Why are we requiring that there be machine constraints for the
> individual regulators?  There's already a problem with people just
> using the maximum possible control a regulator has as the default for
> devices without regard to what the specific system can support.

Could you elaborate a bit, keeping in mind that I'm a newbie when it
comes to the regulator framework ? :-)

The MAX2008[6789] can't control the voltage or current. The outputs can
be enabled or disabled individually, but their voltage is fixed to the
input voltage. There's overcurrent protection, with a threshold set by a
resistor and not known to the driver. The voltage (and current I
believe) can be measured, and alarms can be raised through an interrupt.

How should I modify the DT bindings to match that correctly ?

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089
  2022-01-04 14:43     ` Laurent Pinchart
@ 2022-01-04 14:49       ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-01-04 14:49 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-kernel, Watson Chow, Liam Girdwood, Rob Herring, devicetree

[-- Attachment #1: Type: text/plain, Size: 938 bytes --]

On Tue, Jan 04, 2022 at 04:43:12PM +0200, Laurent Pinchart wrote:
> On Tue, Jan 04, 2022 at 02:26:45PM +0000, Mark Brown wrote:
> > On Sun, Jan 02, 2022 at 11:11:23PM +0200, Laurent Pinchart wrote:

> > > +    required:
> > > +      - OUT1
> > > +      - OUT2

> > Why are we requiring that there be machine constraints for the
> > individual regulators?  There's already a problem with people just
> > using the maximum possible control a regulator has as the default for
> > devices without regard to what the specific system can support.

> Could you elaborate a bit, keeping in mind that I'm a newbie when it
> comes to the regulator framework ? :-)

Not really...  the question is why we are marking these as required
rather than just letting them be omitted as we normally do for
individual regulators on a device.  What purpose does it serve?

> How should I modify the DT bindings to match that correctly ?

Remove the required:.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-04 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220102211124.18435-1-laurent.pinchart+renesas@ideasonboard.com>
2022-01-02 21:11 ` [PATCH 1/2] dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089 Laurent Pinchart
2022-01-04 14:26   ` Mark Brown
2022-01-04 14:43     ` Laurent Pinchart
2022-01-04 14:49       ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).