From patchwork Sun Apr 25 16:31:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 427284 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3018041jao; Sun, 25 Apr 2021 09:33:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws7rBHHp7Haf2RRGiQAyQjhbsK/ebs0AxEi21by4UOpxAMTfG8XS6JhYgIx+pq6oycCPvq X-Received: by 2002:a17:906:154f:: with SMTP id c15mr14357200ejd.142.1619368418035; Sun, 25 Apr 2021 09:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619368418; cv=none; d=google.com; s=arc-20160816; b=qvAb7pXIdftYFu5kN/r3IlCqtC+5H2FREFIqd46qcdIN1hZE1OFdldbPSbrnvOEwjk C29KXQJAxtPW1OezcxYJAtytZqvYZLvDXKs4dAilnG9L3nRcf9V6gjQEimQaVUkuaxrA mxbQIVpWz4PMjH0x5FMYTF/jaRgndQnoITsB6XsEzag+7pvrCvbN4KatEhUaUZJLI87V tSMggZaZL/ZhprCVSGZuxhHW7a0h+Z0yHJadbBMAkTXrYFQLao81GiFZRxV1BUwnBgZ5 ZzmMhrXSBrINcNxyNb6svsNiVD4ZMuoBUoDSCgyHBd4yjjV/6fSe5llNS2LZkfd71tCE dgFg== 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=8xFOPSuOU0nLLtQkbdXebX9L8tjy2NNuGYJawBiiB+4=; b=o4pjwfuu+plppwIhqd7qhEcQ4t8386VgnrbPK9802kG9gilGMXhLy98e4Gb7fVqiB4 F+LdEokDY3l3Jknw5bblDsVjOkyP0/oL5tw/V6djApzMZqFullE6xjKPwPQbPf8QTb2o 4I57lIM5dRrRyJcLn6gswznNXOB0Yul6J3oopOFvfi94dnGqXVtWOZIs1nSxxlTWWc/r o64l3zlN2p7mA6VUGUQR2arHcGvYnHDHfEQqAH7Ein6urppYu6Eh5LSfaWPNHw02VTwQ /SF+9a2pTzr0y+QtRrE3Xl59PyEHThv9UITj43m6SdUQWf9ZCwr1lNHtwfarL1NcVYY3 ZV3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pohBCduK; 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 en21si10756468ejc.53.2021.04.25.09.33.37; Sun, 25 Apr 2021 09:33:38 -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=k20201202 header.b=pohBCduK; 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 S230359AbhDYQeQ (ORCPT + 6 others); Sun, 25 Apr 2021 12:34:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:41586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbhDYQeQ (ORCPT ); Sun, 25 Apr 2021 12:34:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0474E6134F; Sun, 25 Apr 2021 16:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619368416; bh=1cnTOpwEmhHn/XHo6OAvGUqI9JyOEADFhQakxBUHShA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pohBCduKfFnb9/C3+RwYv6DDrf/xJSZimrOgwDwN54XnDV5xVKkD8romnodSMQQ8B YYYtOkC5AVBABpuSbKAJne7WR+hVKKKJkzNz/Jq6F4YzTeRKWQ2IeVR8nCN+fh1IXx 1ErgrRKsXIm3cd4U4eGhPYjm3onvgTuX1EsJOewquKmtIOpwgYDEGEdTPffC6wCPOt EbSKWCkcOoTCJn8X9KvbtaxiFhqJPj37+BihhJLxxjrIIrQo7fg2qDZuT8XVlcNZF1 NZUilz9MjW3Gvldpf2oj56JibTzwJ+kirGazfKKf5cfd+mRxsnNpSVT+HJOMiWd8rC 9CEE7hhzHoVwA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring Cc: Lars-Peter Clausen , devicetree@vger.kernel.org, Jonathan Cameron , Michael Hennerich , Rob Herring Subject: [PATCH v4 2/2] dt-bindings:iio:adc:adi, ad7476: Add missing binding document Date: Sun, 25 Apr 2021 17:31:54 +0100 Message-Id: <20210425163154.73209-3-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210425163154.73209-1-jic23@kernel.org> References: <20210425163154.73209-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron This binding covers class of simple SPI ADCs which only provide data output - they don't have MOSI pin. The only real variation between them is over how many supplies they use and which one is used for the reference. Michael listed as maintainer for this one as it is his driver and falls under the catch all MAINTAINERS entry for ADI devices. Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Reviewed-by: Rob Herring --- v4: Fixed part number typo in patch title. .../bindings/iio/adc/adi,ad7476.yaml | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) -- 2.31.1 diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7476.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7476.yaml new file mode 100644 index 000000000000..cf711082ad7d --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7476.yaml @@ -0,0 +1,174 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Analog Devices Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/adi,ad7476.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AD7476 and similar simple SPI ADCs from multiple manufacturers. + +maintainers: + - Michael Hennerich + +description: | + A lot of simple SPI ADCs have very straight forward interfaces. + They typically don't provide a MOSI pin, simply reading out data + on MISO when the clock toggles. + +properties: + compatible: + enum: + - adi,ad7091 + - adi,ad7091r + - adi,ad7273 + - adi,ad7274 + - adi,ad7276 + - adi,ad7277 + - adi,ad7278 + - adi,ad7466 + - adi,ad7467 + - adi,ad7468 + - adi,ad7475 + - adi,ad7476 + - adi,ad7476a + - adi,ad7477 + - adi,ad7477a + - adi,ad7478 + - adi,ad7478a + - adi,ad7495 + - adi,ad7910 + - adi,ad7920 + - adi,ad7940 + - ti,adc081s + - ti,adc101s + - ti,adc121s + - ti,ads7866 + - ti,ads7867 + - ti,ads7868 + - lltc,ltc2314-14 + + reg: + maxItems: 1 + + vcc-supply: + description: + Main powersupply voltage for the chips, sometimes referred to as VDD on + datasheets. If there is no separate vref-supply, then this is needed + to establish channel scaling. + + vdrive-supply: + description: + Some devices have separate supply for their digital control side. + + vref-supply: + description: + Some devices have a specific reference voltage supplied on a different pin + to the other supplies. Needed to be able to establish channel scaling + unless there is also an internal reference available (e.g. ad7091r) + + spi-max-frequency: true + + adi,conversion-start-gpios: + description: A GPIO used to trigger the start of a conversion + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +allOf: + # Devices where reference is vcc + - if: + properties: + compatible: + contains: + enum: + - adi,ad7091 + - adi,ad7276 + - adi,ad7277 + - adi,ad7278 + - adi,ad7466 + - adi,ad7467 + - adi,ad7468 + - adi,ad7940 + - ti,adc081s + - ti,adc101s + - ti,adc121s + - ti,ads7866 + - ti,ads7868 + required: + - vcc-supply + # Devices with a vref + - if: + properties: + compatible: + contains: + enum: + - adi,ad7091r + - adi,ad7273 + - adi,ad7274 + - adi,ad7475 + - lltc,ltc2314-14 + then: + properties: + vref-supply: true + else: + properties: + vref-supply: false + # Devices with a vref where it is not optional + - if: + properties: + compatible: + contains: + enum: + - adi,ad7273 + - adi,ad7274 + - adi,ad7475 + - lltc,ltc2314-14 + then: + required: + - vref-supply + - if: + properties: + compatible: + contains: + enum: + - adi,ad7475 + - adi,ad7495 + then: + properties: + vdrive-supply: true + else: + properties: + vdrive-supply: false + - if: + properties: + compatible: + contains: + enum: + - adi,ad7091 + - adi,ad7091r + then: + properties: + adi,conversion-start-gpios: true + else: + properties: + adi,conversion-start-gpios: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + adc@0 { + compatible = "adi,ad7091r"; + reg = <0>; + spi-max-frequency = <5000000>; + vcc-supply = <&adc_vcc>; + vref-supply = <&adc_vref>; + }; + }; +...