Path: blob/master/Documentation/devicetree/bindings/iio/dac/adi,ad5592r.yaml
26309 views
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Analog Devices AD5592R/AD5593R DAC/ADC78maintainers:9- Michael Hennerich <michael.hennerich@analog.com>1011properties:12compatible:13enum:14- adi,ad5592r15- adi,ad5593r1617reg:18maxItems: 11920spi-max-frequency:21maximum: 300000002223spi-cpol: true2425"#address-cells":26const: 12728"#size-cells":29const: 03031"#io-channel-cells":32const: 13334vref-supply:35description: If not set internal 2.5V reference used.3637reset-gpios:38maxItems: 13940gpio-controller:41description: Marks the device node as a GPIO controller.4243"#gpio-cells":44const: 245description:46The first cell is the GPIO number and the second cell specifies47GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.4849required:50- compatible51- reg52- "#address-cells"53- "#size-cells"5455allOf:56- if:57properties:58compatible:59contains:60const: adi,ad5592r61then:62required:63- spi-cpol64else:65properties:66spi-cpol: false6768additionalProperties: false6970patternProperties:71"^(channel@)[0-7]$":72type: object73description: Child node to describe a channel74properties:75reg:76minimum: 077maximum: 77879adi,mode:80$ref: /schemas/types.yaml#/definitions/uint3281enum: [0, 1, 2, 3, 8]82description: |83Mode or function of this channel.84Macros specifying the valid values can be found in85<dt-bindings/iio/adi,ad5592r.h>.8687The following values are currently supported:88* CH_MODE_UNUSED (the pin is unused)89* CH_MODE_ADC (the pin is ADC input)90* CH_MODE_DAC (the pin is DAC output)91* CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored92by an ADC, since there is no disadvantage this should be93considered as the preferred DAC mode)94* CH_MODE_GPIO (the pin is registered with GPIOLIB)9596adi,off-state:97$ref: /schemas/types.yaml#/definitions/uint3298enum: [0, 1, 2, 3]99description: |100State of this channel when unused or the device gets removed.101Macros specifying the valid values can be found in102<dt-bindings/iio/adi,ad5592r.h>.103* CH_OFFSTATE_PULLDOWN (the pin is pulled down)104* CH_OFFSTATE_OUT_LOW (the pin is output low)105* CH_OFFSTATE_OUT_HIGH (the pin is output high)106* CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output)107108required:109- reg110- adi,mode111112additionalProperties: false113114examples:115- |116#include <dt-bindings/iio/adi,ad5592r.h>117spi {118#address-cells = <1>;119#size-cells = <0>;120121addac@0 {122compatible = "adi,ad5592r";123#size-cells = <0>;124#address-cells = <1>;125#gpio-cells = <2>;126reg = <0>;127128spi-max-frequency = <1000000>;129spi-cpol;130131vref-supply = <&vref>;132reset-gpios = <&gpio0 86 0>;133gpio-controller;134135channel@0 {136reg = <0>;137adi,mode = <CH_MODE_DAC>;138};139channel@1 {140reg = <1>;141adi,mode = <CH_MODE_ADC>;142};143channel@2 {144reg = <2>;145adi,mode = <CH_MODE_DAC_AND_ADC>;146};147channel@3 {148reg = <3>;149adi,mode = <CH_MODE_DAC_AND_ADC>;150adi,off-state = <CH_OFFSTATE_PULLDOWN>;151};152channel@4 {153reg = <4>;154adi,mode = <CH_MODE_UNUSED>;155adi,off-state = <CH_OFFSTATE_PULLDOWN>;156};157channel@5 {158reg = <5>;159adi,mode = <CH_MODE_GPIO>;160adi,off-state = <CH_OFFSTATE_PULLDOWN>;161};162channel@6 {163reg = <6>;164adi,mode = <CH_MODE_GPIO>;165adi,off-state = <CH_OFFSTATE_PULLDOWN>;166};167channel@7 {168reg = <7>;169adi,mode = <CH_MODE_GPIO>;170adi,off-state = <CH_OFFSTATE_PULLDOWN>;171};172};173ad5593r@10 {174compatible = "adi,ad5593r";175#size-cells = <0>;176#address-cells = <1>;177#gpio-cells = <2>;178reg = <0x10>;179gpio-controller;180181channel@0 {182reg = <0>;183adi,mode = <CH_MODE_DAC>;184adi,off-state = <CH_OFFSTATE_PULLDOWN>;185};186channel@1 {187reg = <1>;188adi,mode = <CH_MODE_ADC>;189adi,off-state = <CH_OFFSTATE_PULLDOWN>;190};191channel@2 {192reg = <2>;193adi,mode = <CH_MODE_DAC_AND_ADC>;194adi,off-state = <CH_OFFSTATE_PULLDOWN>;195};196channel@6 {197reg = <6>;198adi,mode = <CH_MODE_GPIO>;199adi,off-state = <CH_OFFSTATE_PULLDOWN>;200};201};202};203...204205206