From patchwork Wed Apr 7 10:02:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 1463277 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 4FFg2v56d8z9sWK for ; Wed, 7 Apr 2021 20:03:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350557AbhDGKD6 (ORCPT ); Wed, 7 Apr 2021 06:03:58 -0400 Received: from mail-lf1-f43.google.com ([209.85.167.43]:40749 "EHLO mail-lf1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350498AbhDGKDN (ORCPT ); Wed, 7 Apr 2021 06:03:13 -0400 Received: by mail-lf1-f43.google.com with SMTP id d13so27547512lfg.7; Wed, 07 Apr 2021 03:03:03 -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=J7crRi/h8pPP48l770iPX9pdtxPTTqKfvzb9h8aF7ts=; b=dVGzC9Xpf/m3GZUHC0yRs8PPatGsjbRZKY3MQNpIx8ocA71F/z6eMJK2gmeXmhgfRV LM4W1rkiOa2lGS4Pkgnu8/9ykXObXmgb312uR0o/BJW/WMRcOAciSZX2Ya3MEZZiVXCh DndXuh8d0qV0N4HBhxFivu6ji8QHY7ndc+7xeeIJbhyZnn5FX9m6fyodO+16Ssbvx5ot LxvYcLc/seMTUlRN94+652+9B/iEjU/eWEQlEe2x6zSTJYCtmjTiwKAKBUSN/z2AEdlW ymOAWs9EocjQWUyywFokrMjzrpyynYx0MNOupxQdCmceaqMrkVK+IS2cAZI+gLjDUwvB SQmw== X-Gm-Message-State: AOAM5307/e+AWR0Vjt8Ha3bUwRSKhbtFjDbu2f7ihgAMF4z3glFcWQzF DA4IO7HdQ7UFhhnqRbTU9HE= X-Google-Smtp-Source: ABdhPJyz7tli+BgpJYJ9qc2d/lrktgriM8U7JfCMgebbBmoH0+BJTx+Je/GQNVIXgc+eEJdX/052Rw== X-Received: by 2002:a05:6512:3a81:: with SMTP id q1mr1963235lfu.388.1617789782576; Wed, 07 Apr 2021 03:03:02 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyydy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::6]) by smtp.gmail.com with ESMTPSA id v20sm2412813ljh.105.2021.04.07.03.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 03:03:02 -0700 (PDT) Date: Wed, 7 Apr 2021 13:02:56 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Liam Girdwood , Mark Brown , Rob Herring , Matti Vaittinen , Andy Gross , Bjorn Andersson , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-power@fi.rohmeurope.com, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v6 1/8] dt_bindings: Add protection limit properties Message-ID: <6c60d828446bf0568649244399f4c37db611d9a1.1617789229.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 Wed Apr 7 10:04:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 1463278 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 4FFg5K1XzCz9sWK for ; Wed, 7 Apr 2021 20:05:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346611AbhDGKGF (ORCPT ); Wed, 7 Apr 2021 06:06:05 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:33649 "EHLO mail-lf1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350691AbhDGKFI (ORCPT ); Wed, 7 Apr 2021 06:05:08 -0400 Received: by mail-lf1-f51.google.com with SMTP id o126so27640800lfa.0; Wed, 07 Apr 2021 03:04:58 -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=HPh1xRZoaKj1dkeLrpwAw4cXFw4YaUG5EWKUdl3Qzcg=; b=Odur6lHonzkyNZC9iLNm5cnLqzskyf/nF8sfWS8PCg7MzkLopl7oeDYwWevwnrweEN tcNaqbHI3/oU8mrK2QzfmC9MkG2IgYsyWps8YgbTr5dkSbMxPNrrmC2Rs5hi8vpivxSG wMHOqZtBft9zZd9A9+mqOixsrYNKWKFsbq863/cDZZpEyrw+n+MmZ4uKW634BuM92wpJ PsHqFl+gXlNuTwsI8aEKuz+8OobWHD/JhoKC2blrjvcgnUL7ALK1TvVGm4lystepk4im usiaDKo4cdXe1TGib8KVPyZIHkcB5N8eQTCIEpWm+AoLzqoUZCOoRBpLGM831y+f47y+ VXRA== X-Gm-Message-State: AOAM533Gi7PARg+DSqPt+PbxVUK8yPV0p0C5i5xuNwXO/1/6W8K53PlR jIJJwJfc73+WIYcCB8RHQH0= X-Google-Smtp-Source: ABdhPJzAnruS0/Cz10VTP6+WZplQ3ndYp1Y0Uy7stfEvPbTkmzWHxVeNJtXX7UyvBsVUu4OCBSw6ww== X-Received: by 2002:a19:c309:: with SMTP id t9mr1920039lff.348.1617789897908; Wed, 07 Apr 2021 03:04:57 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyydy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::6]) by smtp.gmail.com with ESMTPSA id x4sm2477141ljj.91.2021.04.07.03.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 03:04:57 -0700 (PDT) Date: Wed, 7 Apr 2021 13:04:51 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Liam Girdwood , Mark Brown , Rob Herring , Matti Vaittinen , Andy Gross , Bjorn Andersson , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-power@fi.rohmeurope.com, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v6 5/8] dt-bindings: regulator: bd9576 add FET ON-resistance for OCW Message-ID: <78743b448814a85280c484c0b2d4f4207008fd6e.1617789229.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 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