summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/iio/dac/st,stm32-dac.yaml
blob: 04045b932bd221fb7c3b00b45bbd773b1f92e9b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/st,stm32-dac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: STMicroelectronics STM32 DAC

description: |
  The STM32 DAC is a 12-bit voltage output digital-to-analog converter. The DAC
  may be configured in 8 or 12-bit mode. It has two output channels, each with
  its own converter.
  It has built-in noise and triangle waveform generator and supports external
  triggers for conversions. The DAC's output buffer allows a high drive output
  current.

maintainers:
  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>

properties:
  compatible:
    enum:
      - st,stm32f4-dac-core
      - st,stm32h7-dac-core

  reg:
    maxItems: 1

  resets:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: pclk

  vref-supply:
    description: Phandle to the vref input analog reference voltage.

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

additionalProperties: false

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - vref-supply
  - '#address-cells'
  - '#size-cells'

patternProperties:
  "^dac@[1-2]+$":
    type: object
    description:
      A DAC block node should contain at least one subnode, representing an
      DAC instance/channel available on the machine.

    properties:
      compatible:
        const: st,stm32-dac

      reg:
        description: Must be either 1 or 2, to define (single) channel in use
        enum: [1, 2]

      '#io-channel-cells':
        const: 1

    additionalProperties: false

    required:
      - compatible
      - reg
      - '#io-channel-cells'

examples:
  - |
    // Example on stm32mp157c
    #include <dt-bindings/clock/stm32mp1-clks.h>
    dac: dac@40017000 {
      compatible = "st,stm32h7-dac-core";
      reg = <0x40017000 0x400>;
      clocks = <&rcc DAC12>;
      clock-names = "pclk";
      vref-supply = <&vref>;
      #address-cells = <1>;
      #size-cells = <0>;

      dac@1 {
        compatible = "st,stm32-dac";
        #io-channel-cells = <1>;
        reg = <1>;
      };

      dac@2 {
        compatible = "st,stm32-dac";
        #io-channel-cells = <1>;
        reg = <2>;
      };
    };

...