diff mbox series

[v5,1/3] dt-bindings: iio: dac: AD5766 yaml documentation

Message ID 20210108183739.27634-1-cristian.pop@analog.com
State Superseded
Headers show
Series [v5,1/3] dt-bindings: iio: dac: AD5766 yaml documentation | expand

Commit Message

Cristian Pop Jan. 8, 2021, 6:37 p.m. UTC
This adds device tree bindings for the AD5766 DAC.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
---
Changelog v5:                                                              
        -rename to property to "output-range-voltage"
 .../bindings/iio/dac/adi,ad5766.yaml          | 64 +++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml

Comments

Jonathan Cameron Jan. 9, 2021, 7:08 p.m. UTC | #1
On Fri, 8 Jan 2021 20:37:38 +0200
Cristian Pop <cristian.pop@analog.com> wrote:

> New interface is proposed for dither functionality. This future allows

> composing  an external signals to the selected output channel.

> The dither signal can be turned on/off, scaled, inverted, or it can be

> selected from different sources.

> 

> Signed-off-by: Cristian Pop <cristian.pop@analog.com>

Hi Cristian,

One trivial inline to fix if you need to respin. Otherwise I can tidy up whilst
applying.

Jonathan


> ---

> Changelog v5:                                                              

>         - Rename property to: "in_voltageY_dither_enable"                  

>         - Change scale values to: "1 0.75 0.5 0.25"                        

>         - Specify KernelVersion

>  .../ABI/testing/sysfs-bus-iio-dac-ad5766      | 31 +++++++++++++++++++

>  1 file changed, 31 insertions(+)

>  create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766

> 

> diff --git a/Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766 b/Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766

> new file mode 100644

> index 000000000000..6e5e383b2c53

> --- /dev/null

> +++ b/Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766

> @@ -0,0 +1,31 @@

> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_dither_ennable

Typo, enable but I can fix that whilst applying if there is nothing else.

Jonathan

> +KernelVersion:	5.12

> +Contact:	linux-iio@vger.kernel.org

> +Description:

> +		Dither enable. Write 1 to enable dither or 0 to disable it.

> +

> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_dither_invert

> +KernelVersion:	5.12

> +Contact:	linux-iio@vger.kernel.org

> +Description:

> +		Inverts the dither applied to the selected DAC channel. Dither is not

> +		inverted by default. Write "1" to invert dither.

> +

> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_dither_scale_available

> +KernelVersion:	5.12

> +Contact:	linux-iio@vger.kernel.org

> +Description:

> +		Returns possible scalings available for the current channel.

> +

> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_dither_scale

> +KernelVersion:	5.12

> +Contact:	linux-iio@vger.kernel.org

> +Description:

> +		Scales the dither before it is applied to the selected channel.

> +

> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_dither_source

> +KernelVersion:	5.12

> +Contact:	linux-iio@vger.kernel.org

> +Description:

> +		Selects dither source applied to the selected channel. Write "0" to

> +		select N0 source, write "1" to select N1 source.
Rob Herring Jan. 11, 2021, 7:54 p.m. UTC | #2
On Fri, Jan 08, 2021 at 08:37:37PM +0200, Cristian Pop wrote:
> This adds device tree bindings for the AD5766 DAC.

> 

> Signed-off-by: Cristian Pop <cristian.pop@analog.com>

> ---

> Changelog v5:                                                              

>         -rename to property to "output-range-voltage"

>  .../bindings/iio/dac/adi,ad5766.yaml          | 64 +++++++++++++++++++

>  1 file changed, 64 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml

> 

> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml

> new file mode 100644

> index 000000000000..1deace7c48b2

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml

> @@ -0,0 +1,64 @@

> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

> +# Copyright 2020 Analog Devices Inc.

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/iio/dac/adi,ad5766.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Analog Devices AD5766 DAC device driver

> +

> +maintainers:

> +  - Cristian Pop <cristian.pop@analog.com>

> +

> +description: |

> +  Bindings for the Analog Devices AD5766 current DAC device. Datasheet can be

> +  found here:

> +    https://www.analog.com/media/en/technical-documentation/data-sheets/ad5766-5767.pdf

> +

> +properties:

> +  compatible:

> +    enum:

> +      - adi,ad5766

> +      - adi,ad5767

> +

> +  output-range-volts:


Use a unit defined in property-units.txt (-microvolt).

> +    description: Select converter output range.

> +

> +  reg:

> +    maxItems: 1

> +

> +  spi-max-frequency:

> +    maximum: 1000000

> +

> +  spi-cpol: true

> +

> +  reset-gpios:

> +    description: GPIO spec for the RESET pin. If specified, it will be asserted

> +      during driver probe. As the line is active low, it should be marked

> +      GPIO_ACTIVE_LOW.


'asserted during driver probe' is a Linux implementation detail not 
relevant to the binding.

> +    maxItems: 1

> +

> +required:

> +  - compatible

> +  - output-range-volts

> +  - reg

> +  - spi-max-frequency

> +  - spi-cpol

> +

> +additionalProperties: false

> +

> +examples:

> +  - |

> +    spi {

> +          #address-cells = <1>;

> +          #size-cells = <0>;

> +          

> +          ad5766@0 {

> +              compatible = "adi,ad5766";

> +              output-range-volts = <(-5) 5>;

> +              reg = <0>;

> +              spi-cpol;

> +              spi-max-frequency = <1000000>;

> +              reset-gpios = <&gpio 22 0>;

> +            };

> +      };

> -- 

> 2.17.1

>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml
new file mode 100644
index 000000000000..1deace7c48b2
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5766.yaml
@@ -0,0 +1,64 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2020 Analog Devices Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5766.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5766 DAC device driver
+
+maintainers:
+  - Cristian Pop <cristian.pop@analog.com>
+
+description: |
+  Bindings for the Analog Devices AD5766 current DAC device. Datasheet can be
+  found here:
+    https://www.analog.com/media/en/technical-documentation/data-sheets/ad5766-5767.pdf
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5766
+      - adi,ad5767
+
+  output-range-volts:
+    description: Select converter output range.
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 1000000
+
+  spi-cpol: true
+
+  reset-gpios:
+    description: GPIO spec for the RESET pin. If specified, it will be asserted
+      during driver probe. As the line is active low, it should be marked
+      GPIO_ACTIVE_LOW.
+    maxItems: 1
+
+required:
+  - compatible
+  - output-range-volts
+  - reg
+  - spi-max-frequency
+  - spi-cpol
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+          #address-cells = <1>;
+          #size-cells = <0>;
+          
+          ad5766@0 {
+              compatible = "adi,ad5766";
+              output-range-volts = <(-5) 5>;
+              reg = <0>;
+              spi-cpol;
+              spi-max-frequency = <1000000>;
+              reset-gpios = <&gpio 22 0>;
+            };
+      };