From patchwork Sat Oct 31 18:12:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 320103 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp2434098ilc; Sat, 31 Oct 2020 11:15:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyArkMRKl5XpBprctHEPbQNyYC8DaDUC5rZDWgLZFkbdUI1Ca16iH4o2V26/zDsi81wsAl1 X-Received: by 2002:a17:906:c0c8:: with SMTP id bn8mr8194574ejb.256.1604168110722; Sat, 31 Oct 2020 11:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604168110; cv=none; d=google.com; s=arc-20160816; b=ioU6KcotuKOboZeKmDIsMuQsWENQfwXF42gO6BEJNTAvQGVDePTI9rZ2NJ8ioUNCbF 26gWnSrFhE4Hd8MWD//oC400f8w0DbcaOlTuz1XCEqRp7fyNou88PYQ/p6JoaM2edQjO VDUdtoMUd5+yXLhRYJWfMetGQR60Im3gFO0D8dz5VYymcCyyrJVU0QfWqrAtL+EEZo5J DToq6rfnuq0bAgrWFbTINAGazI6dXcpixvDaQdPqSoz0ujb9EuNjycoOq9v52YtqsI++ yEqID8Os2V8Kc3pvs06iWdGCh5LlI1bkZvZZwTZ/6h4yhpwf1CjPKe78HQXQ6APuM2ya 2JxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bvpYJ5kVNzqVAzRQBuwIsJZrl8hY4a+Q/fBy+dBjygk=; b=UlZFrrzNflA29zI7pke8+9iYhYmufcg4YLbEh3NNqU0JeARym7O4SP5iJB3UL9jHZ+ rV/iVNhb0hRb4HemJEuI1mUjZRFDpvsMop2qnwwJ461qsF3HfNqCYGEoNf68sDIpo58z szRNWGG6UFr+Y+bMZxG5z9hiLMTE45cwj995uP0vSolo6ZbIq2QBQMhYRJUvL+rGBuej G55aO2XbBKn8wYW3vPiDUO40bOIo5xKPfjWEe5mFgr8KJZkjVQRpGEkr8NtAmsm4P2gB TJpQc16RZwAiGGztRfbrQOSRq+6SGMxFVB/mERv33AvW+Kk8ZVqzML8TsmP+xC0pirFy zcVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0u5DT0qQ; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si8093688ejk.22.2020.10.31.11.15.10; Sat, 31 Oct 2020 11:15:10 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0u5DT0qQ; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728358AbgJaSPI (ORCPT + 6 others); Sat, 31 Oct 2020 14:15:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:46174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728247AbgJaSO6 (ORCPT ); Sat, 31 Oct 2020 14:14:58 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E336F20709; Sat, 31 Oct 2020 18:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168098; bh=uqY3t5DS/fLrjmuPBA7eur8K8fB96S7fLULj9OOiZw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0u5DT0qQ62kOs9tCaPSdEGLe20bgpq5FOJJAoFmQ0QOu3Iby7uEzwXSKqHr8RaVPk DDZKSS6+715OBw++hVenWzw2O8u/YmMKsOOTv4V7cQSqyu98eQd7VH27B3hp/Zr1P4 aWvjTSl87/oddhAa5INe8hoy9Q/xTUEuROmWGX7o= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Peter Rosin Subject: [PATCH 04/10] dt-bindings:iio:adc:envelope-detector: txt to yaml conversion. Date: Sat, 31 Oct 2020 18:12:36 +0000 Message-Id: <20201031181242.742301-5-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031181242.742301-1-jic23@kernel.org> References: <20201031181242.742301-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron Straight forward format conversion. The example in here is fun in that it has 2 separate provider / consumer pairs. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- .../bindings/iio/adc/envelope-detector.txt | 54 ------------ .../bindings/iio/adc/envelope-detector.yaml | 87 +++++++++++++++++++ 2 files changed, 87 insertions(+), 54 deletions(-) -- 2.28.0 diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt b/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt deleted file mode 100644 index 27544bdd4478..000000000000 --- a/Documentation/devicetree/bindings/iio/adc/envelope-detector.txt +++ /dev/null @@ -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"; - }; diff --git a/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml b/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml new file mode 100644 index 000000000000..6048be936aba --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml @@ -0,0 +1,87 @@ +# 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 + +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 + 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"; + }; +... +