Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Analog Devices AD5592R/AD5593R DAC/ADC
0008 
0009 maintainers:
0010   - Michael Hennerich <michael.hennerich@analog.com>
0011 
0012 properties:
0013   compatible:
0014     enum:
0015       - adi,ad5592r
0016       - adi,ad5593r
0017 
0018   reg:
0019     maxItems: 1
0020 
0021   spi-max-frequency:
0022     maximum: 30000000
0023 
0024   spi-cpol: true
0025 
0026   "#address-cells":
0027     const: 1
0028 
0029   "#size-cells":
0030     const: 0
0031 
0032   "#io-channel-cells":
0033     const: 1
0034 
0035   vref-supply:
0036     description: If not set internal 2.5V reference used.
0037 
0038   reset-gpios:
0039     maxItems: 1
0040 
0041   gpio-controller:
0042     description: Marks the device node as a GPIO controller.
0043 
0044   "#gpio-cells":
0045     const: 2
0046     description:
0047       The first cell is the GPIO number and the second cell specifies
0048       GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
0049 
0050 required:
0051   - compatible
0052   - reg
0053   - "#address-cells"
0054   - "#size-cells"
0055 
0056 allOf:
0057   - if:
0058       properties:
0059         compatible:
0060           contains:
0061             const: adi,ad5592r
0062     then:
0063       required:
0064         - spi-cpol
0065     else:
0066       properties:
0067         spi-cpol: false
0068 
0069 additionalProperties: false
0070 
0071 patternProperties:
0072   "^(channel@)[0-7]$":
0073     type: object
0074     description: Child node to describe a channel
0075     properties:
0076       reg:
0077         minimum: 0
0078         maximum: 7
0079 
0080       adi,mode:
0081         $ref: /schemas/types.yaml#/definitions/uint32
0082         enum: [0, 1, 2, 3, 8]
0083         description: |
0084           Mode or function of this channel.
0085           Macros specifying the valid values can be found in
0086           <dt-bindings/iio/adi,ad5592r.h>.
0087 
0088           The following values are currently supported:
0089           * CH_MODE_UNUSED (the pin is unused)
0090           * CH_MODE_ADC (the pin is ADC input)
0091           * CH_MODE_DAC (the pin is DAC output)
0092           * CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored
0093             by an ADC, since there is no disadvantage this should be
0094             considered as the preferred DAC mode)
0095           * CH_MODE_GPIO (the pin is registered with GPIOLIB)
0096 
0097       adi,off-state:
0098         $ref: /schemas/types.yaml#/definitions/uint32
0099         enum: [0, 1, 2, 3]
0100         description: |
0101           State of this channel when unused or the device gets removed.
0102           Macros specifying the  valid values can be found in
0103           <dt-bindings/iio/adi,ad5592r.h>.
0104           * CH_OFFSTATE_PULLDOWN (the pin is pulled down)
0105           * CH_OFFSTATE_OUT_LOW  (the pin is output low)
0106           * CH_OFFSTATE_OUT_HIGH (the pin is output high)
0107           * CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output)
0108 
0109     required:
0110       - reg
0111       - adi,mode
0112 
0113     additionalProperties: false
0114 
0115 examples:
0116   - |
0117     #include <dt-bindings/iio/adi,ad5592r.h>
0118     spi {
0119         #address-cells = <1>;
0120         #size-cells = <0>;
0121 
0122         addac@0 {
0123             compatible = "adi,ad5592r";
0124             #size-cells = <0>;
0125             #address-cells = <1>;
0126             #gpio-cells = <2>;
0127             reg = <0>;
0128 
0129             spi-max-frequency = <1000000>;
0130             spi-cpol;
0131 
0132             vref-supply = <&vref>;
0133             reset-gpios = <&gpio0 86 0>;
0134             gpio-controller;
0135 
0136             channel@0 {
0137                 reg = <0>;
0138                 adi,mode = <CH_MODE_DAC>;
0139             };
0140             channel@1 {
0141                 reg = <1>;
0142                 adi,mode = <CH_MODE_ADC>;
0143             };
0144             channel@2 {
0145                 reg = <2>;
0146                 adi,mode = <CH_MODE_DAC_AND_ADC>;
0147             };
0148             channel@3 {
0149                 reg = <3>;
0150                 adi,mode = <CH_MODE_DAC_AND_ADC>;
0151                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0152             };
0153             channel@4 {
0154                 reg = <4>;
0155                 adi,mode = <CH_MODE_UNUSED>;
0156                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0157             };
0158             channel@5 {
0159                 reg = <5>;
0160                 adi,mode = <CH_MODE_GPIO>;
0161                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0162             };
0163             channel@6 {
0164                 reg = <6>;
0165                 adi,mode = <CH_MODE_GPIO>;
0166                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0167             };
0168             channel@7 {
0169                 reg = <7>;
0170                 adi,mode = <CH_MODE_GPIO>;
0171                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0172             };
0173         };
0174         ad5593r@10 {
0175             compatible = "adi,ad5593r";
0176             #size-cells = <0>;
0177             #address-cells = <1>;
0178             #gpio-cells = <2>;
0179             reg = <0x10>;
0180             gpio-controller;
0181 
0182             channel@0 {
0183                 reg = <0>;
0184                 adi,mode = <CH_MODE_DAC>;
0185                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0186             };
0187             channel@1 {
0188                 reg = <1>;
0189                 adi,mode = <CH_MODE_ADC>;
0190                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0191             };
0192             channel@2 {
0193                 reg = <2>;
0194                 adi,mode = <CH_MODE_DAC_AND_ADC>;
0195                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0196             };
0197             channel@6 {
0198                 reg = <6>;
0199                 adi,mode = <CH_MODE_GPIO>;
0200                 adi,off-state = <CH_OFFSTATE_PULLDOWN>;
0201             };
0202         };
0203     };
0204 ...