From patchwork Mon Nov 28 13:35:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Leonard_G=C3=B6hrs?= X-Patchwork-Id: 26776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5675360wrr; Mon, 28 Nov 2022 05:42:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf7T0pzEiQ1O5YyRRbfOvwOYsNsB+Uq32JBHWdumIpQ+nmLZIdAoTpxUIv+iZVpyZUOVwq4x X-Received: by 2002:a17:902:bcc5:b0:189:6d55:91a8 with SMTP id o5-20020a170902bcc500b001896d5591a8mr14077737pls.127.1669642974476; Mon, 28 Nov 2022 05:42:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669642974; cv=none; d=google.com; s=arc-20160816; b=aCuECM7MECeEfxsFeQV3XIIGYe4afmgbWxof936Jnf872vm6FiLvI2Mk3J3KblqCAQ 25EO0QJccfK5v9R2It4f5jJggQIMn7tr5WDr2I460C4Fr1m6QxFIZ+CA/GoAZMTaSniz BMQOcUbBBBep+pyrIxVgGLHU9mkRMLXbJwH5NWWxSlRGk+RoiEjsSj2NJ680c+aI0tKZ KHu4prX8HqG7oDjHaHGtwwM0M/P0pFioLbqJCIqyAv3HEKUCdHFgLyhSISMjm3TZgGDO A5qsbtZXTq9b5i/7PKbYqRImnBwaNCAbiinUWEZxQStt/dXGmgVSKgLX40IWba4pn4J1 pYhQ== 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 :message-id:date:subject:cc:to:from; bh=M+TF52TSK9WBbzjjl/FdpfIF2+41R5pzenMd10eCNdg=; b=EDHn1ZHMoaxX6oo1gzorjGfdNOcjyiVdWEnygMg6rvxNrLgQx5fJhDS83cQCZL9cd7 Gfj5TL4ul/RNG+sTtP8B71+IbvtFT/yAQnT6WX461XfCRPL/qUoTk5d+feO4IV3LtZ16 9FimvaRLtw+lbr+cGPqoIMaEJAfdJd13buCAwE00IGmRahe5/aa+UNTHdhkwJ3eNSfMc vnfsFVcyFUnhC5BfsC5aIsjhC1+4SHf09JcoFJux+B8Wq98nfIAyLmXkKwzpgzlPNnWi xlXf43UAzQNZEMglYN455r5/SJOni+TKr9VRlYHJhI1BO5O/FMdTfFwbVgazG8TwcgAA f3kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63060a000000b0046f9c0d336esi13156370pgg.706.2022.11.28.05.42.40; Mon, 28 Nov 2022 05:42:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbiK1Nfn (ORCPT + 99 others); Mon, 28 Nov 2022 08:35:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbiK1Nfk (ORCPT ); Mon, 28 Nov 2022 08:35:40 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34201E713 for ; Mon, 28 Nov 2022 05:35:39 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozeID-0004QU-2T; Mon, 28 Nov 2022 14:35:29 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1ozeIB-000pYj-Hl; Mon, 28 Nov 2022 14:35:28 +0100 Received: from lgo by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1ozeIB-005gmA-Lu; Mon, 28 Nov 2022 14:35:27 +0100 From: =?utf-8?q?Leonard_G=C3=B6hrs?= To: =?utf-8?q?Leonard_G=C3=B6hrs?= , kernel@pengutronix.de, Jonathan Cameron , Lars-Peter Clausen Cc: Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] dt-bindings: iio: adc: add TI LMP92064 controller Date: Mon, 28 Nov 2022 14:35:02 +0100 Message-Id: <20221128133503.1355898-1-l.goehrs@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: lgo@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750747551518998072?= X-GMAIL-MSGID: =?utf-8?q?1750747551518998072?= Add binding documentation for the TI LMP92064 dual channel SPI ADC. Signed-off-by: Leonard Göhrs Reviewed-by: Krzysztof Kozlowski --- Changes from v2 -> v3: - Use unevaluatedProperties: false instead of additionalProperties: false Changes from v1 -> v2: - Rename the "shunt-resistor" devicetree property to "shunt-resistor-micro-ohms". - Add supply regulator support for the two voltage domains of the chip (vdd and vdig). - Add reference to spi-peripheral-props.yaml .../bindings/iio/adc/ti,lmp92064.yaml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml base-commit: b7b275e60bcd5f89771e865a8239325f86d9927d diff --git a/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml b/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml new file mode 100644 index 0000000000000..5fb65bf7749d0 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/ti,lmp92064.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments LMP92064 Precision Current and Voltage Sensor. + +maintainers: + - Leonard Göhrs + +description: | + The LMP92064 is a two channel ADC intended for combined voltage and current + measurements. + + The device contains two ADCs to allow simultaneous sampling of voltage and + current and thus of instantaneous power consumption. + +properties: + compatible: + enum: + - ti,lmp92064 + + reg: + maxItems: 1 + + vdd-supply: + description: Regulator that provides power to the main part of the chip + + vdig-supply: + description: | + Regulator that provides power to the digital I/O part of the chip + + shunt-resistor-micro-ohms: + description: | + Value of the shunt resistor (in µΩ) connected between INCP and INCN, + across which current is measured. Used to provide correct scaling of the + raw ADC measurement. + + reset-gpios: + maxItems: 1 + +required: + - compatible + - reg + - shunt-resistor-micro-ohms + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + spi { + #address-cells = <1>; + #size-cells = <0>; + + adc@0 { + compatible = "ti,lmp92064"; + reg = <0>; + vdd-supply = <&vdd>; + vdig-supply = <&vdd>; + spi-max-frequency = <20000000>; + shunt-resistor-micro-ohms = <15000>; + reset-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; + }; + }; +...