xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/envelope-detector.yaml (revision 5def4c47d4bd90b209b9b4a4ba9faec15846d8fd)
1*5def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*5def4c47SEmmanuel Vadot%YAML 1.2
3*5def4c47SEmmanuel Vadot---
4*5def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/adc/envelope-detector.yaml#
5*5def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*5def4c47SEmmanuel Vadot
7*5def4c47SEmmanuel Vadottitle: ADC envelope detector using a DAC and a comparator
8*5def4c47SEmmanuel Vadot
9*5def4c47SEmmanuel Vadotmaintainers:
10*5def4c47SEmmanuel Vadot  - Peter Rosin <peda@axentia.se>
11*5def4c47SEmmanuel Vadot
12*5def4c47SEmmanuel Vadotdescription: |
13*5def4c47SEmmanuel Vadot  The DAC is used to find the peak level of an alternating voltage input
14*5def4c47SEmmanuel Vadot  signal by a binary search using the output of a comparator wired to
15*5def4c47SEmmanuel Vadot  an interrupt pin. Like so:
16*5def4c47SEmmanuel Vadot                          _
17*5def4c47SEmmanuel Vadot                         | \
18*5def4c47SEmmanuel Vadot    input +------>-------|+ \
19*5def4c47SEmmanuel Vadot                         |   \
20*5def4c47SEmmanuel Vadot           .-------.     |    }---.
21*5def4c47SEmmanuel Vadot           |       |     |   /    |
22*5def4c47SEmmanuel Vadot           |    dac|-->--|- /     |
23*5def4c47SEmmanuel Vadot           |       |     |_/      |
24*5def4c47SEmmanuel Vadot           |       |              |
25*5def4c47SEmmanuel Vadot           |       |              |
26*5def4c47SEmmanuel Vadot           |    irq|------<-------'
27*5def4c47SEmmanuel Vadot           |       |
28*5def4c47SEmmanuel Vadot           '-------'
29*5def4c47SEmmanuel Vadot
30*5def4c47SEmmanuel Vadotproperties:
31*5def4c47SEmmanuel Vadot  compatible:
32*5def4c47SEmmanuel Vadot    const: axentia,tse850-envelope-detector
33*5def4c47SEmmanuel Vadot
34*5def4c47SEmmanuel Vadot  io-channels:
35*5def4c47SEmmanuel Vadot    maxItems: 1
36*5def4c47SEmmanuel Vadot    description: Channel node of the dac to be used for comparator input.
37*5def4c47SEmmanuel Vadot
38*5def4c47SEmmanuel Vadot  io-channel-names:
39*5def4c47SEmmanuel Vadot    const: dac
40*5def4c47SEmmanuel Vadot
41*5def4c47SEmmanuel Vadot  interrupts:
42*5def4c47SEmmanuel Vadot    maxItems: 1
43*5def4c47SEmmanuel Vadot
44*5def4c47SEmmanuel Vadot  interrupt-names:
45*5def4c47SEmmanuel Vadot    const: comp
46*5def4c47SEmmanuel Vadot
47*5def4c47SEmmanuel Vadotrequired:
48*5def4c47SEmmanuel Vadot  - compatible
49*5def4c47SEmmanuel Vadot  - io-channels
50*5def4c47SEmmanuel Vadot  - io-channel-names
51*5def4c47SEmmanuel Vadot  - interrupts
52*5def4c47SEmmanuel Vadot  - interrupt-names
53*5def4c47SEmmanuel Vadot
54*5def4c47SEmmanuel VadotadditionalProperties: false
55*5def4c47SEmmanuel Vadot
56*5def4c47SEmmanuel Vadotexamples:
57*5def4c47SEmmanuel Vadot  - |
58*5def4c47SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
59*5def4c47SEmmanuel Vadot    i2c {
60*5def4c47SEmmanuel Vadot        #address-cells = <1>;
61*5def4c47SEmmanuel Vadot        #size-cells = <0>;
62*5def4c47SEmmanuel Vadot        dpot: dpot@28 {
63*5def4c47SEmmanuel Vadot            compatible = "microchip,mcp4651-104";
64*5def4c47SEmmanuel Vadot            reg = <0x28>;
65*5def4c47SEmmanuel Vadot            #io-channel-cells = <1>;
66*5def4c47SEmmanuel Vadot        };
67*5def4c47SEmmanuel Vadot    };
68*5def4c47SEmmanuel Vadot
69*5def4c47SEmmanuel Vadot    dac: dac {
70*5def4c47SEmmanuel Vadot        compatible = "dpot-dac";
71*5def4c47SEmmanuel Vadot        vref-supply = <&reg_3v3>;
72*5def4c47SEmmanuel Vadot        io-channels = <&dpot 0>;
73*5def4c47SEmmanuel Vadot        io-channel-names = "dpot";
74*5def4c47SEmmanuel Vadot        #io-channel-cells = <1>;
75*5def4c47SEmmanuel Vadot    };
76*5def4c47SEmmanuel Vadot
77*5def4c47SEmmanuel Vadot    envelope-detector {
78*5def4c47SEmmanuel Vadot        compatible = "axentia,tse850-envelope-detector";
79*5def4c47SEmmanuel Vadot        io-channels = <&dac 0>;
80*5def4c47SEmmanuel Vadot        io-channel-names = "dac";
81*5def4c47SEmmanuel Vadot
82*5def4c47SEmmanuel Vadot        interrupt-parent = <&gpio>;
83*5def4c47SEmmanuel Vadot        interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
84*5def4c47SEmmanuel Vadot        interrupt-names = "comp";
85*5def4c47SEmmanuel Vadot    };
86*5def4c47SEmmanuel Vadot...
87