From patchwork Thu Mar 11 10:21:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 1451050 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 4Dx4kl5SZnz9sWY for ; Thu, 11 Mar 2021 21:22:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232204AbhCKKVv (ORCPT ); Thu, 11 Mar 2021 05:21:51 -0500 Received: from mail-lf1-f50.google.com ([209.85.167.50]:35749 "EHLO mail-lf1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232237AbhCKKVu (ORCPT ); Thu, 11 Mar 2021 05:21:50 -0500 Received: by mail-lf1-f50.google.com with SMTP id e7so38911884lft.2; Thu, 11 Mar 2021 02:21:48 -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=xDwLcoi1ZW1290iFrKYagYAph1kMtF0n65mh6ULNQJg=; b=tG7Ns8xB9JOgOxdQFu6FjzAuVO9FM/XRlO1m7owj8C8I0EWMyfvZcte/WU7SZ5cMGI sbjBJkePKdwMQMMoURKEHuK8eEY8Iua+EgqO/9W8A4ZPivkm0gu2XLK8hE30Daqvcq4n XzVUZ/cG8l4sPZl5DpFQMkvCVfMObNK7eEYg7elQ5nfgCkvvUV8SGrVPsloEHO8OFBkF UwlmJZHKXbwVMPMoay2bhT/lomwvxCv89chu8YTj7tyPsG/xIOkqbdqeTkbzQofuh9Az 2IDB0v+nQzWNe5oJ2+CV5b/yHSzcELmsexnlkuaOGej5EwX2SE4cA1x0+6QSMpH3fs+v a9bw== X-Gm-Message-State: AOAM5324z7fEWlUY6xBhtnzrAy5VoGSTOns+HcpiF1PISPGCLeHulVgX FKJnDNzOFNc2LXyho+H9c/A= X-Google-Smtp-Source: ABdhPJxCe512DOJLgcdIIw5w8jnRrVwGOzebS0twUvg8SemcxYlqDWTkI0MH5NLQ449S6Iv+HNz6oQ== X-Received: by 2002:a19:d61a:: with SMTP id n26mr1827321lfg.383.1615458108160; Thu, 11 Mar 2021 02:21:48 -0800 (PST) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyycy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::4]) by smtp.gmail.com with ESMTPSA id a1sm838602ljb.76.2021.03.11.02.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 02:21:47 -0800 (PST) Date: Thu, 11 Mar 2021 12:21:41 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.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 v3 1/7] dt_bindings: Add protection limit properties Message-ID: <4a12be22a3ea1cf9114dd67f017f3adea431c5c4.1615454845.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 --- v3: No changes. v2: Shortended property names as suggested by Rob. .../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 Thu Mar 11 10:23:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 1451051 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 4Dx4nD0Kd4z9sWb for ; Thu, 11 Mar 2021 21:24:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232283AbhCKKX7 (ORCPT ); Thu, 11 Mar 2021 05:23:59 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:34316 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232344AbhCKKXl (ORCPT ); Thu, 11 Mar 2021 05:23:41 -0500 Received: by mail-lj1-f180.google.com with SMTP id f16so1442771ljm.1; Thu, 11 Mar 2021 02:23:40 -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=3Dm5yOtVQTwxG6HM9ZGBXFFw4LTttf3R02OO0T8urqg=; b=kEPjv6nPfe39lUcgvK7eDka260sTihhHTxdwH+ta+B+VOVTam5/YCZ1QRTI+tIlyba NhTOWvL+Zi5FU1+1/VujQHScRccOcBApF/IIJKjil0cZ8hEdrLPOSxlwA2P0I6expEoy /HYRKZr5c6Wm8wTZImY/eNMKRDeKGPx5HFQlQHRbLXxIvwwG4eAXhpWL96fbPvJVyj5i E4CGybQoNEmZV/XBkL2Df/KMCR7O8vkV3VBNTp96zt2VjET4RqH9BzvxaxBrEsG+VDgx 1wxLKDHJ0Tk37/WVPaUO0FAowVrZzqXwZ8IUbOCYQJYo+WgZHKr6gILd9jbXUfGsbB6M OKTQ== X-Gm-Message-State: AOAM532QUMGShCkRN3w7h7cQ07v/gzOpYwc9k7Me4V6qnp7OrSfW8eYH R5yOSJ0wKW8cOO41w8Kb66Y= X-Google-Smtp-Source: ABdhPJyMJ9N/J0lvp9CUuLdRI/gubn7qmao5bLoBReXHaKvWhd2uChvKHYgH4IxrzBnUmKlC9d2K0A== X-Received: by 2002:a2e:161e:: with SMTP id w30mr4286671ljd.182.1615458220040; Thu, 11 Mar 2021 02:23:40 -0800 (PST) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyycy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::4]) by smtp.gmail.com with ESMTPSA id x1sm700121lff.97.2021.03.11.02.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 02:23:39 -0800 (PST) Date: Thu, 11 Mar 2021 12:23:33 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.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 v3 5/7] dt-bindings: regulator: bd9576 add FET ON-resistance for OCW Message-ID: <6793280eb1a3376a1aa4d408a8931202050c828d.1615454845.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 --- v3: - no changes v2: - use standard micro-ohms suffix .../devicetree/bindings/regulator/rohm,bd9576-regulator.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml b/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml index b6515a0cee62..9c119c1b1904 100644 --- a/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml @@ -27,6 +27,11 @@ 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