diff mbox series

[v2,1/2] dt-bindings: hwmon: pmbus: add lt3074

Message ID 20250225-upstream-lt3074-v2-1-18ad10ba542e@analog.com (mailing list archive)
State New
Headers show
Series Add support for LT3074 low voltage linear regulator | expand

Commit Message

Cedric Encarnacion Feb. 25, 2025, 1:01 p.m. UTC
Add Analog Devices LT3074 Ultralow Noise, High PSRR Dropout Linear
Regulator.

Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
---
 .../bindings/hwmon/pmbus/adi,lt3074.yaml           | 64 ++++++++++++++++++++++
 MAINTAINERS                                        |  7 +++
 2 files changed, 71 insertions(+)

Comments

Krzysztof Kozlowski Feb. 26, 2025, 8:20 a.m. UTC | #1
On Tue, Feb 25, 2025 at 09:01:13PM +0800, Cedric Encarnacion wrote:
> Add Analog Devices LT3074 Ultralow Noise, High PSRR Dropout Linear
> Regulator.
> 
> Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
> ---
>  .../bindings/hwmon/pmbus/adi,lt3074.yaml           | 64 ++++++++++++++++++++++
>  MAINTAINERS                                        |  7 +++
>  2 files changed, 71 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..714426fd655a8daa96e15e1f789743f36001ac7a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
> @@ -0,0 +1,64 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/pmbus/adi,lt3074.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices LT3074 voltage regulator
> +
> +maintainers:
> +  - Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
> +
> +description: |
> +  The LT3074 is a low voltage, ultra-low noise and ultra-fast transient
> +  response linear regulator. It allows telemetry for input/output voltage,
> +  output current and temperature through the PMBus serial interface.
> +
> +  Datasheet:
> +    https://www.analog.com/en/products/lt3074.html
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,lt3074
> +
> +  reg:
> +    maxItems: 1
> +
> +  regulators:
> +    type: object
> +    description: |
> +      list of regulators provided by this controller.

You have only one regulator, so drop the "regulators". vout could be
here, but since you do not have any other resources, I doubt it stands
on its own either. This is even visible in your DTS - you named the
device as regulator, so logically this is the regulator. Regulator does
not have regulators (otherwise they could also have regulators... so
triple regulator).

hwmon code might need some changes, but that's not really relevant for
proper hardware description.

Best regards,
Krzysztof
Rob Herring (Arm) Feb. 26, 2025, 2:59 p.m. UTC | #2
On Wed, Feb 26, 2025 at 09:20:40AM +0100, Krzysztof Kozlowski wrote:
> On Tue, Feb 25, 2025 at 09:01:13PM +0800, Cedric Encarnacion wrote:
> > Add Analog Devices LT3074 Ultralow Noise, High PSRR Dropout Linear
> > Regulator.
> > 
> > Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
> > ---
> >  .../bindings/hwmon/pmbus/adi,lt3074.yaml           | 64 ++++++++++++++++++++++
> >  MAINTAINERS                                        |  7 +++
> >  2 files changed, 71 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..714426fd655a8daa96e15e1f789743f36001ac7a
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
> > @@ -0,0 +1,64 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/hwmon/pmbus/adi,lt3074.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices LT3074 voltage regulator
> > +
> > +maintainers:
> > +  - Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
> > +
> > +description: |
> > +  The LT3074 is a low voltage, ultra-low noise and ultra-fast transient
> > +  response linear regulator. It allows telemetry for input/output voltage,
> > +  output current and temperature through the PMBus serial interface.
> > +
> > +  Datasheet:
> > +    https://www.analog.com/en/products/lt3074.html
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,lt3074
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  regulators:
> > +    type: object
> > +    description: |
> > +      list of regulators provided by this controller.
> 
> You have only one regulator, so drop the "regulators". vout could be
> here, but since you do not have any other resources, I doubt it stands
> on its own either. This is even visible in your DTS - you named the
> device as regulator, so logically this is the regulator. Regulator does
> not have regulators (otherwise they could also have regulators... so
> triple regulator).
> 
> hwmon code might need some changes, but that's not really relevant for
> proper hardware description.

Normally, I would agree, but it seems generic pmbus code expects this 
structure. This just came up with changing another binding maintained by 
'Not Me' to follow this structure. We're stuck with the existing way, so 
I don't know that it is worth supporting 2 ways forever. OTOH, is it 
guaranteed that these devices will only ever be pmbus devices or that 
other regulator devices which are not handled as pmbus devices currently 
will be in the future. If so, more flexibility in the bindings will be 
needed.

Rob
Guenter Roeck Feb. 26, 2025, 7:17 p.m. UTC | #3
On 2/26/25 06:59, Rob Herring wrote:
> On Wed, Feb 26, 2025 at 09:20:40AM +0100, Krzysztof Kozlowski wrote:
>> On Tue, Feb 25, 2025 at 09:01:13PM +0800, Cedric Encarnacion wrote:
>>> Add Analog Devices LT3074 Ultralow Noise, High PSRR Dropout Linear
>>> Regulator.
>>>
>>> Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
>>> ---
>>>   .../bindings/hwmon/pmbus/adi,lt3074.yaml           | 64 ++++++++++++++++++++++
>>>   MAINTAINERS                                        |  7 +++
>>>   2 files changed, 71 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
>>> new file mode 100644
>>> index 0000000000000000000000000000000000000000..714426fd655a8daa96e15e1f789743f36001ac7a
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
>>> @@ -0,0 +1,64 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/hwmon/pmbus/adi,lt3074.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Analog Devices LT3074 voltage regulator
>>> +
>>> +maintainers:
>>> +  - Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
>>> +
>>> +description: |
>>> +  The LT3074 is a low voltage, ultra-low noise and ultra-fast transient
>>> +  response linear regulator. It allows telemetry for input/output voltage,
>>> +  output current and temperature through the PMBus serial interface.
>>> +
>>> +  Datasheet:
>>> +    https://www.analog.com/en/products/lt3074.html
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - adi,lt3074
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  regulators:
>>> +    type: object
>>> +    description: |
>>> +      list of regulators provided by this controller.
>>
>> You have only one regulator, so drop the "regulators". vout could be
>> here, but since you do not have any other resources, I doubt it stands
>> on its own either. This is even visible in your DTS - you named the
>> device as regulator, so logically this is the regulator. Regulator does
>> not have regulators (otherwise they could also have regulators... so
>> triple regulator).
>>
>> hwmon code might need some changes, but that's not really relevant for
>> proper hardware description.
> 
> Normally, I would agree, but it seems generic pmbus code expects this
> structure. This just came up with changing another binding maintained by
> 'Not Me' to follow this structure. We're stuck with the existing way, so
> I don't know that it is worth supporting 2 ways forever. OTOH, is it
> guaranteed that these devices will only ever be pmbus devices or that
> other regulator devices which are not handled as pmbus devices currently
> will be in the future. If so, more flexibility in the bindings will be
> needed.
> 

I would appreciate if someone would explain to me what the problems with
the current PMBus code actually are. I have seen several comments claiming
that the code should be changed, but I have no idea what the expected changes
actually are or, in other words, what the PMBus code should be doing
differently.

Thanks,
Guenter
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..714426fd655a8daa96e15e1f789743f36001ac7a
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
@@ -0,0 +1,64 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/pmbus/adi,lt3074.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices LT3074 voltage regulator
+
+maintainers:
+  - Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
+
+description: |
+  The LT3074 is a low voltage, ultra-low noise and ultra-fast transient
+  response linear regulator. It allows telemetry for input/output voltage,
+  output current and temperature through the PMBus serial interface.
+
+  Datasheet:
+    https://www.analog.com/en/products/lt3074.html
+
+properties:
+  compatible:
+    enum:
+      - adi,lt3074
+
+  reg:
+    maxItems: 1
+
+  regulators:
+    type: object
+    description: |
+      list of regulators provided by this controller.
+
+    properties:
+      vout:
+        $ref: /schemas/regulator/regulator.yaml#
+        type: object
+
+        unevaluatedProperties: false
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@6d {
+            compatible = "adi,lt3074";
+            reg = <0x6d>;
+
+            regulators {
+                vcc_1v2: vout {
+                    regulator-name = "VCC_1V2";
+                };
+            };
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 896a307fa06545e2861abe46ea7029f9b4d3628e..4a59ee6a03919af6a48717a0ddddabc7241a9e63 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13687,6 +13687,13 @@  L:	linux-scsi@vger.kernel.org
 S:	Maintained
 F:	drivers/scsi/sym53c8xx_2/
 
+LT3074 HARDWARE MONITOR DRIVER
+M:	Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
+L:	linux-hwmon@vger.kernel.org
+S:	Supported
+W:	https://ez.analog.com/linux-software-drivers
+F:	Documentation/devicetree/bindings/hwmon/pmbus/adi,lt3074.yaml
+
 LTC1660 DAC DRIVER
 M:	Marcus Folkesson <marcus.folkesson@gmail.com>
 L:	linux-iio@vger.kernel.org