1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/iio/dac/st,stm32-dac.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: STMicroelectronics STM32 DAC
8
9description: |
10  The STM32 DAC is a 12-bit voltage output digital-to-analog converter. The DAC
11  may be configured in 8 or 12-bit mode. It has two output channels, each with
12  its own converter.
13  It has built-in noise and triangle waveform generator and supports external
14  triggers for conversions. The DAC's output buffer allows a high drive output
15  current.
16
17maintainers:
18  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
19
20properties:
21  compatible:
22    enum:
23      - st,stm32f4-dac-core
24      - st,stm32h7-dac-core
25
26  reg:
27    maxItems: 1
28
29  resets:
30    maxItems: 1
31
32  clocks:
33    maxItems: 1
34
35  clock-names:
36    items:
37      - const: pclk
38
39  vref-supply:
40    description: Phandle to the vref input analog reference voltage.
41
42  '#address-cells':
43    const: 1
44
45  '#size-cells':
46    const: 0
47
48additionalProperties: false
49
50required:
51  - compatible
52  - reg
53  - clocks
54  - clock-names
55  - vref-supply
56  - '#address-cells'
57  - '#size-cells'
58
59patternProperties:
60  "^dac@[1-2]+$":
61    type: object
62    description:
63      A DAC block node should contain at least one subnode, representing an
64      DAC instance/channel available on the machine.
65
66    properties:
67      compatible:
68        const: st,stm32-dac
69
70      reg:
71        description: Must be either 1 or 2, to define (single) channel in use
72        enum: [1, 2]
73
74      '#io-channel-cells':
75        const: 1
76
77    additionalProperties: false
78
79    required:
80      - compatible
81      - reg
82      - '#io-channel-cells'
83
84examples:
85  - |
86    // Example on stm32mp157c
87    #include <dt-bindings/clock/stm32mp1-clks.h>
88    dac: dac@40017000 {
89      compatible = "st,stm32h7-dac-core";
90      reg = <0x40017000 0x400>;
91      clocks = <&rcc DAC12>;
92      clock-names = "pclk";
93      vref-supply = <&vref>;
94      #address-cells = <1>;
95      #size-cells = <0>;
96
97      dac@1 {
98        compatible = "st,stm32-dac";
99        #io-channel-cells = <1>;
100        reg = <1>;
101      };
102
103      dac@2 {
104        compatible = "st,stm32-dac";
105        #io-channel-cells = <1>;
106        reg = <2>;
107      };
108    };
109
110...
111