From patchwork Wed Nov 2 08:57:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Solanki X-Patchwork-Id: 14101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3496506wru; Wed, 2 Nov 2022 01:58:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70u6AE/21cW9z6l4gXgijNr5cTdKX0nRplUxagIo1Jcz1oBka4d11jKoSRHn3UkM6IGi/l X-Received: by 2002:a17:906:f149:b0:7ad:e210:690e with SMTP id gw9-20020a170906f14900b007ade210690emr11484223ejb.427.1667379537566; Wed, 02 Nov 2022 01:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667379537; cv=none; d=google.com; s=arc-20160816; b=i+djSPIyDv1iSWpKWJ+vL8Jjz01US3UyCu1FIR4sbkZDHp8i09FjoZEmHIDV/mEpk6 u0RwoGdINoN7inNp+NdwMblKZmA3958FqK5v8lhTBotkALUVerj0OE3DYQSj+FJj85+E Kc44jde/kmaonjGEeRq0Cuqs0iq5DlAWkprsWKd2avSQjipLBZFjePZYbOXtGmj9gXpP MaGSMaWr3EC/c4Hn0e1o+Gy2+0gw1IGX16PQYq1nXThsp8AyjHLP+86qyJU9r/56b1py S0SyOqwHOKvQR2kiL8c/SA4VlXJ3oxDx2v3gYNrqMSTMP28SA+gIGikHWxxrUT5xGCyw ZVzw== 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=nPHDXBenpQy2nAswrRWBg2PHq6YhV0vGg41gmHXpPC8=; b=VhiPhb/1sMsyNwjKyEz8wg0eseXwM9UGQz0oK0bPlJBJQCLQ+cAaz79k3TxC25Cgfa D8VstCS1ZpKFFOfrLsDVcvr9udXqSZGL7gU68ZGpZXHlbqCO6d7hQOZVDInp6a3Od6UV 5sQ5pqGPvQFiKl+31C5P370S8I6+6zpAT9Sz3ucLwkHZeyW/wUZtcbZpE4uyA0vju1Bx kRgZsSk0jZ/uqEfhUMm56R5qjKSt4SxtaByFddyIE/05YY0zBgkeNGm2wD5YAYfesBgc 216ib5iaJh0EbeDRbbZIEfMpQG5id7MDJTeK4AeMQoNK5T1k001Cz4ZwdEvdQ4QsU32K 5YOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=VW+EmARq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di14-20020a170906730e00b0073d9c29892csi17565901ejc.939.2022.11.02.01.58.33; Wed, 02 Nov 2022 01:58:57 -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; dkim=pass header.i=@9elements.com header.s=google header.b=VW+EmARq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbiKBI5w (ORCPT + 99 others); Wed, 2 Nov 2022 04:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231182AbiKBI5q (ORCPT ); Wed, 2 Nov 2022 04:57:46 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 857581D66F for ; Wed, 2 Nov 2022 01:57:43 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id bk15so23437422wrb.13 for ; Wed, 02 Nov 2022 01:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; 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=nPHDXBenpQy2nAswrRWBg2PHq6YhV0vGg41gmHXpPC8=; b=VW+EmARquWRj5bHCWN8loD6Bdyi+uhqfvSYeZBLQ1wjbiT3BydjhjxewKIkMJDWXOU wm0LVvILwahrJclM2AWhkeGZxF6V1qXA97M/z7cGq0VdfiwCuAq8wAA4DdSrwxN9PNzu h+ECqWJpM52nxcXpi8xQeM7gruxjIS0Zc0jhCW47PA9m5DJMtMUZF0gUx6LcwP0EerGA +qK3WSDOvG5LW/wWTHjQCXipcZgcEYYn1P1Jl9JrMTOr97ubzQ1y7FMTv8BZp6Jig8BY tXNW2BWZGBw1TXZaC/QVfUfIw80x4dczvR0+yPLEzJW+wlh6d8h1BqhRZvsZyIjiEzw8 Sx0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=nPHDXBenpQy2nAswrRWBg2PHq6YhV0vGg41gmHXpPC8=; b=RXUxoZrSot8OUeBJCQG4ZR5x8IF9TdMtK/hVp7wQmqTCzcxLCV9YKDwb8HMImYZDkk IWCptxisx629NsK5BSGvYojK5pRaZ2vt97mwRNNzF07T9qjwEifXDs51ncPJBJTmOgH0 /7WnJmOS5oxqDd7dPNQV3hJQkDPkyYVHkr7R31Fd+Do/JxhePNhtTgLedR97ZukDoEyo vzGWNuzCV4aNE8fSYQr2Xv2HXvs8/X/KH00uTPmjZCe4xaq30sh38IdSC6UAQlBy9Vms Id9u/tIWUUAXbVicoxKLVoixRXFCGl6XTJGuL64oRtOtI7tCZiVpUkf92W7jTDUAyAfn nvqA== X-Gm-Message-State: ACrzQf29ObtL9gEmIs3uAmK+09qemOqwAIbUpErSVyOlvdAz0DUKGBTC w+nUHeGY/mpAn8AssY1mRLAXfY36clW/a9nr X-Received: by 2002:adf:dd12:0:b0:236:6ef7:dacf with SMTP id a18-20020adfdd12000000b002366ef7dacfmr14117030wrm.204.1667379461881; Wed, 02 Nov 2022 01:57:41 -0700 (PDT) Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id j39-20020a05600c48a700b003b95ed78275sm1290176wmp.20.2022.11.02.01.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 01:57:41 -0700 (PDT) From: Naresh Solanki X-Google-Original-From: Naresh Solanki To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Lee Jones , Rob Herring , Krzysztof Kozlowski , Patrick Rudolph Cc: Marcello Sylvester Bauer , Naresh Solanki Subject: [PATCH v5 1/2] dt-bindings: mfd: Add bindings for MAX5970 and MAX5978 Date: Wed, 2 Nov 2022 09:57:36 +0100 Message-Id: <20221102085737.599100-2-Naresh.Solanki@9elements.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221102085737.599100-1-Naresh.Solanki@9elements.com> References: <20221102085737.599100-1-Naresh.Solanki@9elements.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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748374165967532327?= X-GMAIL-MSGID: =?utf-8?q?1748374165967532327?= From: Marcello Sylvester Bauer The MAX597x is a hot swap controller with configurable fault protection. It also has 10bit ADC for current & voltage measurements. Signed-off-by: Patrick Rudolph Signed-off-by: Marcello Sylvester Bauer Signed-off-by: Naresh Solanki --- .../devicetree/bindings/mfd/max5970.yaml | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/max5970.yaml diff --git a/Documentation/devicetree/bindings/mfd/max5970.yaml b/Documentation/devicetree/bindings/mfd/max5970.yaml new file mode 100644 index 000000000000..f5cd80c1a24a --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/max5970.yaml @@ -0,0 +1,164 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/max5970.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Regulator driver for MAX5970 smart switch from Maxim Integrated. + +maintainers: + - Patrick Rudolph + +description: | + The smart switch provides no output regulation, but independent fault protection + and voltage and current sensing. + Programming is done through I2C bus. + + Datasheets: + https://datasheets.maximintegrated.com/en/ds/MAX5970.pdf + https://datasheets.maximintegrated.com/en/ds/MAX5978.pdf + +properties: + compatible: + enum: + - maxim,max5970 + - maxim,max5978 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + leds: + type: object + description: + Properties for single channel. + + patternProperties: + "^led@[0-3]$": + $ref: /schemas/leds/common.yaml# + type: object + + additionalProperties: true + + vss1-supply: + description: Supply of the first channel. + + vss2-supply: + description: Supply of the first channel. + + "#io-channel-cells": + const: 1 + + regulators: + type: object + description: + Properties for single channel. + + patternProperties: + "^(sw[0-1])$": + $ref: /schemas/regulator/regulator.yaml# + type: object + + shunt-resistor-micro-ohms: + description: | + The value of curent sense resistor in microohms. + Must be specified for each channel. + + additionalProperties: true + +required: + - compatible + - reg + - regulators + - vss1-supply + + +allOf: + - if: + properties: + compatible: + enum: + - maxim,max5970 + then: + properties: + io-channels: + items: + - description: voltage first channel + - description: current first channel + - description: voltage second channel + - description: current second channel + description: | + Voltage and current for first and second channel. + required: + - vss2-supply + else: + properties: + io-channels: + items: + - description: voltage first channel + - description: current first channel + description: | + Voltage and current for first channel. + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + regulator@3a { + reg = <0x3a>; + vss1-supply = <&p3v3>; + compatible = "maxim,max5978"; + + regulators { + sw0_ref_0: SW0 { + regulator-compatible = "SW0"; + shunt-resistor-micro-ohms = <12000>; + }; + }; + + leds { + #address-cells = <1>; + #size-cells = <0>; + led@0 { + reg = <0>; + label = "led0"; + default-state = "on"; + }; + led@1 { + reg = <1>; + label = "led1"; + default-state = "on"; + }; + }; + }; + }; + + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + regulator@3a { + reg = <0x3a>; + vss1-supply = <&p3v3>; + vss2-supply = <&p5v>; + compatible = "maxim,max5970"; + + regulators { + sw0_ref_1: SW0 { + regulator-compatible = "SW0"; + shunt-resistor-micro-ohms = <12000>; + }; + sw1_ref_1: SW1 { + regulator-compatible = "SW1"; + shunt-resistor-micro-ohms = <10000>; + }; + }; + }; + }; +...