dt-bindings: iio: document envelope-detector bindings
authorPeter Rosin <peda@axentia.se>
Tue, 8 Nov 2016 11:58:57 +0000 (12:58 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 13 Nov 2016 13:07:16 +0000 (13:07 +0000)
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/devicetree/bindings/iio/adc/envelope-detector.txt [new file with mode: 0644]
MAINTAINERS

diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
new file mode 100644 (file)
index 0000000..27544bd
--- /dev/null
@@ -0,0 +1,54 @@
+Bindings for ADC envelope detector using a DAC and a comparator
+
+The DAC is used to find the peak level of an alternating voltage input
+signal by a binary search using the output of a comparator wired to
+an interrupt pin. Like so:
+                          _
+                         | \
+    input +------>-------|+ \
+                         |   \
+           .-------.     |    }---.
+           |       |     |   /    |
+           |    dac|-->--|- /     |
+           |       |     |_/      |
+           |       |              |
+           |       |              |
+           |    irq|------<-------'
+           |       |
+           '-------'
+
+Required properties:
+- compatible: Should be "axentia,tse850-envelope-detector"
+- io-channels: Channel node of the dac to be used for comparator input.
+- io-channel-names: Should be "dac".
+- interrupt specification for one client interrupt,
+  see ../../interrupt-controller/interrupts.txt for details.
+- interrupt-names: Should be "comp".
+
+Example:
+
+       &i2c {
+               dpot: mcp4651-104@28 {
+                       compatible = "microchip,mcp4651-104";
+                       reg = <0x28>;
+                       #io-channel-cells = <1>;
+               };
+       };
+
+       dac: dac {
+               compatible = "dpot-dac";
+               vref-supply = <&reg_3v3>;
+               io-channels = <&dpot 0>;
+               io-channel-names = "dpot";
+               #io-channel-cells = <1>;
+       };
+
+       envelope-detector {
+               compatible = "axentia,tse850-envelope-detector";
+               io-channels = <&dac 0>;
+               io-channel-names = "dac";
+
+               interrupt-parent = <&gpio>;
+               interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+               interrupt-names = "comp";
+       };
index e63719d536587194d676b9a6e666a893f984623e..76c3124fd62f70b545bb2c17a4ece8a69517ad8a 100644 (file)
@@ -6127,6 +6127,12 @@ F:       Documentation/ABI/testing/sysfs-bus-iio-dac-dpot-dac
 F:     Documentation/devicetree/bindings/iio/dac/dpot-dac.txt
 F:     drivers/iio/dac/dpot-dac.c
 
+IIO ENVELOPE DETECTOR
+M:     Peter Rosin <peda@axentia.se>
+L:     linux-iio@vger.kernel.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
+
 IIO SUBSYSTEM AND DRIVERS
 M:     Jonathan Cameron <jic23@kernel.org>
 R:     Hartmut Knaack <knaack.h@gmx.de>