From patchwork Wed Apr 7 10:03:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 416880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A313C43461 for ; Wed, 7 Apr 2021 10:03:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C1F8613C0 for ; Wed, 7 Apr 2021 10:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350562AbhDGKD6 (ORCPT ); Wed, 7 Apr 2021 06:03:58 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:45848 "EHLO mail-lf1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350501AbhDGKDc (ORCPT ); Wed, 7 Apr 2021 06:03:32 -0400 Received: by mail-lf1-f41.google.com with SMTP id g8so27509906lfv.12; Wed, 07 Apr 2021 03:03:21 -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=PF17I0NH3tYVAA1Iv/q8DPWO007JsrI/3wrjpR3VDTQ=; b=ErQapZvxie9sdOspRJqNnfrDw/L873wXRbh6iSWo1q+FQdnLxTP3nitFI8nvFE1NwE H+U/uw+iFK2bpF4+Ci+qW93B3zJgcNXyQUD4yCZEhYZ/fEx9AmkphtQNInAuWTuhsFvd EHEKatlDr8voP9JzqtDaxiA1liBBSRXxvaHFxuRsY+ZclM3h0bmNLKO5CF/jjbJ/yrJ1 UxcauNDVyMR0C3kuwjts+os+FVvjkpTJDZvARuZxBCvRZNU2rJPC+h3B7q7W5HtyEDVX sRa6t8PJ3EpdeB3q6/cRPm1x6UoKuPLg+chZSIjIBZBKfwpWaJKvn68f+JoHEEJyTYBU 8E5g== X-Gm-Message-State: AOAM532J9Fc2O03CBY4vgxn5nPOEVZQNkNIEKrvIFZafCNuBTjHxVokI Gwve5nxfK8fbTOJ2df1wgvY= X-Google-Smtp-Source: ABdhPJwAboi9CjOAMTjr+NfQFz6zGL9bX+mfSc7IZMv8APLCGWNMV2T1FA6NlerIpG5wj+/eqeK9cQ== X-Received: by 2002:a05:6512:1114:: with SMTP id l20mr1359564lfg.126.1617789800611; Wed, 07 Apr 2021 03:03:20 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyydy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::6]) by smtp.gmail.com with ESMTPSA id v137sm716388lfa.187.2021.04.07.03.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 03:03:20 -0700 (PDT) Date: Wed, 7 Apr 2021 13:03:11 +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 2/8] regulator: add warning flags Message-ID: <03ebe1f85fa85762f705a7bf29faf271c9fe3401.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 Add 'warning' level events and error flags to regulator core. Current regulator core notifications are used to inform consumers about errors where HW is misbehaving in such way it is assumed to be broken/unrecoverable. There are PMICs which are designed for system(s) that may have use for regulator indications sent before HW is damaged so that some board/consumer specific recovery-event can be performed while continuing most of the normal operations. Add new WARNING level events and notifications to be used for that purpose. Signed-off-by: Matti Vaittinen --- No changes since RFC-v2 --- include/linux/regulator/consumer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 20e84a84fb77..f72ca73631be 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -119,6 +119,16 @@ struct regulator_dev; #define REGULATOR_EVENT_PRE_DISABLE 0x400 #define REGULATOR_EVENT_ABORT_DISABLE 0x800 #define REGULATOR_EVENT_ENABLE 0x1000 +/* + * Following notifications should be emitted only if detected condition + * is such that the HW is likely to still be working but consumers should + * take a recovery action to prevent problems esacalating into errors. + */ +#define REGULATOR_EVENT_UNDER_VOLTAGE_WARN 0x2000 +#define REGULATOR_EVENT_OVER_CURRENT_WARN 0x4000 +#define REGULATOR_EVENT_OVER_VOLTAGE_WARN 0x8000 +#define REGULATOR_EVENT_OVER_TEMP_WARN 0x10000 +#define REGULATOR_EVENT_WARN_MASK 0x1E000 /* * Regulator errors that can be queried using regulator_get_error_flags @@ -138,6 +148,10 @@ struct regulator_dev; #define REGULATOR_ERROR_FAIL BIT(4) #define REGULATOR_ERROR_OVER_TEMP BIT(5) +#define REGULATOR_ERROR_UNDER_VOLTAGE_WARN BIT(6) +#define REGULATOR_ERROR_OVER_CURRENT_WARN BIT(7) +#define REGULATOR_ERROR_OVER_VOLTAGE_WARN BIT(8) +#define REGULATOR_ERROR_OVER_TEMP_WARN BIT(9) /** * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event 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: "Vaittinen, Matti" X-Patchwork-Id: 416879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A60CC433ED for ; Wed, 7 Apr 2021 10:05:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7B01613B8 for ; Wed, 7 Apr 2021 10:05:56 +0000 (UTC) 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 From patchwork Wed Apr 7 10:06:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 416878 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3419C43460 for ; Wed, 7 Apr 2021 10:06:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B31F46139B for ; Wed, 7 Apr 2021 10:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346696AbhDGKGw (ORCPT ); Wed, 7 Apr 2021 06:06:52 -0400 Received: from mail-lf1-f54.google.com ([209.85.167.54]:35370 "EHLO mail-lf1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346542AbhDGKGX (ORCPT ); Wed, 7 Apr 2021 06:06:23 -0400 Received: by mail-lf1-f54.google.com with SMTP id w28so27509324lfn.2; Wed, 07 Apr 2021 03:06:13 -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=QYZKnG5sW48x9oFbbMIXt3sQ2d75rIBaQQRFZCVetlI=; b=Pf+rW2H16RVONAq2855JboC/H0BC0RQa2mlrl4Z82p7Q0w1jPFESVt7SukSqEoJDHz 7R6NqojzAKMPgQmHy+fSC5/AB+WLTED4mt0CGqtgKd6yjb8kR7rnqzLN9Zp/EKQqsW8J /z14IfCOeCrwHBZR4gknDnGN4jvIc1PM4r1MbdlOdd9zyDG/jhNIpSs4003wKCQ4dE1C nnfwZ450IAzGan8YY+rLuHXFyXpQ1RA+1A5JytR0yB1ZVtGu9eTtdv0QZvhoZqJAuXY4 amc8BkSAvHqCxN2Acro37usItmwfLiW0UNAPRs1iBaV9CTXFzJA4CsaXf6dByGir1n9d VPdQ== X-Gm-Message-State: AOAM533K+F5PImSSaVEKgKMyDwtSH3/9DY81AjBSnIL1BiPDdd5ekT9y xJ6Y6rk8vWlxP1adYdFV/dA= X-Google-Smtp-Source: ABdhPJw6HmzKrFkTQYXsR3w07jUqF3BkDOpNEPQ77/7ShZXmM3D9C1+viKOuezsYixzhLBjqUoXxTg== X-Received: by 2002:a19:670c:: with SMTP id b12mr2014271lfc.441.1617789972333; Wed, 07 Apr 2021 03:06:12 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyydy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::6]) by smtp.gmail.com with ESMTPSA id h62sm2433228lfd.234.2021.04.07.03.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 03:06:11 -0700 (PDT) Date: Wed, 7 Apr 2021 13:06:05 +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 7/8] regulator: bd9576: Fix the driver name in id table Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Driver name was changed in MFD cell: https://lore.kernel.org/lkml/560b9748094392493ebf7af11b6cc558776c4fd5.1613031055.git.matti.vaittinen@fi.rohmeurope.com/ Fix the ID table to match this. Signed-off-by: Matti Vaittinen --- Please note - this patch is not really related to the series. This change is related to separate MFD driver change and was only added as part of this series to avoid the conflicts. No changes since RFC-v2 --- drivers/regulator/bd9576-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/bd9576-regulator.c b/drivers/regulator/bd9576-regulator.c index 0d55d383d2aa..aeb816cf9ad3 100644 --- a/drivers/regulator/bd9576-regulator.c +++ b/drivers/regulator/bd9576-regulator.c @@ -1117,8 +1117,8 @@ static int bd957x_probe(struct platform_device *pdev) } static const struct platform_device_id bd957x_pmic_id[] = { - { "bd9573-pmic", ROHM_CHIP_TYPE_BD9573 }, - { "bd9576-pmic", ROHM_CHIP_TYPE_BD9576 }, + { "bd9573-regulator", ROHM_CHIP_TYPE_BD9573 }, + { "bd9576-regulator", ROHM_CHIP_TYPE_BD9576 }, { }, }; MODULE_DEVICE_TABLE(platform, bd957x_pmic_id);