summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/iio/adc/atmel,sama9260-adc.yaml
blob: e6a1f915b542179100a30a419d3a5ff43b6ff553 (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
111
112
113
114
115
116
117
118
119
120
121
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/atmel,sama9260-adc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AT91 sama9260 and similar Analog to Digital Converter (ADC)

maintainers:
  - Alexandre Belloni <alexandre.belloni@bootlin.com>

properties:
  compatible:
    enum:
      - atmel,at91sam9260-adc
      - atmel,at91sam9rl-adc
      - atmel,at91sam9g45-adc
      - atmel,at91sam9x5-adc
      - atmel,at91sama5d3-adc

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    minItems: 2
    maxItems: 2

  clock-names:
    items:
      - const: adc_clk
      - const: adc_op_clk

  atmel,adc-channels-used:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Bitmask of the channels muxed and enabled for this device

  atmel,adc-startup-time:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Startup Time of the ADC in microseconds as defined in the datasheet

  atmel,adc-vref:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Reference voltage in millivolts for the conversions

  atmel,adc-use-external-triggers:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enable the external triggers

  atmel,adc-use-res:
    $ref: /schemas/types.yaml#/definitions/string
    description:
      String corresponding to an identifier from atmel,adc-res-names property.
      If not specified, the highest resolution will be used.
    enum:
      - "lowres"
      - "highres"

  atmel,adc-sleep-mode:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enable sleep mode when no conversion

  atmel,adc-sample-hold-time:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Sample and Hold Time in microseconds

  atmel,adc-ts-wires:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Number of touchscreen wires. Must be set to enable touchscreen.
      NOTE: when adc touchscreen is enabled, the adc hardware trigger will be
      disabled. Since touchscreen will occupy the trigger register.
    enum:
      - 4
      - 5

  atmel,adc-ts-pressure-threshold:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Pressure threshold for touchscreen.

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

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - atmel,adc-channels-used
  - atmel,adc-startup-time
  - atmel,adc-vref

examples:
  - |
    #include <dt-bindings/dma/at91.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    soc {
        #address-cells = <1>;
        #size-cells = <1>;

        adc@fffb0000 {
            compatible = "atmel,at91sam9260-adc";
            reg = <0xfffb0000 0x100>;
            interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
            clocks = <&adc_clk>, <&adc_op_clk>;
            clock-names = "adc_clk", "adc_op_clk";
            atmel,adc-channels-used = <0xff>;
            atmel,adc-startup-time = <40>;
            atmel,adc-use-external-triggers;
            atmel,adc-vref = <3300>;
            atmel,adc-use-res = "lowres";
        };
    };
...