[PATCH v3 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml

Kim Seer Paller posted 3 patches 10 months, 1 week ago
There is a newer version of this series
[PATCH v3 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml
Posted by Kim Seer Paller 10 months, 1 week ago
Document the AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel)
low-power, 16-bit, buffered voltage output DACs with software-
programmable gain controls. They provide full-scale output spans of 2.5V
or 5V for reference voltages of 2.5V. These devices operate on a single
2.7V to 5.5V supply and are guaranteed to be monotonic by design.
The "R" variants include a 2.5V, 5ppm/°C internal reference, which is
disabled by default.

Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
---
 .../devicetree/bindings/iio/dac/adi,ad3530r.yaml   | 99 ++++++++++++++++++++++
 MAINTAINERS                                        |  7 ++
 2 files changed, 106 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..cf4a3eb98f1fa30afdeb0740bba7f052d8ec2cd4
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad3530r.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD3530R and Similar DACs
+
+maintainers:
+  - Kim Seer Paller <kimseer.paller@analog.com>
+
+description: |
+  The AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel) are low-power,
+  16-bit, buffered voltage output digital-to-analog converters (DACs) with
+  software-programmable gain controls, providing full-scale output spans of 2.5V
+  or 5V for reference voltages of 2.5V. These devices operate from a single 2.7V
+  to 5.5V supply and are guaranteed monotonic by design. The "R" variants
+  include a 2.5V, 5ppm/°C internal reference, which is disabled by default.
+  Datasheet can be found here:
+  https://www.analog.com/media/en/technical-documentation/data-sheets/ad3530_ad530r.pdf
+
+properties:
+  compatible:
+    enum:
+      - adi,ad3530
+      - adi,ad3530r
+      - adi,ad3531
+      - adi,ad3531r
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 50000000
+
+  vdd-supply:
+    description: Power Supply Input.
+
+  iovdd-supply:
+    description: Digital Power Supply Input.
+
+  io-channels:
+    description:
+      ADC channel used to monitor internal die temperature, output voltages, and
+      current of a selected channel via the MUXOUT pin.
+    maxItems: 1
+
+  ref-supply:
+    description:
+      Reference Input/Output. The voltage at the REF pin sets the full-scale
+      range of all channels. If not provided the internal reference is used and
+      also provided on the VREF pin.
+
+  reset-gpios:
+    description:
+      Active low signal that is falling edge sensitive. When it is deasserted,
+      the digital core initialization is performed and all DAC registers except
+      the Interface Configuration A register are reset to their default values.
+    maxItems: 1
+
+  ldac-gpios:
+    description:
+      LDAC pin to be used as a hardware trigger to update the DAC channels. If
+      not present, the DAC channels are updated by Software LDAC.
+    maxItems: 1
+
+  adi,range-double:
+    description:
+      Configure the output range for all channels. If the property is present,
+      the output will range from 0V to 2Vref. If the property is not
+      present, the output will range from 0V to Vref.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+  - iovdd-supply
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        dac@0 {
+            compatible = "adi,ad3530r";
+            reg = <0>;
+            spi-max-frequency = <1000000>;
+
+            vdd-supply = <&vdd>;
+            iovdd-supply = <&iovdd>;
+        };
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index ffdb3f21fc4fb35b349449afbb30fecd4fe72978..9deaf2561ade5b1319cef3cb31b997a4297c0cff 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1289,6 +1289,13 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
 F:	drivers/net/amt.c
 
+ANALOG DEVICES INC AD3530R DRIVER
+M:	Kim Seer Paller <kimseer.paller@analog.com>
+L:	linux-iio@vger.kernel.org
+S:	Supported
+W:	https://ez.analog.com/linux-software-drivers
+F:	Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
+
 ANALOG DEVICES INC AD3552R DRIVER
 M:	Nuno Sá <nuno.sa@analog.com>
 L:	linux-iio@vger.kernel.org

-- 
2.34.1

Re: [PATCH v3 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml
Posted by Nuno Sá 10 months, 1 week ago
Hi Kim,

On Thu, 2025-04-03 at 13:33 +0800, Kim Seer Paller wrote:
> Document the AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel)
> low-power, 16-bit, buffered voltage output DACs with software-
> programmable gain controls. They provide full-scale output spans of 2.5V
> or 5V for reference voltages of 2.5V. These devices operate on a single
> 2.7V to 5.5V supply and are guaranteed to be monotonic by design.
> The "R" variants include a 2.5V, 5ppm/°C internal reference, which is
> disabled by default.
> 
> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> ---
>  .../devicetree/bindings/iio/dac/adi,ad3530r.yaml   | 99
> ++++++++++++++++++++++
>  MAINTAINERS                                        |  7 ++
>  2 files changed, 106 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
> b/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
> new file mode 100644
> index
> 0000000000000000000000000000000000000000..cf4a3eb98f1fa30afdeb0740bba7f052d8ec
> 2cd4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/adi,ad3530r.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD3530R and Similar DACs
> +
> +maintainers:
> +  - Kim Seer Paller <kimseer.paller@analog.com>
> +
> +description: |
> +  The AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel) are low-
> power,
> +  16-bit, buffered voltage output digital-to-analog converters (DACs) with
> +  software-programmable gain controls, providing full-scale output spans of
> 2.5V
> +  or 5V for reference voltages of 2.5V. These devices operate from a single
> 2.7V
> +  to 5.5V supply and are guaranteed monotonic by design. The "R" variants
> +  include a 2.5V, 5ppm/°C internal reference, which is disabled by default.
> +  Datasheet can be found here:
> + 
> https://www.analog.com/media/en/technical-documentation/data-sheets/ad3530_ad530r.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad3530
> +      - adi,ad3530r
> +      - adi,ad3531
> +      - adi,ad3531r
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency:
> +    maximum: 50000000
> +
> +  vdd-supply:
> +    description: Power Supply Input.
> +
> +  iovdd-supply:
> +    description: Digital Power Supply Input.
> +
> +  io-channels:
> +    description:
> +      ADC channel used to monitor internal die temperature, output voltages,
> and
> +      current of a selected channel via the MUXOUT pin.
> +    maxItems: 1
> 

I'm a bit puzzled... Isn't this device the provider of such a channel?
Therefore, I believe we should have #io-channel-cells, right?

- Nuno Sá
Re: [PATCH v3 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml
Posted by David Lechner 10 months, 1 week ago
On 4/3/25 6:15 AM, Nuno Sá wrote:
> 
> Hi Kim,
> 
> On Thu, 2025-04-03 at 13:33 +0800, Kim Seer Paller wrote:
>> Document the AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel)
>> low-power, 16-bit, buffered voltage output DACs with software-
>> programmable gain controls. They provide full-scale output spans of 2.5V
>> or 5V for reference voltages of 2.5V. These devices operate on a single
>> 2.7V to 5.5V supply and are guaranteed to be monotonic by design.
>> The "R" variants include a 2.5V, 5ppm/°C internal reference, which is
>> disabled by default.
>>
>> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
>> ---
>>  .../devicetree/bindings/iio/dac/adi,ad3530r.yaml   | 99
>> ++++++++++++++++++++++
>>  MAINTAINERS                                        |  7 ++
>>  2 files changed, 106 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
>> b/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
>> new file mode 100644
>> index
>> 0000000000000000000000000000000000000000..cf4a3eb98f1fa30afdeb0740bba7f052d8ec
>> 2cd4
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad3530r.yaml
>> @@ -0,0 +1,99 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/iio/dac/adi,ad3530r.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Analog Devices AD3530R and Similar DACs
>> +
>> +maintainers:
>> +  - Kim Seer Paller <kimseer.paller@analog.com>
>> +
>> +description: |
>> +  The AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel) are low-
>> power,
>> +  16-bit, buffered voltage output digital-to-analog converters (DACs) with
>> +  software-programmable gain controls, providing full-scale output spans of
>> 2.5V
>> +  or 5V for reference voltages of 2.5V. These devices operate from a single
>> 2.7V
>> +  to 5.5V supply and are guaranteed monotonic by design. The "R" variants
>> +  include a 2.5V, 5ppm/°C internal reference, which is disabled by default.
>> +  Datasheet can be found here:
>> + 
>> https://www.analog.com/media/en/technical-documentation/data-sheets/ad3530_ad530r.pdf
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - adi,ad3530
>> +      - adi,ad3530r
>> +      - adi,ad3531
>> +      - adi,ad3531r
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  spi-max-frequency:
>> +    maximum: 50000000
>> +
>> +  vdd-supply:
>> +    description: Power Supply Input.
>> +
>> +  iovdd-supply:
>> +    description: Digital Power Supply Input.
>> +
>> +  io-channels:
>> +    description:
>> +      ADC channel used to monitor internal die temperature, output voltages,
>> and
>> +      current of a selected channel via the MUXOUT pin.
>> +    maxItems: 1
>>
> 
> I'm a bit puzzled... Isn't this device the provider of such a channel?
> Therefore, I believe we should have #io-channel-cells, right?

Nope. :-)

The MUXOUT is an analog output pin, so this property is to read back from
an external ADC what the analog value of MUXOUT is. The DAC doesn't have an
internal ADC for measuring these values.

Comes from Jonathan's suggestion on a similar chip:
https://lore.kernel.org/linux-iio/20240413160610.4cec010b@jic23-huawei/

> 
> - Nuno Sá
> 
> 


Re: [PATCH v3 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml
Posted by Krzysztof Kozlowski 10 months, 1 week ago
On 03/04/2025 07:33, Kim Seer Paller wrote:
> Document the AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel)
> low-power, 16-bit, buffered voltage output DACs with software-
> programmable gain controls. They provide full-scale output spans of 2.5V
> or 5V for reference voltages of 2.5V. These devices operate on a single
> 2.7V to 5.5V supply and are guaranteed to be monotonic by design.
> The "R" variants include a 2.5V, 5ppm/°C internal reference, which is
> disabled by default.
> 
> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> ---

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

Best regards,
Krzysztof
Re: [PATCH v3 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml
Posted by Krzysztof Kozlowski 10 months, 1 week ago
On Thu, Apr 03, 2025 at 01:33:56PM +0800, Kim Seer Paller wrote:
> Document the AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel)
> low-power, 16-bit, buffered voltage output DACs with software-
> programmable gain controls. They provide full-scale output spans of 2.5V
> or 5V for reference voltages of 2.5V. These devices operate on a single
> 2.7V to 5.5V supply and are guaranteed to be monotonic by design.
> The "R" variants include a 2.5V, 5ppm/°C internal reference, which is
> disabled by default.
> 
> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> ---
>  .../devicetree/bindings/iio/dac/adi,ad3530r.yaml   | 99 ++++++++++++++++++++++
>  MAINTAINERS                                        |  7 ++
>  2 files changed, 106 insertions(+)

You got report about error in v2, which you did not respond to.

You send v3... with same error. I don't understand this.

Best regards,
Krzysztof
Re: [PATCH v3 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml
Posted by Rob Herring (Arm) 10 months, 1 week ago
On Thu, 03 Apr 2025 13:33:56 +0800, Kim Seer Paller wrote:
> Document the AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel)
> low-power, 16-bit, buffered voltage output DACs with software-
> programmable gain controls. They provide full-scale output spans of 2.5V
> or 5V for reference voltages of 2.5V. These devices operate on a single
> 2.7V to 5.5V supply and are guaranteed to be monotonic by design.
> The "R" variants include a 2.5V, 5ppm/°C internal reference, which is
> disabled by default.
> 
> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> ---
>  .../devicetree/bindings/iio/dac/adi,ad3530r.yaml   | 99 ++++++++++++++++++++++
>  MAINTAINERS                                        |  7 ++
>  2 files changed, 106 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/adi,axi-adc.example.dtb: adc@0: pwm-names: ['convst1'] is too short
	from schema $id: http://devicetree.org/schemas/iio/adc/adi,ad7606.yaml#

doc reference errors (make refcheckdocs):
Warning: Documentation/arch/powerpc/cxl.rst references a file that doesn't exist: Documentation/ABI/testing/sysfs-class-cxl
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt
Warning: lib/Kconfig.debug references a file that doesn't exist: Documentation/dev-tools/fault-injection/fault-injection.rst
Documentation/arch/powerpc/cxl.rst: Documentation/ABI/testing/sysfs-class-cxl
MAINTAINERS: Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt
lib/Kconfig.debug: Documentation/dev-tools/fault-injection/fault-injection.rst

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250403-togreg-v3-2-d4b06a4af5a9@analog.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.