From patchwork Mon May 10 11:27:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 1476326 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FdzRY0fcZz9sW8 for ; Mon, 10 May 2021 21:32:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234501AbhEJLdK (ORCPT ); Mon, 10 May 2021 07:33:10 -0400 Received: from mail-lj1-f178.google.com ([209.85.208.178]:36603 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240022AbhEJL2S (ORCPT ); Mon, 10 May 2021 07:28:18 -0400 Received: by mail-lj1-f178.google.com with SMTP id o16so20372392ljp.3; Mon, 10 May 2021 04:27:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=M7MniA25rAvwMIIfCZ0fM0nnb6dmzOJNmUcGZG0zqr4=; b=WaiVwwErZ0Zc0K0LQaCKFA4EY2lGUG3GKEzvnW6aR4gAXEMOQVhDJZw8+NVb2XD5QA ASurS1/FAXvKi195S6X3CRjo8Yl4oVXjYCAL90C7OwSfypNtIh+44ZR116w7XHiEsi6T DIqBxWIpnSfCCVs7ae/RiDlGJefSkHz5zg9KDW4s6/Acay0Laca3p1A4Wq2G26DgW7fk yEBK7S/K4eqUxzruCEYhUZsX/686eYyAyUe7uB1/DHRBomRdkrfs6j3+MIdqqdhEGUZF bohmXJOGu9krpQmvEQ+FrbVfA/xBzpTNj0ad+xAXYqvjgMzCnIwp43iezF42cdlWkSH7 +wtw== X-Gm-Message-State: AOAM5306+nYplGfF3i/ONwR1alnuhdO/nK9fHnvbEH1HDCAlaH+T3CdM NBkX+2+JUct5orqNRXBeTGM= X-Google-Smtp-Source: ABdhPJwQLh48cxOXN5YPF45bWD+tDMmrfyi/BLOkJtgqB1MiVxdXg+JnDZTbxO+PTiIyZz2fWcnQ/w== X-Received: by 2002:a2e:9f14:: with SMTP id u20mr19560986ljk.53.1620646031447; Mon, 10 May 2021 04:27:11 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyyby-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::2]) by smtp.gmail.com with ESMTPSA id y7sm2218254lfb.62.2021.05.10.04.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 04:27:10 -0700 (PDT) Date: Mon, 10 May 2021 14:27:04 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Mark Brown , Kees Cook , Andy Shevchenko , Zhang Rui , Guenter Roeck , "agross@kernel.org" , "devicetree@vger.kernel.org" , linux-power , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , "bjorn.andersson@linaro.org" , "lgirdwood@gmail.com" , "robh+dt@kernel.org" Subject: [PATCH v9 01/10] dt_bindings: Add protection limit properties Message-ID: <05fe8d0089f1378f984cf86cb25caa5eb630e87c.1620645507.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Support specifying protection/error/warning limits for regulator over current, over temperature and over/under voltage. Most of the PMICs support only "protection" feature but few setups do also support error/warning level indications. On many ICs most of the protection limits can't actually be set. But for example the ampere limit for over-current protection on ROHM BD9576 can be configured - or feature can be completely disabled. Provide limit setting for all protections/errors for the sake of the completeness and do that using own properties for all so that not all users would need to set all levels when only one or few are supported. Signed-off-by: Matti Vaittinen Reviewed-by: Rob Herring --- No changes since RFC-v2 --- .../bindings/regulator/regulator.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/regulator.yaml b/Documentation/devicetree/bindings/regulator/regulator.yaml index 6d0bc9cd4040..a6ae9ecae5cc 100644 --- a/Documentation/devicetree/bindings/regulator/regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/regulator.yaml @@ -117,6 +117,88 @@ properties: description: Enable over current protection. type: boolean + regulator-oc-protection-microamp: + description: Set over current protection limit. This is a limit where + hardware performs emergency shutdown. Zero can be passed to disable + protection and value '1' indicates that protection should be enabled but + limit setting can be omitted. + + regulator-oc-error-microamp: + description: Set over current error limit. This is a limit where part of + the hardware propably is malfunctional and damage prevention is requested. + Zero can be passed to disable error detection and value '1' indicates + that detection should be enabled but limit setting can be omitted. + + regulator-oc-warn-microamp: + description: Set over current warning limit. This is a limit where hardware + is assumed still to be functional but approaching limit where it gets + damaged. Recovery actions should be initiated. Zero can be passed to + disable detection and value '1' indicates that detection should + be enabled but limit setting can be omitted. + + regulator-ov-protection-microvolt: + description: Set over voltage protection limit. This is a limit where + hardware performs emergency shutdown. Zero can be passed to disable + protection and value '1' indicates that protection should be enabled but + limit setting can be omitted. Limit is given as microvolt offset from + voltage set to regulator. + + regulator-ov-error-microvolt: + description: Set over voltage error limit. This is a limit where part of + the hardware propably is malfunctional and damage prevention is requested + Zero can be passed to disable error detection and value '1' indicates + that detection should be enabled but limit setting can be omitted. Limit + is given as microvolt offset from voltage set to regulator. + + regulator-ov-warn-microvolt: + description: Set over voltage warning limit. This is a limit where hardware + is assumed still to be functional but approaching limit where it gets + damaged. Recovery actions should be initiated. Zero can be passed to + disable detection and value '1' indicates that detection should + be enabled but limit setting can be omitted. Limit is given as microvolt + offset from voltage set to regulator. + + regulator-uv-protection-microvolt: + description: Set over under voltage protection limit. This is a limit where + hardware performs emergency shutdown. Zero can be passed to disable + protection and value '1' indicates that protection should be enabled but + limit setting can be omitted. Limit is given as microvolt offset from + voltage set to regulator. + + regulator-uv-error-microvolt: + description: Set under voltage error limit. This is a limit where part of + the hardware propably is malfunctional and damage prevention is requested + Zero can be passed to disable error detection and value '1' indicates + that detection should be enabled but limit setting can be omitted. Limit + is given as microvolt offset from voltage set to regulator. + + regulator-uv-warn-microvolt: + description: Set over under voltage warning limit. This is a limit where + hardware is assumed still to be functional but approaching limit where + it gets damaged. Recovery actions should be initiated. Zero can be passed + to disable detection and value '1' indicates that detection should + be enabled but limit setting can be omitted. Limit is given as microvolt + offset from voltage set to regulator. + + regulator-temp-protection-kelvin: + description: Set over temperature protection limit. This is a limit where + hardware performs emergency shutdown. Zero can be passed to disable + protection and value '1' indicates that protection should be enabled but + limit setting can be omitted. + + regulator-temp-error-kelvin: + description: Set over temperature error limit. This is a limit where part of + the hardware propably is malfunctional and damage prevention is requested + Zero can be passed to disable error detection and value '1' indicates + that detection should be enabled but limit setting can be omitted. + + regulator-temp-warn-kelvin: + description: Set over temperature warning limit. This is a limit where + hardware is assumed still to be functional but approaching limit where it + gets damaged. Recovery actions should be initiated. Zero can be passed to + disable detection and value '1' indicates that detection should + be enabled but limit setting can be omitted. + regulator-active-discharge: description: | tristate, enable/disable active discharge of regulators. The values are: From patchwork Mon May 10 11:30:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 1476327 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FdzRn5WhRz9sW8 for ; Mon, 10 May 2021 21:32:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236634AbhEJLdY (ORCPT ); Mon, 10 May 2021 07:33:24 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:34538 "EHLO mail-lf1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236251AbhEJLbf (ORCPT ); Mon, 10 May 2021 07:31:35 -0400 Received: by mail-lf1-f51.google.com with SMTP id z13so22854087lft.1; Mon, 10 May 2021 04:30:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rPqAfqjhbovDywyUEoxgVrHpNkqVf0/mG9wUC0T9QPI=; b=gd0bFIDGaJe7Dwtou/Hk8Q94469+n3WGZsmyNIWjkEDVoror0PTxpB9ekwZE426NRr fIjZxMfjTo3UkNoKqgrgljoSym32mC0+0lU16p/KqjMTwNdo6ShNJiEfGR6DkMq/89IN ozOH6mjvHmOJD0e5Pel+DpEPOyfYKo8E5V3qi1EMivzIErDfDsCLvLP6J+LGZ8dVt4fV S77UMEJr+9SbinDbre0CsxA+eJ/jWn38SZNNLaqctLg/d79nYbKXcyN+E1ickNMXisIZ oF0cPjUeVNKZIam4Pr+tVaEKApQGrzQEFA3TxkJZW4FIzYtqCuxivfMiLj0VNiSNuOfp 9Cfw== X-Gm-Message-State: AOAM533/WCTlilN59q9fAiItUhZ4hw4s/jNRO/D0X0iuHlk1xFonVWmM Esh2NyjzCafh4nzcfktAUT7WYKGCnd9wNA== X-Google-Smtp-Source: ABdhPJxUMvqcJGutORFQCWC7QignwID20u6MYAfU9ak77iX67hNQsAfEcSEygY1wcXPYoykVCIRyDg== X-Received: by 2002:a19:ac0d:: with SMTP id g13mr16813491lfc.1.1620646228709; Mon, 10 May 2021 04:30:28 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyyby-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::2]) by smtp.gmail.com with ESMTPSA id t10sm946619ljj.44.2021.05.10.04.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 04:30:28 -0700 (PDT) Date: Mon, 10 May 2021 14:30:22 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Mark Brown , Kees Cook , Andy Shevchenko , Zhang Rui , Guenter Roeck , "agross@kernel.org" , "devicetree@vger.kernel.org" , linux-power , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , "bjorn.andersson@linaro.org" , "lgirdwood@gmail.com" , "robh+dt@kernel.org" Subject: [PATCH v9 07/10] dt-bindings: regulator: bd9576 add FET ON-resistance for OCW Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org BD9576MUF provides over-current protection and detection. Current is measured as voltage loss over external FET. Allow specifying FET's on resistance so current monitoring limits can be converted to voltages. Signed-off-by: Matti Vaittinen Reviewed-by: Rob Herring --- v5 onwards: - No changes v4: - Fixed the description indentiation --- .../bindings/regulator/rohm,bd9576-regulator.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml b/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml index b6515a0cee62..7cb74cc8c5d9 100644 --- a/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml @@ -27,6 +27,12 @@ patternProperties: Properties for single regulator. $ref: "regulator.yaml#" + properties: + rohm,ocw-fet-ron-micro-ohms: + description: | + External FET's ON-resistance. Required if VoutS1 OCP/OCW is + to be set. + required: - regulator-name