dt-bindings:iio:adc:envelope-detector: txt to yaml conversion.
Straight forward format conversion. The example in here is fun in that it has 2 separate provider / consumer pairs. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Rob Herring <robh@kernel.org> Cc: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20201031181242.742301-5-jic23@kernel.org
This commit is contained in:
parent
a86319f42c
commit
66a6dcc20e
@ -1,54 +0,0 @@
|
||||
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 = <®_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";
|
||||
};
|
@ -0,0 +1,86 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/iio/adc/envelope-detector.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: ADC envelope detector using a DAC and a comparator
|
||||
|
||||
maintainers:
|
||||
- Peter Rosin <peda@axentia.se>
|
||||
|
||||
description: |
|
||||
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|------<-------'
|
||||
| |
|
||||
'-------'
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: axentia,tse850-envelope-detector
|
||||
|
||||
io-channels:
|
||||
maxItems: 1
|
||||
description: Channel node of the dac to be used for comparator input.
|
||||
|
||||
io-channel-names:
|
||||
const: dac
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
interrupt-names:
|
||||
const: comp
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- io-channels
|
||||
- io-channel-names
|
||||
- interrupts
|
||||
- interrupt-names
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
dpot: dpot@28 {
|
||||
compatible = "microchip,mcp4651-104";
|
||||
reg = <0x28>;
|
||||
#io-channel-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
dac: dac {
|
||||
compatible = "dpot-dac";
|
||||
vref-supply = <®_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";
|
||||
};
|
||||
...
|
Loading…
Reference in New Issue
Block a user