[PATCH 2/6] dt-bindings: iio: dac: ad5791: Add required voltage supplies

ahaslam@baylibre.com posted 6 patches 4 weeks ago
There is a newer version of this series
[PATCH 2/6] dt-bindings: iio: dac: ad5791: Add required voltage supplies
Posted by ahaslam@baylibre.com 4 weeks ago
From: Axel Haslam <ahaslam@baylibre.com>

Vcc, iovcc, vrefp, and vrefn are needed for the DAC to work.
Add them as required bindings for ad5791.

Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
---
 .../bindings/iio/dac/adi,ad5791.yaml          | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
index fe664378c966..79cb4b78a88a 100644
--- a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
@@ -26,6 +26,22 @@ properties:
   vdd-supply: true
   vss-supply: true
 
+  vcc-supply:
+    description:
+      Supply that powers the chip.
+
+  iovcc-supply:
+    description:
+      Supply for the digital interface.
+
+  vrefp-supply:
+    description:
+      Positive referance input voltage range. From 5v to (vdd - 2.5)
+
+  vrefn-supply:
+    description:
+      Negative referance input voltage range. From (vss + 2.5) to 0.
+
   adi,rbuf-gain2-en:
     description: Specify to allow an external amplifier to be connected in a
       gain of two configuration.
@@ -47,6 +63,10 @@ required:
   - reg
   - vdd-supply
   - vss-supply
+  - vcc-supply
+  - iovcc-supply
+  - vrefp-supply
+  - vrefn-supply
 
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
@@ -65,6 +85,10 @@ examples:
             reg = <0>;
             vss-supply = <&dac_vss>;
             vdd-supply = <&dac_vdd>;
+            vcc-supply = <&dac_vcc>;
+            iovcc-supply = <&dac_iovcc>;
+            vrefp-supply = <&dac_vrefp>;
+            vrefn-supply = <&dac_vrefn>;
             reset-gpios = <&gpio_bd 16 GPIO_ACTIVE_LOW>;
             clear-gpios = <&gpio_bd 17 GPIO_ACTIVE_LOW>;
             ldac-gpios = <&gpio_bd 18 GPIO_ACTIVE_HIGH>;
-- 
2.34.1
Re: [PATCH 2/6] dt-bindings: iio: dac: ad5791: Add required voltage supplies
Posted by Krzysztof Kozlowski 3 weeks, 6 days ago
On 28/10/2024 08:11, ahaslam@baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
> 
> Vcc, iovcc, vrefp, and vrefn are needed for the DAC to work.
> Add them as required bindings for ad5791.
> 
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
>  .../bindings/iio/dac/adi,ad5791.yaml          | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Re: [PATCH 2/6] dt-bindings: iio: dac: ad5791: Add required voltage supplies
Posted by Krzysztof Kozlowski 4 weeks ago
On Mon, Oct 28, 2024 at 08:11:14AM +0100, ahaslam@baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
> 
> Vcc, iovcc, vrefp, and vrefn are needed for the DAC to work.
> Add them as required bindings for ad5791.
> 
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
>  .../bindings/iio/dac/adi,ad5791.yaml          | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> index fe664378c966..79cb4b78a88a 100644
> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> @@ -26,6 +26,22 @@ properties:
>    vdd-supply: true
>    vss-supply: true
>  
> +  vcc-supply:
> +    description:
> +      Supply that powers the chip.
> +
> +  iovcc-supply:
> +    description:
> +      Supply for the digital interface.
> +
> +  vrefp-supply:
> +    description:
> +      Positive referance input voltage range. From 5v to (vdd - 2.5)
> +
> +  vrefn-supply:
> +    description:
> +      Negative referance input voltage range. From (vss + 2.5) to 0.
> +
>    adi,rbuf-gain2-en:
>      description: Specify to allow an external amplifier to be connected in a
>        gain of two configuration.
> @@ -47,6 +63,10 @@ required:
>    - reg
>    - vdd-supply
>    - vss-supply
> +  - vcc-supply
> +  - iovcc-supply
> +  - vrefp-supply
> +  - vrefn-supply

So you have six required supplies?

Datasheet says "A voltage range of 2.7 V to 5.5 V *can* be connected",
so doesn't it mean this is optional? Although similar wording is for
other supplies, so maybe it's just imprecise language?

Best regards,
Krzysztof
Re: [PATCH 2/6] dt-bindings: iio: dac: ad5791: Add required voltage supplies
Posted by Axel Haslam 3 weeks, 6 days ago
On Mon, 28 Oct 2024 at 09:06, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Mon, Oct 28, 2024 at 08:11:14AM +0100, ahaslam@baylibre.com wrote:
> > From: Axel Haslam <ahaslam@baylibre.com>
> >
> > Vcc, iovcc, vrefp, and vrefn are needed for the DAC to work.
> > Add them as required bindings for ad5791.
> >
> > Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> > ---
> >  .../bindings/iio/dac/adi,ad5791.yaml          | 24 +++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> > index fe664378c966..79cb4b78a88a 100644
> > --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> > +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> > @@ -26,6 +26,22 @@ properties:
> >    vdd-supply: true
> >    vss-supply: true
> >
> > +  vcc-supply:
> > +    description:
> > +      Supply that powers the chip.
> > +
> > +  iovcc-supply:
> > +    description:
> > +      Supply for the digital interface.
> > +
> > +  vrefp-supply:
> > +    description:
> > +      Positive referance input voltage range. From 5v to (vdd - 2.5)
> > +
> > +  vrefn-supply:
> > +    description:
> > +      Negative referance input voltage range. From (vss + 2.5) to 0.
> > +
> >    adi,rbuf-gain2-en:
> >      description: Specify to allow an external amplifier to be connected in a
> >        gain of two configuration.
> > @@ -47,6 +63,10 @@ required:
> >    - reg
> >    - vdd-supply
> >    - vss-supply
> > +  - vcc-supply
> > +  - iovcc-supply
> > +  - vrefp-supply
> > +  - vrefn-supply
>
> So you have six required supplies?
>
> Datasheet says "A voltage range of 2.7 V to 5.5 V *can* be connected",
> so doesn't it mean this is optional? Although similar wording is for
> other supplies, so maybe it's just imprecise language?

looks like unfortunate wording. Like you said, Vdd, Vss are already required
and have the same *can* word in their description like all other supplies
which i think its meant for the voltage level options of the power supply.

Vcc:  is mentioned as need to "power on" in the startup sequence
section of the datasheet,
iovcc: we can't interface the chip without this supply.
vrefp: minimum input of 5v.
vrefn: from vss up to 0 volts max.

so vcc, iovcc, and vrefp to me, look required for the hw to work.
but i have a small doubt about vrefn since it could potentially be 0V.
Does this mean it should be an optional binding where we assume its 0
if not present?
or is it ok to leave it as required?

Regards
Axel.


>
> Best regards,
> Krzysztof
>