Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2168246lqa; Tue, 30 Apr 2024 09:47:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaO6tzUaep05CPlMYNkICk9wDETs0oWEs63mpgLdayXFXbSfhVlVrHcolJ1174qXdD0BS6Xk7S+98v7zFfBwR4LuRVwRuUpCTG5yQgow== X-Google-Smtp-Source: AGHT+IEYtzouGWxXuboQPF99RSzBIpZZr0nwpzeWowf5JIVB45xEYC/cvVNk80lifU5LpoYaMI8o X-Received: by 2002:a05:6a21:3e0b:b0:1a7:35b1:1894 with SMTP id bk11-20020a056a213e0b00b001a735b11894mr429232pzc.32.1714495642651; Tue, 30 Apr 2024 09:47:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714495642; cv=pass; d=google.com; s=arc-20160816; b=tlrbwQoySsypgiZHZBbmcV22ACKol5u8oKrM3arQhamErxI2FOUJUeqSI7SNBipawa COSyY1y4y0a3RsmftFPEpm0dde0gcerbEyobkmzeehhJ++Ng5CWikflADyBgT3XHsZkM grSjbVO1xAlWwezB4KKbeB0ilcfKf+UKQoueQuo5yKntwHQ6259H8yepuQJbDSntK9v4 r5ybNZDAil5r8bm+cQ4YMNo1Kt1dmE5YgW2kjWFat2MLGUMlMy7t9qa+JC7KdbsoELGc cYrOAHl+J8acC2rVdQ8WmO3M8XVzx9RAxj31h6HBGBbXwy2aND6vgK78pRIGaSTts+kb J8gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JSiIXjI+3kMzFgnCbJIBlPNQooVamTjjn6nT5fcwssI=; fh=nhB1EZ2X1HmfGVxir67N3/EK4ZRRGouUsLxUD0KFHYc=; b=qX6YXU8ve0i4vgQfgRCr0LuiiaEboH4fXnR86YFtYKu9Za/35cQPZBrttD+ZVPvDe9 IPdaSRAXgws/5XV8tqfuIBf+Y1qnDOaGhTMYiKIURPSpCQpFYQJtUOotHfMAX5JnQU2d qRtGpssyQkRQDxlCTY1vtwLA01baDdDTtGxJanLZNgq790Us37i/eCSoXXssp3U/7ZPi WOrua+5ugyfb1Q33TIIBYZqT/N6lzVDy1y5Bk9/qiOqcUKJhcvQ/ruedxwwq+Bm2ukMi yOemocdJs+ABcOVANiXIC7bK6VtbUC5mTVkwpSW7+nv4cAalgKCX85SIBUHHy+dhuz9/ wJ0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fThv5Yoz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164379-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b3-20020a056a000cc300b006f0c37121aasi21212204pfv.176.2024.04.30.09.47.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 09:47:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fThv5Yoz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164379-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AAA1DB24760 for ; Tue, 30 Apr 2024 16:31:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 054CC1802BE; Tue, 30 Apr 2024 16:30:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fThv5Yoz" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55AC42628C; Tue, 30 Apr 2024 16:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714494618; cv=none; b=KT8t9Tr7K5UgX0EWwgOwMXliXHvlRQh/szVyDMPedd/3mQVMPOpev7IDMLXYfINAlPxPGwFeGD+GMyc1jdBG05SyI1m3RMd328L9wvbzGgKuneOKTIyXnCPjK0pwAMmme1C+iHGbgV6nZvZhaluuX9DRxbKTRU+JuuihQlEthTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714494618; c=relaxed/simple; bh=hPDh075JBpq3peh9Fr0V6GtyB2F0d/4Fij2IT6owDC4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=k0lIpmwZDunoN+Pj62PL8e+8aBM7+ujt6SBEooSIKMoWTCqUhMBN5nBrbvjdPviFfIfmyL6hYi3luMcyICaaoV78iuWOoa7yNieCcQgFBOt4PD+XT4oUi98/pkO43mL+Tsg0n92iEFOygFKnJGf/87GBEMSkx5J1i+j4e9AkXgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fThv5Yoz; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-41b5e74fa2fso37084145e9.1; Tue, 30 Apr 2024 09:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714494615; x=1715099415; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JSiIXjI+3kMzFgnCbJIBlPNQooVamTjjn6nT5fcwssI=; b=fThv5Yoz/bRu3dlw2AphareO3UAfSuonWE/kKz2rubkC1rOCl0dhYgQsrOP99I4Ncl TzLReSlWUaE2brjDjSvZjw4bbAuMliiR4oEK9tmGyrJaWK2t3tPmOtWEvjeBh+gprn14 fH6pdBSpAvWRA41movCcuBPOlB09GIRK5fyhtvlyTpKEkszZk/tAW/skwjg0j5ziSN0n tjP0mCqUI6MZrum9RpcFrPPsCi6efQAYf28Z4P7+nZWqHKb2Zodc9qwXSQIMKlSCklYY orAmXoCduZo9XDUiOAu6uSK/4lFk8IcjyBqYiLfNgCWgkIEPUZ0+bqIBUGGEFdpUNci9 maHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714494615; x=1715099415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JSiIXjI+3kMzFgnCbJIBlPNQooVamTjjn6nT5fcwssI=; b=hQUGQ81yVzLLaUqlBdqDzSgX+D5M0ajIp+HFck4W8YF3FroA2+O2AfwX6oXR/E2aTd 1lI++XMtR6iIiXlv5pfzgJASWNxQeZ8nOlp0gzCACLCEI3dtRf0GXbcHCJvClT8OHef9 Jp1LffROgeGPbpMr5gtK9kXYR3jnHogGgzX5uKUJ07NGD504Waucd/drJZHVK4izmY/7 2G44MvdJ19CRD7QVRsJrWuQnFovqlBimzyLX6JAjYFMib4rDX/9RNHqiBennAnKMb5iB 5mzLQ5UnW3ocRL5QJgrjBzi+moAQh6+83nA88eI+9SHHnwZlZTeWFb3B4rPRVlh70YJp h5aw== X-Forwarded-Encrypted: i=1; AJvYcCWR4do/w2ANdQZnovvFuRGVfZZ/JloSvYkt56WN/C06hAicGy7R8q+7TppYKOVUulgLTKwKjhYMsr9hvXArPxPuhrFth9SpkU0V/KhLEk5JAAXI/mUnnJ7QIp06gQj6VVBfaaPA/aItV3vv+4TSI1hE9k4+icQ7gc4Fai7KSBJoeOAznQ== X-Gm-Message-State: AOJu0YwjiQTMDgbLgTnj3FifO57TaVB7YuCwV2Vl7sHs+h1VWzMLW0Gh N+DPukt1idPw7W+LZMArfXp9FF5h+wUZMNksz1VgEaycUO8C5XMv X-Received: by 2002:a05:600c:4e09:b0:418:df23:ae0e with SMTP id b9-20020a05600c4e0900b00418df23ae0emr18427wmq.40.1714494614655; Tue, 30 Apr 2024 09:30:14 -0700 (PDT) Received: from spiri.. ([2a02:2f08:a105:8300:da4d:6b2c:f166:22e6]) by smtp.gmail.com with ESMTPSA id h15-20020a05600c350f00b00418d68df226sm46505396wmq.0.2024.04.30.09.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 09:30:14 -0700 (PDT) From: Alisa-Dariana Roman X-Google-Original-From: Alisa-Dariana Roman To: michael.hennerich@analog.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: alexandru.tachici@analog.com, lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, andy@kernel.org, nuno.sa@analog.com, marcelo.schmitt@analog.com, bigunclemax@gmail.com, dlechner@baylibre.com, okan.sahin@analog.com, fr0st61te@gmail.com, alisa.roman@analog.com, marcus.folkesson@gmail.com, schnelle@linux.ibm.com, liambeguin@gmail.com Subject: [PATCH v7 5/6] dt-bindings: iio: adc: ad7192: Add AD7194 support Date: Tue, 30 Apr 2024 19:29:45 +0300 Message-Id: <20240430162946.589423-6-alisa.roman@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240430162946.589423-1-alisa.roman@analog.com> References: <20240430162946.589423-1-alisa.roman@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Unlike the other AD719Xs, AD7194 has configurable channels. The user can dynamically configure them in the devicetree. Also add an example for AD7194 devicetree. Signed-off-by: Alisa-Dariana Roman --- .../bindings/iio/adc/adi,ad7192.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml index cf5c568f140a..a03da9489ed9 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml @@ -21,8 +21,15 @@ properties: - adi,ad7190 - adi,ad7192 - adi,ad7193 + - adi,ad7194 - adi,ad7195 + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + reg: maxItems: 1 @@ -89,6 +96,42 @@ properties: description: see Documentation/devicetree/bindings/iio/adc/adc.yaml type: boolean +patternProperties: + "^channel@[0-9a-f]+$": + type: object + $ref: adc.yaml + unevaluatedProperties: false + + properties: + reg: + description: The channel index. + minimum: 0 + maximum: 271 + + diff-channels: + description: + Both inputs can be connected to pins AIN1 to AIN16 by choosing the + appropriate value from 1 to 16. + items: + minimum: 1 + maximum: 16 + + single-channel: + description: + Positive input can be connected to pins AIN1 to AIN16 by choosing the + appropriate value from 1 to 16. Negative input is connected to AINCOM. + items: + minimum: 1 + maximum: 16 + + oneOf: + - required: + - reg + - diff-channels + - required: + - reg + - single-channel + required: - compatible - reg @@ -103,6 +146,17 @@ required: allOf: - $ref: /schemas/spi/spi-peripheral-props.yaml# + - if: + properties: + compatible: + enum: + - adi,ad7190 + - adi,ad7192 + - adi,ad7193 + - adi,ad7195 + then: + patternProperties: + "^channel@[0-9a-f]+$": false unevaluatedProperties: false @@ -133,3 +187,38 @@ examples: adi,burnout-currents-enable; }; }; + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + adc@0 { + compatible = "adi,ad7194"; + reg = <0>; + + #address-cells = <1>; + #size-cells = <0>; + + spi-max-frequency = <1000000>; + spi-cpol; + spi-cpha; + clocks = <&ad7192_mclk>; + clock-names = "mclk"; + interrupts = <25 0x2>; + interrupt-parent = <&gpio>; + aincom-supply = <&aincom>; + dvdd-supply = <&dvdd>; + avdd-supply = <&avdd>; + vref-supply = <&vref>; + + channel@0 { + reg = <0>; + diff-channels = <1 6>; + }; + + channel@1 { + reg = <1>; + single-channel = <1>; + }; + }; + }; -- 2.34.1