Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2114652pxb; Thu, 11 Feb 2021 04:56:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrec1RLyVFcRlmjZB0P9jWQmpE9WOsGXp7FgYqkava3cjKVug3ChB+VGUKCTl0Hn0z+dhk X-Received: by 2002:a17:906:2a06:: with SMTP id j6mr8090978eje.164.1613048171026; Thu, 11 Feb 2021 04:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613048171; cv=none; d=google.com; s=arc-20160816; b=rZCfEvY18oF63ukMY30CIOZGYUP1BjUu+vMA+IGWorxuaIXsn3geE5qnqf57/xoMoi gXlqVgzkWYvO2UQgz/0D1N8pOP4TT04RtLZ847/rSaCOMStxiOoXw4aC0mrZo0GbezGj uyp+0IgnyV3KbcAmTId52SPN/N0VKySges03eK6eZx4OsdmALtI0Z8yYExtjrGsUmCMZ ZpoAniDS7cT/KHuJWJDVUB41z349tuSM1Skb9XjvK6YRuNf3QzQeU2p6Bvk01qThMAXw A/pSY+zlYara38QuT822A9ctdDW7V+O2jh4k0/bdRouHTH/7Ae0T0I+SQTPg/dq9F3We 7gFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=5v/cjtTmJg2RpKpRvNRPqO2XLjvgCacL1WtUm8zOfnA=; b=nYYEFIXbm7ZcBg3abr7t50qwOxXQi3qkhoQogJyYsTMVeFC7xN0pzeHg1pqeRPOWmS Ys54/O5FjfXqSQ91Kivu/PujNDktxOcIWfK3b27fL4HIs1Feoo8Up22jqwaAL17ihMpO GyFal5i+ZU6pfwruOn4hGK+2b7YgwenZsZ6M+SEOU/20miWBKkXvscw+KfQUgMf5Putb /6XoT2dX2d5t1LfmfjlH7Tkd9O/kK2P/9MDj03G3t7KQ7TumfU19aYiRgTrlPoABGKBC Q4Xtj0e5VgCl135YhB4GkZuvGddPlcXsmTeoLE2Tgv+xFjxv2H3pgisgNL75Vxh+3/3J wLEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si3443893ejd.104.2021.02.11.04.55.45; Thu, 11 Feb 2021 04:56:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231192AbhBKMzC (ORCPT + 99 others); Thu, 11 Feb 2021 07:55:02 -0500 Received: from mail-lj1-f172.google.com ([209.85.208.172]:44681 "EHLO mail-lj1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbhBKMfL (ORCPT ); Thu, 11 Feb 2021 07:35:11 -0500 Received: by mail-lj1-f172.google.com with SMTP id x1so501465ljj.11; Thu, 11 Feb 2021 04:34:53 -0800 (PST) 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=5v/cjtTmJg2RpKpRvNRPqO2XLjvgCacL1WtUm8zOfnA=; b=UszOAmYKZ5M+wc0ZH88yls+5ED/Lb7ECyP5yCpbtfzXq7hdNAC3VN7KEehd1Q5dBla Dp16yxUQ2TK63mrO0imH9kZpxfp95l/C5CmzY+3eIMQIzBlNs4su7uKrRYLcgjfU3kW3 tt1q/ZyhP1Y0mk73qSIWNIxkEtXl7jUpvEg6fshxOhZkhQI5iHCZ5KOCrQu2eSqtzW+4 +LOaAetLhMJyrGxOb9CWCtHYzX0pLKv6JkQ60ysSmTWIODUNYD24nv3mKyTN72gLOUJs Xlr9xqctpacDoBoSWerB5qvU4ixGJCSFr5Sg4/d2+po96crFLGToPMOF4KX/ixnSYcm5 p7GQ== X-Gm-Message-State: AOAM533zz2IVn5Mm+Pt6N/IdB/W+M0bCnj5lfLlDlVTzsXUrclpH9Fs4 I3powc/qQ7CODTwyaeEfiko= X-Received: by 2002:a2e:2c0d:: with SMTP id s13mr89345ljs.298.1613046868233; Thu, 11 Feb 2021 04:34:28 -0800 (PST) Received: from localhost.localdomain (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id j137sm636583lfj.55.2021.02.11.04.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 04:34:27 -0800 (PST) Date: Thu, 11 Feb 2021 14:34:17 +0200 From: Matti Vaittinen To: mazziesaccount@gmail.com, matti.vaittinen@fi.rohmeurope.com 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: [RFC PATCH 1/7] dt_bindings: Add protection limit properties Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- .../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..47fff75f0554 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-over-current-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-over-current-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-over-current-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-over-voltage-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-over-voltage-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-over-voltage-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-under-voltage-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-under-voltage-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-under-voltage-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-over-temperature-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-over-temperature-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-over-temperature-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: -- 2.25.4 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =]