Merge tag 'platform-drivers-x86-v4.11-2' of git://git.infradead.org/linux-platform...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / iio / adc / st,stm32-adc.txt
1 STMicroelectronics STM32 ADC device driver
2
3 STM32 ADC is a successive approximation analog-to-digital converter.
4 It has several multiplexed input channels. Conversions can be performed
5 in single, continuous, scan or discontinuous mode. Result of the ADC is
6 stored in a left-aligned or right-aligned 32-bit data register.
7 Conversions can be launched in software or using hardware triggers.
8
9 The analog watchdog feature allows the application to detect if the input
10 voltage goes beyond the user-defined, higher or lower thresholds.
11
12 Each STM32 ADC block can have up to 3 ADC instances.
13
14 Each instance supports two contexts to manage conversions, each one has its
15 own configurable sequence and trigger:
16 - regular conversion can be done in sequence, running in background
17 - injected conversions have higher priority, and so have the ability to
18   interrupt regular conversion sequence (either triggered in SW or HW).
19   Regular sequence is resumed, in case it has been interrupted.
20
21 Contents of a stm32 adc root node:
22 -----------------------------------
23 Required properties:
24 - compatible: Should be "st,stm32f4-adc-core".
25 - reg: Offset and length of the ADC block register set.
26 - interrupts: Must contain the interrupt for ADC block.
27 - clocks: Clock for the analog circuitry (common to all ADCs).
28 - clock-names: Must be "adc".
29 - interrupt-controller: Identifies the controller node as interrupt-parent
30 - vref-supply: Phandle to the vref input analog reference voltage.
31 - #interrupt-cells = <1>;
32 - #address-cells = <1>;
33 - #size-cells = <0>;
34
35 Optional properties:
36 - A pinctrl state named "default" for each ADC channel may be defined to set
37   inX ADC pins in mode of operation for analog input on external pin.
38
39 Contents of a stm32 adc child node:
40 -----------------------------------
41 An ADC block node should contain at least one subnode, representing an
42 ADC instance available on the machine.
43
44 Required properties:
45 - compatible: Should be "st,stm32f4-adc".
46 - reg: Offset of ADC instance in ADC block (e.g. may be 0x0, 0x100, 0x200).
47 - clocks: Input clock private to this ADC instance.
48 - interrupt-parent: Phandle to the parent interrupt controller.
49 - interrupts: IRQ Line for the ADC (e.g. may be 0 for adc@0, 1 for adc@100 or
50   2 for adc@200).
51 - st,adc-channels: List of single-ended channels muxed for this ADC.
52   It can have up to 16 channels, numbered from 0 to 15 (resp. for in0..in15).
53 - #io-channel-cells = <1>: See the IIO bindings section "IIO consumers" in
54   Documentation/devicetree/bindings/iio/iio-bindings.txt
55
56 Optional properties:
57 - dmas: Phandle to dma channel for this ADC instance.
58   See ../../dma/dma.txt for details.
59 - dma-names: Must be "rx" when dmas property is being used.
60
61 Example:
62         adc: adc@40012000 {
63                 compatible = "st,stm32f4-adc-core";
64                 reg = <0x40012000 0x400>;
65                 interrupts = <18>;
66                 clocks = <&rcc 0 168>;
67                 clock-names = "adc";
68                 vref-supply = <&reg_vref>;
69                 interrupt-controller;
70                 pinctrl-names = "default";
71                 pinctrl-0 = <&adc3_in8_pin>;
72
73                 #interrupt-cells = <1>;
74                 #address-cells = <1>;
75                 #size-cells = <0>;
76
77                 adc@0 {
78                         compatible = "st,stm32f4-adc";
79                         #io-channel-cells = <1>;
80                         reg = <0x0>;
81                         clocks = <&rcc 0 168>;
82                         interrupt-parent = <&adc>;
83                         interrupts = <0>;
84                         st,adc-channels = <8>;
85                         dmas = <&dma2 0 0 0x400 0x0>;
86                         dma-names = "rx";
87                 };
88                 ...
89                 other adc child nodes follow...
90         };