From patchwork Sun Sep 17 21:11:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Mikhaylov X-Patchwork-Id: 141222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2367327vqi; Sun, 17 Sep 2023 17:51:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkXINlkGbAkp974WDo2e5D4aIT4kaAtour//CEgXlS74SpzH8WYatOTVL6JrKtMIiS75Gx X-Received: by 2002:a17:902:db0e:b0:1b8:af5e:853c with SMTP id m14-20020a170902db0e00b001b8af5e853cmr12799535plx.26.1694998262216; Sun, 17 Sep 2023 17:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694998262; cv=none; d=google.com; s=arc-20160816; b=maYk4LRcOcbrYZXmWPOyAc5vsXU4xsKNPNjEZddqER+/TqTdPffKavUIPRl0I2BXXf 14O+iCX2GYPsU6aWn29BxCmxLbDNP0Yd4XnGGBwQVUXHamMmCXjWbRtc3pG6x++vn+ES tgSDX0dcq72o6SqVHJQzqFcqdg7ZAMZCNkmDMadTbXCo6woOO63qTPWb4N27aQ3rqN1B kzsuID22cr/+wtKr45BPyNNoKcJTCDfg8Us4SQTPRq4eSE8Im96/r0Vryz65l6u6m9Lx VH+1MfTgPp27yWHU19sCxaX9pD0MXy5PbDlqWxbJK5qdwtQp7oC3DFC3R+GJ90ECMt6F YGYg== 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=HSVdBe6r93QrgKS3he21TKM8q8THmRfH47H2f/qi7rs=; fh=gXdKdTzXVpCzUn5wRwZJ/NCMvVwA1kGKWl4i6uq6pzM=; b=AyZdsS3LcLeNiZKVDC+afvngnmdXr+q6nXP8oHPucrJsId+1I7VMh7QHp04C8bqJL6 MmdBKPRcKLLw3ppL3gcPuu6aDzs80KhOFYjWXE8e4XcHwgsS1sp1Qqeqr5ingm6ytoF+ lWiBGGf9rwiAMG0LwE2nlPx0l//F5lanzBYXCeqILdRbcK8gkwCjhlkuzL32cUyD+SME Vb5AkyfbahApL9T223/jDaSwjLuUplTUQhj/oms7pYApePUWa9CFmQ1MZoZOZfw51lB5 ar58u35pz8BKPjSEsD0BVow61c96qplYdVlfbVvuI+l8WVvfuUfuqXaOKt2mlfZoy482 nl5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PsNnpMnS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k7-20020a170902c40700b001bb0ff2b354si7376375plk.425.2023.09.17.17.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 17:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PsNnpMnS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1F835827A0B4; Sun, 17 Sep 2023 14:12:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238963AbjIQVMO (ORCPT + 28 others); Sun, 17 Sep 2023 17:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239032AbjIQVMA (ORCPT ); Sun, 17 Sep 2023 17:12:00 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AD0712B; Sun, 17 Sep 2023 14:11:54 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b962c226ceso63382161fa.3; Sun, 17 Sep 2023 14:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694985112; x=1695589912; 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=HSVdBe6r93QrgKS3he21TKM8q8THmRfH47H2f/qi7rs=; b=PsNnpMnS3g8oPR55wnZHHExVPpz6jjMODbwO7CzxG+pgoRBIqdNVj8Bu9zl/UZIxdG dDUefQm+e7XU3xwfOz4amUs2oHTStqUCVEknZytwqPJ/sr10VLJeDZzpQyibGmTM2kWL 2pDxrSbhR0lQlzVT8ztZTUWY1mymU6vIQBZys/ukk6nofPe4zg5OKdIx4JOkA+u69n+d eBvOeV+0vEyu83EhViJ3BnlFpltkYI9/5H8/bdsd8eLaq7wJxZwnNbPwNpK38nZojkqD wGOq5N2q0ZxoR1jpCvMc7e0AofHtPU2RvfIUEh1LUMbwEXYqMq0UAt1Ou2WJpQzW4tay OHxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694985112; x=1695589912; 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=HSVdBe6r93QrgKS3he21TKM8q8THmRfH47H2f/qi7rs=; b=vSlmQKZHxfcmQVb/lUIF9sjeAPy/koP8y+4jhJ/XBLmMIU1QAsoxg37Mjz40qlpEyO z7nJlfWkybtaC1BOw4BOFQEOIFsCwB2z0xTmstmKvC0oIykH2AwOSdYg7/yUxHGIF9Wp 94sXAnOJb7oo1Yf0skA0gzo0iwsLIiP9sb7y61b4s8ABwhqYDIzR5gdMhHD9+Cgi8ozV caTfS2cBoOg70kPxzS8qVhkrm/9m5cVfY1IBRGvfRIR9eNN4jkSEixvJsheahNpQYzaT S6/Xdi6+IfnLFYhiQHDUkaHLN+jJOcpv7QefEXv4QhXyqMBUQmyYh6AzEKhtOeYV2pxA U/UA== X-Gm-Message-State: AOJu0Yw7HmURuXsiCgAuAm0CvdyAHDIt3qDXgMJwBNy6r8oyW4p9NN6C nCVTJ+RdFeARRNcknv5dyB4= X-Received: by 2002:a2e:9656:0:b0:2be:4d40:f833 with SMTP id z22-20020a2e9656000000b002be4d40f833mr6406063ljh.18.1694985112315; Sun, 17 Sep 2023 14:11:52 -0700 (PDT) Received: from fr.lan ([46.31.31.48]) by smtp.googlemail.com with ESMTPSA id p15-20020a2e740f000000b002bce3123639sm1766309ljc.98.2023.09.17.14.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 14:11:51 -0700 (PDT) From: Ivan Mikhaylov To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Ivan Mikhaylov Subject: [PATCH 1/2] dt-bindings: adc: provide max34408/9 device tree binding document Date: Mon, 18 Sep 2023 00:11:42 +0300 Message-ID: <20230917211143.7094-2-fr0st61te@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230917211143.7094-1-fr0st61te@gmail.com> References: <20230917211143.7094-1-fr0st61te@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 17 Sep 2023 14:12:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777334497539744250 X-GMAIL-MSGID: 1777334497539744250 The i2c driver with Rsense option for current monitoring. Signed-off-by: Ivan Mikhaylov Reviewed-by: Rob Herring --- .../bindings/iio/adc/maxim,max34408.yaml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/maxim,max34408.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max34408.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max34408.yaml new file mode 100644 index 000000000000..ae7c6ddb13d8 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/maxim,max34408.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/maxim,max34408.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Two- and four-channel current monitors with overcurrent control. + +maintainers: + - Ivan Mikhaylov + +description: | + The MAX34408/MAX34409 are two- and four-channel current monitors that are + configured and monitored with a standard I2C/SMBus serial interface. Each + unidirectional current sensor offers precision high-side operation with a + low full-scale sense voltage. The devices automatically sequence through + two or four channels and collect the current-sense samples and average them + to reduce the effect of impulse noise. The raw ADC samples are compared to + user-programmable digital thresholds to indicate overcurrent conditions. + Overcurrent conditions trigger a hardware output to provide an immediate + indication to shut down any necessary external circuitry. + + Specifications about the devices can be found at: + https://www.analog.com/media/en/technical-documentation/data-sheets/MAX34408-MAX34409.pdf + +properties: + compatible: + enum: + - maxim,max34408 + - maxim,max34409 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + maxim,rsense-val-micro-ohms: + description: + Adjust the Rsense value to monitor higher or lower current levels. + enum: [250, 500, 1000, 5000, 10000, 50000, 100000, 200000, 500000] + default: 1000 + +required: + - compatible + - reg + - maxim,rsense-val-micro-ohms + +additionalProperties: false + +examples: + - | + i2c { + + #address-cells = <1>; + #size-cells = <0>; + + adc@1e { + compatible = "maxim,max34409"; + reg = <0x1e>; + maxim,rsense-val-micro-ohms = <1000>; + }; + };