Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759294AbcJTKA0 (ORCPT ); Thu, 20 Oct 2016 06:00:26 -0400 Received: from mail-db5eur01on0137.outbound.protection.outlook.com ([104.47.2.137]:53911 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758905AbcJTKAC (ORCPT ); Thu, 20 Oct 2016 06:00:02 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; From: Peter Rosin To: CC: Peter Rosin , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , "Peter Meerwald-Stadler" , Rob Herring , "Mark Rutland" , , Subject: [PATCH 3/4] dt-bindings: iio: document envelope-detector bindings Date: Thu, 20 Oct 2016 11:26:01 +0200 Message-ID: <1476955562-13673-4-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1476955562-13673-1-git-send-email-peda@axentia.se> References: <1476955562-13673-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: DB6P18901CA0022.EURP189.PROD.OUTLOOK.COM (10.169.208.160) To AM5PR0201MB2308.eurprd02.prod.outlook.com (10.169.243.7) X-MS-Office365-Filtering-Correlation-Id: d2094836-a212-479f-0cde-08d3f8cb37e9 X-Microsoft-Exchange-Diagnostics: 1;AM5PR0201MB2308;2:Xe+RF26RxOfea7smKYOB7cW+jqUNO1T6y0MknBr+3uy6ZNnj1/qrThdYCKKPLl5VJvyr++lRVEI3uyYojyODF8E1D3Gvqsi97L9iGi0ToSxUNd+rZbhmm4rpxAHIvRGS8CFttZNMOJytePRjfFfI4JFZLjDzfuXccpI29pph5QpOWVAqDG2c7gquo+GSLxCHAShvCYRcka3rO6Ct5ZuRsA==;3:CmVHp1eCSZYOC2gZ/1XzzKIOfdO355zxeHlzSm/dls9uDAp7BqIgyFmp8yDZd7keGz2c6SPf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ff3T0zvPlBrr0rJx/0yZk2gZ4Mkw1LtWy5RJzbGNEgYhKBEWDvpzgZ1k3c0WMKM85Oqc2ceiwGAtd3PgEUS8W4S8Q0Wei0fL+afnh06WRMxvenQVMl1pfEjGTJEQJBGdTTv5pCEZQalvLHGopd5fbFEg3w8H/9b00CUjxNt6t5hKhNfamkWbL4wJ9mY;4:+P/0Z+T0Xjk5M4TehMV0e7lusaONIBb/xtSaleoqsI6U+bTNZNrZkR++LzxJKqU8DE5tRxhDWtMnZbJKUJV/oJulYAELcP7SzZXDBY/hDG9g2IC4/LlprFIrzIlQYWM6ZS4kcPqVZeJVuXxGkEIX/XR6j3gi/qo0CJIqNpzNFTy7CSmnt+e1rlMGqxKrcON2D0mBe3iDt3E1uvYnuRGGaeHdsUiSPFQ023EdPpXONtB8PcFIE92dPBg37E+xitF5O3Nyj/hGEinSv4UEdzcIDFhXo9FFCphdDUaqmxU+CtNmUN/pAZ8TN/6CdBSVjkn0xHAirAtN1LpzILysEXD7VOKqizIpIsIwARFXnUschwGGmvI1d3HzG6V3d2ktKyrP3uHtJXZ7bmcqrg3rW6MDqa5xpVmXtjeVRzObcVkF50nhVbzNNmaK8mkVXb3wO0a8o1QOlRcgOx5sHO9Y0jVzC3XDpTFcN9zFyH6kvShcpbsgavFyV1FYf0FH2Pm8DMWXkRsGuJHYzvx7hQDFNQ4m0w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(26323138287068)(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6043046)(6042046);SRVR:AM5PR0201MB2308;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0201MB2308; X-Forefront-PRVS: 01018CB5B3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(979002)(6009001)(6069001)(7916002)(189002)(199003)(6116002)(8666005)(77096005)(97736004)(50226002)(2351001)(19580405001)(19580395003)(68736007)(8676002)(229853001)(36756003)(101416001)(66066001)(189998001)(81166006)(81156014)(92566002)(47776003)(76176999)(50986999)(110136003)(7846002)(6916009)(2906002)(586003)(105586002)(3846002)(6666003)(7736002)(5660300001)(4326007)(50466002)(305945005)(48376002)(74482002)(106356001)(33646002)(86362001)(5003940100001)(2950100002)(42186005)(7059030)(42262002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0201MB2308;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM5PR0201MB2308;23:RYP7JO3sYzFT7IZbSAwYEwUXePCjmx28zM1zVpl?= =?us-ascii?Q?Y2sOcFpychVZygBbbiZSRu1JIsz2wuhdBVX9mrPWcd41UR5Ek5RYwRTRiqbc?= =?us-ascii?Q?Gkz4LRCRWr8Q7kMP2cAukQHqEydMsn8vJ7H5uRmTaIqX79Vc/kUQCdoBdgIi?= =?us-ascii?Q?JVdt0OIAp7BnoOj5uWJeES2WTbMVJAQt3WM0nTin1h6jdGQKnCXEx74qreMU?= =?us-ascii?Q?FFuVm7tu8NXiVLK8U+ztMqdaZQNfciA1V2wkUjFM3B2Q/zUpkec5KhLQKImd?= =?us-ascii?Q?VabT36MGodCfQ7s7yxgYzTcH9vo7FVac/i1JOzafus1DlgA7i2KZlpsLpFiT?= =?us-ascii?Q?5En9qNB2aDEsoSUUqm61sKWK1ali+pbs+yYpBdgCSDwvVShlk/xARf17441c?= =?us-ascii?Q?9/s+wtUe8+wUKCGnffbRP5AD0uo79lObqZh3NfEQ7qgWgcHIik8+O7+hisXK?= =?us-ascii?Q?x8xWPm4Bku99+UbjxXe7Q/zZbhat1CEnrVKZKPaoO4ckGW3WlgCWJfq7ago5?= =?us-ascii?Q?CNUbHFjB/AqfyQG6h37iIm0UMyh9WWDr/VtuB759UVpnoT+ue9xGVyP5N6T0?= =?us-ascii?Q?AX2FO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BHIGlJ0FkWg1KniBodP8Ox0LkT6m+fUtNVqbXHtkEwPVDlURznLUcVIYzeUWCEiCAZCA95MvAwOvRPurRoL4JH3/av9Filpvl8J1K7ECGhEo54PpFp53Atxr/8OtCU5x7krcdI41AYjEXQiNEi3tIqnV8YzA/2zK/dl2C/A+44w8HM+/DSrsH9kR6ErIrH1XDAAvuVwSzanFN5+uA==;5:HxLfYFXswlCncuHYrVuFPM9ZEEuT4SKUjKiQbYrIOXa4mYmSMDOJnqk8FZIpGnhJUAaownCsa4EoNkIxwCCNP0UdTnpeG/kUtWImxzMDVbwir7s7xY6Li6I5SJ8wk8EjWpQ3kBFzpEdXV8Zh1ofeZ8zHwRFXM2NpzDt/ILGyqEM=;24:f8mw9DgLfxW+igwMs4CT3z9Obrx3v+UBiRkPQy3lC32PkfCQFVum7jN/LRx3aTiH3YS8/LgNWA8hg7WBdPlYauvSw1TNx7Nf3aE26Mqchwg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0201MB2308;7:r5W6XKBLz5h8aJbyEQS+17GBt8pRY46A+GD8vRHkBmMjHvA89fqpnYiFCyCbTlYVL0z8Q7ecKb/33c0xN2GQo4D02w0kNU5DyWQkheLhpisc0Wikq8yTW3A5ici0/eSU4jq+fgz3I89/yR4zIMoEVA0CgLIWQQ2bbFmtGaryAKHu7ZOOQd9OpmKrzw89zT6DDIzWYZBokvNtCEYMwae/xjvgko0uYsbYjQiHue9kme+euIjTlsAzGuWk01wk1RwdQAiQL+a1Y1W/Q2vwQgc0dwMlpaR/EukK+6hyEgS5HLJIESfqFN7R0D9BvvKIVsouoECh6AvXccX5eA+hcjx7FhnL2lkkd2lFCMuLMAqOQWk= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2016 09:26:47.6020 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0201MB2308 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3364 Lines: 97 Signed-off-by: Peter Rosin --- .../bindings/iio/adc/envelope-detector.txt | 65 ++++++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/envelope-detector.txt diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt new file mode 100644 index 000000000000..0e26299516fd --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt @@ -0,0 +1,65 @@ +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 "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". +- envelope-detector,dac-max: The maximum raw input value for the dac. +- envelope-detector,comp-interval-ms: How long to wait for the comparator + to trigger before moving on to another DAC level. This interval needs to + relate to the lowest possible frequency of the above input signal. + +Optional properties: +- envelope-detector,inverted: If the input signal is centered around the + dac-max voltage (instead of zero), this property causes the detector to + search for the lowest DAC value that does not triggers the comparator + (instead of the highest). The result is also inverted so that a lower DAC + reading yields a higher voltage value. + + +Example: + + &spi { + dac: ad7303@4 { + compatible = "adi,ad7303"; + reg = <4>; + spi-max-frequency = <10000000>; + Vdd-supply = <&vdd_supply>; + adi,use-external-reference; + REF-supply = <&vref_supply>; + #io-channel-cells = <1>; + }; + }; + + envelope-detector { + compatible = "envelope-detector"; + io-channels = <&dac 0>; + io-channel-names = "dac"; + + interrupt-parent = <&gpio>; + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; + interrupt-names = "comp"; + + envelope-detector,dac-max = <255>; + envelope-detector,comp-interval-ms = <50>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 8c8aae24b96b..4b6f6ec1b703 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6118,6 +6118,12 @@ S: Maintained F: Documentation/devicetree/bindings/iio/dac/dpot-dac.txt F: drivers/iio/dac/dpot-dac.c +IIO ENVELOPE DETECTOR +M: Peter Rosin +L: linux-iio@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/iio/adc/envelope-detector.txt + IIO SUBSYSTEM AND DRIVERS M: Jonathan Cameron R: Hartmut Knaack -- 2.1.4