Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3566012pxv; Mon, 12 Jul 2021 21:36:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj1pImgEGg59Wp9v2/mtuAhDD0flNvugGOCjJ1kbk0q1j0JABrdhfbNhQ4T0DKGAnjzeeB X-Received: by 2002:a6b:7e42:: with SMTP id k2mr1801663ioq.184.1626151016945; Mon, 12 Jul 2021 21:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626151016; cv=none; d=google.com; s=arc-20160816; b=OWH2RYkpG+PnJjpqWDlm9Wq0v0Q8i2jauXdZLApe+VVYhbEQcA8yA5Dhdl9dJdnS21 FUU9ZmTQ1DKFfjaqTA+LR7t9Ky5qqVxYchTi1tRkqcGGsVUwizgxXeTA/+sctRWSCNxq z9qeqQpUFlRQoAoTw5jM6ChKchjn+C6AjWQ9E2Ul+TH35V4FPmPqNWHx5rKMImqve0Oj CZOH5ONL8B108YABBUVZHQtNT6nKhGk7CXJe/pwDVXVpWEz58/MoTNcN1+I99gMDw4Tv 6CtPTs8WUR2jstVMjMDp4syre6FsdN0aAk2Unvdza/Sj4MWehP6p0vmFKf7+vlEu8vm/ q1+g== 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=tTZUe6lePqaiw1G9wbgvwq76zWCGlANz5kNfBk1PKF0=; b=tiKhCiTpDrzbgkQ2hJ/swLBwD/ITVffN5SuxLy4Ihf8DgzsbmPH5x687/PyekIimLj /Bf6En4ZsvKGWsxsTVXTpRQx6pf70uUQf5AQnlzcaiULoiTKx7I/f+a12uL6XUdI1rVm +RyUR5A8En6VarUtorRQLWrHC0cXWOxX+KEVhk7stFkD1CNN8MNQUItR9OZsjsftK1ue WF3yk0m570ymD8Z/nP5UnH8hJf+DT5iWmeD0tlrGbTtzUspildI4RbJAPGquHrGeNMpe ky2+DM43Bv5VOP6Eztme/E/mPeTLI3GmWVFWn/gS3TZd04oz1s4ezwqCh1nyOPGjM4qs 8kkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Gk7Qg/56"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 14si24556002ilx.34.2021.07.12.21.36.44; Mon, 12 Jul 2021 21:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@gmail.com header.s=20161025 header.b="Gk7Qg/56"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231349AbhGMEhx (ORCPT + 99 others); Tue, 13 Jul 2021 00:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbhGMEh3 (ORCPT ); Tue, 13 Jul 2021 00:37:29 -0400 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4EEDC0613E9; Mon, 12 Jul 2021 21:34:39 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id 201so6267340qkj.13; Mon, 12 Jul 2021 21:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tTZUe6lePqaiw1G9wbgvwq76zWCGlANz5kNfBk1PKF0=; b=Gk7Qg/56zPhOJqukqbmHlbVy1wDYjhJ0V3GXqS5Rb9RHRLzjccSJcXN+IodpmHi9JJ mYWzFpFLxpKzAVbEBjuRZQ7ubtRInDIy1sdnZS+5oIQN4Y03MGezTauNJXlivMM8hVqN Dou2+TjChLTehIhCAJdcWBRa/h6Kpu8TGDn6YkqY943AtJLSpYw32c4325lDa/x5digB x+NBIQ2XfQlkuJihehOmeqhuPFqTC1zsn4jLhqfL85DcVWJy1WuQAtf/g4n8zwLYGOrR YqO6lH5hTLde0g0dtdBTOL68f5knSVQGdPaRUVTwf0G5rnFtLlyrdA9J8WaHRrBa6YFX fzAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tTZUe6lePqaiw1G9wbgvwq76zWCGlANz5kNfBk1PKF0=; b=kfo520vrH18y68oVr4XhvaQJerT2pLUcY0B5op4J4R4A5nHCbWmPmwyr4BQw+tJfLp qaBQh+/+Wpim9lhEs8a1RQ3ROxSJOI5mYNAYIxUYcY38yojIAsphv0TPfBjxTVwLURwF f4aHgQoT5wvlfzGvx/1QOX2a0NHLOT2KnCIW/WTxIKbJxFBOqunlRgbrS31LjM4z7Teu RKfFxTmVKEi3/I2oZIxDCFcoo3NXLunHZQ0uVt0vL1AEeBO+HS4LfMvT5+fwSqZoQN1L STep1J4u+OTRkDPI5SJFiPd9csn+IL6Z4ilHcx6i9jCDaIFs4nWW54Y5CJl+pGQY/AU+ qIvg== X-Gm-Message-State: AOAM530sDNzFDFpbl362aDbdWfx2FoU4e+MWxoZWY1prRsrqyI9FtIGF 0PgL7cCczjGBIopj0gK5GXU= X-Received: by 2002:a05:620a:685:: with SMTP id f5mr426477qkh.148.1626150878899; Mon, 12 Jul 2021 21:34:38 -0700 (PDT) Received: from shaak.xiphos.ca (198-48-202-89.cpe.pppoe.ca. [198.48.202.89]) by smtp.gmail.com with ESMTPSA id x16sm7311455qkn.130.2021.07.12.21.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 21:34:38 -0700 (PDT) From: Liam Beguin To: liambeguin@gmail.com, lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, charles-antoine.couret@essensium.com, Nuno.Sa@analog.com Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org Subject: [PATCH v3 4/4] dt-bindings: iio: adc: ad7949: add per channel reference Date: Tue, 13 Jul 2021 00:34:25 -0400 Message-Id: <20210713043425.3321230-5-liambeguin@gmail.com> X-Mailer: git-send-email 2.30.1.489.g328c10930387 In-Reply-To: <20210713043425.3321230-1-liambeguin@gmail.com> References: <20210713043425.3321230-1-liambeguin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liam Beguin Add bindings documentation describing per channel reference voltage selection. This adds the adi,internal-ref-mv property, and child nodes for each channel. This is required to properly configure the ADC sample request based on which reference source should be used for the calculation. Signed-off-by: Liam Beguin --- .../bindings/iio/adc/adi,ad7949.yaml | 71 +++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7949.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7949.yaml index 9b56bd4d5510..18abba3b0b4d 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7949.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7949.yaml @@ -26,19 +26,65 @@ properties: reg: maxItems: 1 + vrefin-supply: + description: + Buffered ADC reference voltage supply. + vref-supply: description: - ADC reference voltage supply + Unbuffered ADC reference voltage supply. spi-max-frequency: true - "#io-channel-cells": + '#io-channel-cells': const: 1 + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + required: - compatible - reg - - vref-supply + +patternProperties: + '^channel@([0-7])$': + type: object + description: | + Represents the external channels which are connected to the ADC. + + properties: + reg: + description: | + The channel number. + Up to 4 channels, numbered from 0 to 3 for adi,ad7682. + Up to 8 channels, numbered from 0 to 7 for adi,ad7689 and adi,ad7949. + items: + minimum: 0 + maximum: 7 + + adi,internal-ref-mv: + description: | + Internal reference voltage selection in millivolts. + + If no internal reference is specified, the channel will default to the + external reference defined by vrefin-supply (or vref-supply). + vrefin-supply will take precedence over vref-supply if both are defined. + + If no supplies are defined, the reference selection will default to + 4096mV internal reference. + + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [2500, 4096] + default: 4096 + + required: + - reg + + additionalProperties: false additionalProperties: false @@ -49,9 +95,26 @@ examples: #size-cells = <0>; adc@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "adi,ad7949"; reg = <0>; - vref-supply = <&vdd_supply>; + vrefin-supply = <&vdd_supply>; + + channel@0 { + adi,internal-ref-mv = <4096>; + reg = <0>; + }; + + channel@1 { + adi,internal-ref-mv = <2500>; + reg = <1>; + }; + + channel@2 { + reg = <2>; + }; }; }; ... -- 2.30.1.489.g328c10930387