Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp188248rdg; Tue, 10 Oct 2023 07:40:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFF1XfYIHixZ/gXY0icxsy7Z6OJTnsfa0hM9DvED2VS9ffL4DkNSafp/rHkOlb4IJzmDVu X-Received: by 2002:a05:6a00:1a92:b0:690:bdda:7c35 with SMTP id e18-20020a056a001a9200b00690bdda7c35mr18779297pfv.1.1696948850865; Tue, 10 Oct 2023 07:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696948850; cv=none; d=google.com; s=arc-20160816; b=kghHpiFxZ/5tt8sVE2lEEjjKYWnOLFAW7MYpsbzHZNTEeqnEgwtEFEAVbx6f3NDulv QOfzJbwjFACxng3QYW/GTJPFDJSS9xiVaugGYKUWYq2mU2eeq2tkwMS/WS27XZhaUY2a XtPvmZi2O06kBRAvfBvTIdNHPKWO9MbUXYbhvGVu4jrDZPnApaVLps1tcT9xtAB114M/ pV7VhALQ7HGrlGTYwgVRwfyQ1vrKcnNbSSeRZZFNStfPyvA/3tyDTamKkr4GXh0AFLk6 Q4J2GsJsf1y3SOuWjGwD4NYdKsYcZyDrN81DtwrZr9VHN56zjRSp8Oqyhvi/LZ1ZmV9S wSOA== 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:subject:cc:to:from:date :dkim-signature; bh=09J4mlFeuDVT4SgiHHwqF234k0jvUQqhc1li0EGOQ0E=; fh=NWaaAAM/CwI4dd5Ijg1P4dpcr7h2ioTc7VpbPCmU7IY=; b=AtY0Q8DyRU1n4uSfZa6fei575rcjwh+j4UluDMtQaqCjiQ544/7yMrtD5sfzsi0r41 uLg0Ttilrge3ZnMEBmYzIVEBUFGXpGErr2alqZy7ki/dVLYL9mGiLbr4kSBJChxNit1w afq7vJhldphI/9BJN2Fexg5+xvzSMOhqaanAzznGp4J5UyCSdL+U/+Zuz3xD2bCATRQn oO7cToMflrgb80ALWNjB39ekdxh6SeKyY+QUcJmHBy+9hRvSVZpZj+JWwYwTbw5g7kBm DwwXr0iA8Oh5HTBlNyzRq2AqQb87WK/qRgq8px/3DExnGwHREN48bIuzrbT3V5RegRGl /+EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qvb72v1K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id i191-20020a6387c8000000b00578a98c0687si12220864pge.99.2023.10.10.07.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 07:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qvb72v1K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E3D7981D4DF9; Tue, 10 Oct 2023 07:40:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232221AbjJJOke (ORCPT + 99 others); Tue, 10 Oct 2023 10:40:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232197AbjJJOkc (ORCPT ); Tue, 10 Oct 2023 10:40:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7099AF; Tue, 10 Oct 2023 07:40:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AA72C433C8; Tue, 10 Oct 2023 14:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696948830; bh=SZNL5ipjz03UC6M5xobnjz++6ytKfOWeF3h0jnFiasw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qvb72v1KwaPV6lhUBCnWjTPdWQFWjMAsrdcuCea7BPaHEvp98IoGTwS998Gfv7bwm cXy+pHMz398PjWmFf9UxdQ7rqGsjrPy3pl2MnG3X/X4Nn1EZQcv/iaUd91UZpm8DJ5 1H89dsnas4BAxGXPYynhCP5e6npn6U2YVt/+o0QAcmv4kPbESX/AwmNJTlT3wJb5nF WvNAPOE5UyVY9SG9Q5g6VS4z0tOAWmRlBY4wQTdqMOOiyPvJrrjDKb807iBJWsRlvl p+7uqVs/BG6vQUnLxF23bSga6KgoRMYA2vY+oIowLwkiSMyFGBLmJsDmdOEtRRWRJD seMWou74vPx1w== Date: Tue, 10 Oct 2023 15:40:42 +0100 From: Jonathan Cameron To: Ivan Mikhaylov Cc: Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v5 1/2] dt-bindings: adc: provide max34408/9 device tree binding document Message-ID: <20231010154042.2ef667b2@jic23-huawei> In-Reply-To: <20231007234838.8748-2-fr0st61te@gmail.com> References: <20231007234838.8748-1-fr0st61te@gmail.com> <20231007234838.8748-2-fr0st61te@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 07:40:44 -0700 (PDT) X-Spam-Level: ** On Sun, 8 Oct 2023 02:48:37 +0300 Ivan Mikhaylov wrote: > The hardware binding for i2c current monitoring device with overcurrent > control. > > Signed-off-by: Ivan Mikhaylov > --- > .../bindings/iio/adc/maxim,max34408.yaml | 141 ++++++++++++++++++ > 1 file changed, 141 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..9749f1fd1802 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/maxim,max34408.yaml > @@ -0,0 +1,141 @@ > +# 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 > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + powerdown-gpios: > + description: > + Shutdown Output. Open-drain output. This output transitions to high impedance > + when any of the digital comparator thresholds are exceeded as long as the ENA > + pin is high. > + maxItems: 1 > + > + shtdn-enable-gpios: I guess the review crossed with you sending v5. There is some feedback on v4 you need to address here. > + description: > + SHTDN Enable Input. CMOS digital input. Connect to GND to clear the latch and > + unconditionally deassert (force low) the SHTDN output and reset the shutdown > + delay. Connect to VDD to enable normal latch operation of the SHTDN output. > + maxItems: 1 > + > + vdd-supply: true > + > +patternProperties: > + "^channel@[0-3]$": > + $ref: adc.yaml > + type: object > + description: > + Represents the internal channels of the ADC. > + > + properties: > + reg: > + items: > + minimum: 0 > + maximum: 3 > + > + maxim,rsense-val-micro-ohms: > + description: > + Adjust the Rsense value to monitor higher or lower current levels for > + input. > + enum: [250, 500, 1000, 5000, 10000, 50000, 100000, 200000, 500000] > + default: 1000 > + > + required: > + - reg > + - maxim,rsense-val-micro-ohms > + > + unevaluatedProperties: false > + > +required: > + - compatible > + - reg > + > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: maxim,max34408 > + then: > + patternProperties: > + "^channel@[2-3]$": false > + "^channel@[0-1]$": > + properties: > + reg: > + minimum: 0 > + maximum: 1 > + else: > + patternProperties: > + "^channel@[0-3]$": > + properties: > + reg: > + minimum: 0 > + maximum: 3 > + > +additionalProperties: false > + > +examples: > + - | > + #include > + > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + adc@1e { > + compatible = "maxim,max34409"; > + reg = <0x1e>; > + powerdown-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; > + shtdn-enable-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; > + > + #address-cells = <1>; > + #size-cells = <0>; > + > + channel@0 { > + reg = <0x0>; > + maxim,rsense-val-micro-ohms = <5000>; > + }; > + > + channel@1 { > + reg = <0x1>; > + maxim,rsense-val-micro-ohms = <10000>; > + }; > + }; > + };