Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp503615lqt; Thu, 6 Jun 2024 09:36:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoS3FWhBTC/4YL+DO1mM6GfjFAiHytdpEtEkLcaHKWEa/xQTOgrdLDAUg5AaiR1V4zNEp8DS8PqMWVmUh9gcW1nFGzM3iHEV0f6dqmQA== X-Google-Smtp-Source: AGHT+IGZuCWTj3YISvg05jwQyYP2+bh5eryFgdxeSuySngfIn+7jSHHgj8bsoAdS0z5LI1DkxQHq X-Received: by 2002:a05:620a:2187:b0:795:2301:5b59 with SMTP id af79cd13be357-79523fcddacmr679995685a.63.1717691761728; Thu, 06 Jun 2024 09:36:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717691761; cv=pass; d=google.com; s=arc-20160816; b=QDbZ5lxxfS36dhUONXkLDIS44sZ1weSIbZjA/xs97xUO8FDDTt7FtIejR/s8X8t9Ap oIE4CVHXVm6lvxfDFSkf78W9QjyI+W+XZLcIaKaZ0+n2twfCPH2wv/oa7InXNuROi1xB iqF3RLW6x5o6Cyb+3F28qrSe2aB+ljSLQGj20TlKWdS1B1He6oNKBV+k2jMIv0wY7axW UEgaa/sWJ0ihshHyQ7R/X7e65erq1oe4FsWuwGVMm2eTTacwb4pO/MrC1OY1Rj4wMOqI xJMWdgL/g8myq+iQpupC29tSc8VaiDtN2yiBZxf/IT7EzkbBTFViKyCz+KfQdRl1aW0r +mqw== 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=491GEVJBM/nY6jPxxV15PpDLfl3c2eoctjsUQy5xWHM=; fh=AZT2APFvbPdudOS1qkizVnAfs4NemHT+t6OXML9ZqVY=; b=nR4hAeGO1fC7tMWAAqAD9dTeg6za98yGB3xkr0k61KEBO0aEZFQvvmyltXloC1JxuY prVXDBYb2pVnt/iaTBuFtrAzNM5Z71xR4FouMWeYFDNMiBUS3Qmiq4N2teI2E9c3iCtw QJrECclgNqt03XD6xsDhOLiakv5wn5Sjkbg1COu54mp/3jyQttpFnjzgP4cqsRWlPRqa Tz64e/zIY2M/6IlJH+8kgHCk3/qMQajcTeFfK3Q6YfrMvwRc6e4FZ9CkWnNVi615RbCt 3VaJUml/wdnNF9I/RZBcSeh9S40q9Jr+YcV0FTISM7/FUPoVIm5yHrqVYT7LTsWz8gOc 6Uig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dolcini.it header.s=default header.b="PaSBu/iN"; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-204705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-795333390e4si123372285a.553.2024.06.06.09.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 09:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@dolcini.it header.s=default header.b="PaSBu/iN"; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-204705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6533F1C26290 for ; Thu, 6 Jun 2024 16:36:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B043D198A31; Thu, 6 Jun 2024 16:35:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b="PaSBu/iN" Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) (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 D15E3195F0F; Thu, 6 Jun 2024 16:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.194.8.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717691742; cv=none; b=OdbbaKDKg7rX4MOjz/D++UvXyE97g7svuchheoIU7PZ0fvaVBsRllUdanu3krZNDBOdhk425dzuM5Ncsz/Aa8E0gRnSRQo0kHo3Ef4uNeM+u/lf/20+bi8P5IeqCov/rO+qcpzELR+t6pTFSbpw4L27Opmg142CQUk8h8sJyo9g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717691742; c=relaxed/simple; bh=aHU4+FwLoaSWgDRB30Dp1ex2pYNaWD0i5KfMmU9QgXY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Y2redhrPVh7tQfFgxukqFNJ+2IflMVSBEx8vb1UKkQ/oJXszG2m+68/+x4sFCcUUEieTIq621TGB7gD+QCcS2kDuZL9wk5HoRN8ZxtM4P3Q6dvfxHe8evbJUNWLqSYyefINZHFE0IdCWRoGyUJd1HB51WwLgI2O9KqnhRvnYf/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it; spf=pass smtp.mailfrom=dolcini.it; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b=PaSBu/iN; arc=none smtp.client-ip=217.194.8.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dolcini.it Received: from francesco-nb.corp.toradex.com (31-10-206-125.static.upc.ch [31.10.206.125]) by mail11.truemail.it (Postfix) with ESMTPA id 1F5451FA62; Thu, 6 Jun 2024 18:35:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dolcini.it; s=default; t=1717691737; bh=491GEVJBM/nY6jPxxV15PpDLfl3c2eoctjsUQy5xWHM=; h=From:To:Subject; b=PaSBu/iNSl8FPfaK6sNE380iM1bg9ztu74kBz/jZWH0xGSf3eZX9X2E1hSICpdsKd xVUtOyKurYAnmVM5/1W+Vr6LkGbdOlD54FPOh1ZdbytMexwzQuP7xnM0WCSaUATFWA 5OwRg/T4H2qzhWzzChP+zUEjcjZFf08udKwYKkE8yNhakg46nGX17ztNpufKhoOXst 15VRFNBX+TJo3Xff4enHQkK4WQbWiuGYLoy8DRHdU0bt0IA3sQVGMMi0a39n3uqr0u GxLIOpvZbxratbzLqQHARiBmFTB6GGD5TuOwKbPcNa/+oh2rerJxMfWsvWFmeu8klU NrHzrCNtH2QZw== From: Francesco Dolcini To: Francesco Dolcini , =?UTF-8?q?Jo=C3=A3o=20Paulo=20Gon=C3=A7alves?= , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Gon=C3=A7alves?= , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Francesco Dolcini Subject: [PATCH v2 1/2] dt-bindings: iio: adc: add ti,ads1119 Date: Thu, 6 Jun 2024 18:35:28 +0200 Message-Id: <20240606163529.87528-2-francesco@dolcini.it> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606163529.87528-1-francesco@dolcini.it> References: <20240606163529.87528-1-francesco@dolcini.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: João Paulo Gonçalves Add devicetree bindings for Texas Instruments ADS1119 16-bit ADC with I2C interface. Datasheet: https://www.ti.com/lit/gpn/ads1119 Signed-off-by: João Paulo Gonçalves Signed-off-by: Francesco Dolcini --- v2: - add diff-channels and single-channel - add XOR check to make diff/single channel property required - add interrupts, reset-gpios and vref-supply to the example - fix missing additionalProperties/unevaluatedProperties warning in channels - remove ti,gain and ti,datarate as they aren't fixed hw properties - remove unnecessary | --- .../bindings/iio/adc/ti,ads1119.yaml | 148 ++++++++++++++++++ MAINTAINERS | 7 + 2 files changed, 155 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads1119.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1119.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads1119.yaml new file mode 100644 index 000000000000..cbf0d4ef3a11 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1119.yaml @@ -0,0 +1,148 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/ti,ads1119.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments ADS1119 ADC + +maintainers: + - João Paulo Gonçalves + +description: + The TI ADS1119 is a precision 16-bit ADC over I2C that offers single-ended and + differential measurements using a multiplexed input. It features a programmable + gain, a programmable sample rate, an internal oscillator and voltage reference, + and a 50/60Hz rejection filter. + +properties: + compatible: + const: ti,ads1119 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + reset-gpios: + maxItems: 1 + + vref-supply: + description: + ADC external reference voltage (VREF). + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + "#io-channel-cells": + const: 1 + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + +patternProperties: + "^channel@([0-6])$": + $ref: adc.yaml + type: object + properties: + reg: + minimum: 0 + maximum: 6 + + diff-channels: + description: + Differential input channels AIN0-AIN1, AIN2-AIN3 and AIN1-AIN2. + oneOf: + - items: + - const: 0 + - const: 1 + - items: + - const: 2 + - const: 3 + - items: + - const: 1 + - const: 2 + + single-channel: + description: + Single-ended input channels AIN0, AIN1, AIN2 and AIN3. + minimum: 0 + maximum: 3 + + oneOf: + - required: + - diff-channels + - required: + - single-channel + + required: + - reg + + unevaluatedProperties: false + +additionalProperties: false + +examples: + - | + + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + adc@40 { + compatible = "ti,ads1119"; + reg = <0x40>; + interrupt-parent = <&gpio1>; + interrupts = <25 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + vref-supply = <®_vref_ads1119>; + #address-cells = <1>; + #size-cells = <0>; + #io-channel-cells = <1>; + + channel@0 { + reg = <0>; + single-channel = <0>; + }; + + channel@1 { + reg = <1>; + diff-channels = <0 1>; + }; + + channel@2 { + reg = <2>; + single-channel = <3>; + }; + + channel@3 { + reg = <3>; + single-channel = <1>; + }; + + channel@4 { + reg = <4>; + single-channel = <2>; + }; + + channel@5 { + reg = <5>; + diff-channels = <1 2>; + }; + + channel@6 { + reg = <6>; + diff-channels = <2 3>; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index d6c90161c7bf..f1b2c4b815e2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22380,6 +22380,13 @@ M: Robert Richter S: Odd Fixes F: drivers/gpio/gpio-thunderx.c +TI ADS1119 ADC DRIVER +M: Francesco Dolcini +M: João Paulo Gonçalves +L: linux-iio@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/iio/adc/ti,ads1119.yaml + TI ADS7924 ADC DRIVER M: Hugo Villeneuve L: linux-iio@vger.kernel.org -- 2.39.2