From patchwork Tue Nov 1 06:48:03 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: 13536 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2778976wru; Mon, 31 Oct 2022 23:53:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SP1NF3Lv0zp16WgNqayS1Lw3ycw23k4HjN2mT3ye/J0eSvqpCEBEiOmtaQx4Nv/XKnMdh X-Received: by 2002:aa7:ce92:0:b0:461:78c7:dfe2 with SMTP id y18-20020aa7ce92000000b0046178c7dfe2mr18171999edv.342.1667285587996; Mon, 31 Oct 2022 23:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667285587; cv=none; d=google.com; s=arc-20160816; b=ET7cdvqtkhxalG0N9qS+w3kUkwSM2oK9ES0R9ayMDk1/ZJEyjKHR8FodSlZtKIc+2B RArl1+msPzCqR5FUJN69W3fY5VH/ms6OCEoj2F3Be7MNi2GnwQDNqxIMrPRJIzNWgw38 +79JQsgbP/lIG3YSfwFjXzGXdvcd6z4sRaWF73AaaKC5rM4/xgDGPxImBdpUQke1knuI 5BszOO+3HfhDhR08jQQehW6DeVRUAeZCjRujZ6S2ERuCaGrl4lXrGmfRSLu0d8qavRHs LSlIEn4fYGr1E5ahQQGggyomJbTsO7YyOYdkqbegOXG+JY1a4mh02Z+L9O3zfrYe89Uv iePw== 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=1sbrjVbtEmmCUNYgCZkUIrmZiwFDHeBV6yWqI2BrYeE=; b=NBnfP/c4bKU1TrcG/VsL7QM9Lbu9hVz9l6II3K+pag8sHBtIt8MXTQPyXJJwXbWFbu KK4rYW1w+g+0n8roF0MK1UE2m3kkrMmaQ5InOrF2gWgK7P7qGoxyv5Li0Sck9M7kCWQh nJh7rksQ6wMZbBWNWkKpGlrvviseo6v6ZpbHvDVq0kLWWqj+OBr41OCOJ+0Xb59b03jv NuSWqSu+M6T0gKtOVXoOesjjHwd3d3A2Yr35cOD/Gki+9p1hEaL5E825nE8BWQRRb3cO e021OLPYIlFqJjg8XPAx9vcz/19O0D9EEeoqcscngGNH6X2VlAyUkmL3mE1BAnofNl03 6O1g== 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 s5-20020a508d05000000b0045b50cee511si11997821eds.122.2022.10.31.23.52.43; Mon, 31 Oct 2022 23:53:07 -0700 (PDT) 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 S229915AbiKAGsy (ORCPT + 99 others); Tue, 1 Nov 2022 02:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbiKAGsx (ORCPT ); Tue, 1 Nov 2022 02:48:53 -0400 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 DACF05F63 for ; Mon, 31 Oct 2022 23:48:52 -0700 (PDT) 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 1opl4h-0004HL-NK; Tue, 01 Nov 2022 07:48:39 +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 1opl4h-001clN-Gj; Tue, 01 Nov 2022 07:48:38 +0100 Received: from lgo by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1opl4f-0031LM-QQ; Tue, 01 Nov 2022 07:48:37 +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 v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller Date: Tue, 1 Nov 2022 07:48:03 +0100 Message-Id: <20221101064804.720050-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?1748275652998358872?= X-GMAIL-MSGID: =?utf-8?q?1748275652998358872?= Add binding documentation for the TI LMP92064 dual channel SPI ADC. 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 Signed-off-by: Leonard Göhrs --- .../bindings/iio/adc/ti,lmp92064.yaml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml 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 000000000000..357b15ebd897 --- /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# + +additionalProperties: 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>; + }; + }; +...