Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2556893pxj; Mon, 10 May 2021 05:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfB5UahyM109c1vHw/HwsqYjXEbP3ZN4gojPibehf19dkL/Nyypfvy7z1usEwE79Q6y11C X-Received: by 2002:a05:6e02:2143:: with SMTP id d3mr6398105ilv.269.1620651183927; Mon, 10 May 2021 05:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620651183; cv=none; d=google.com; s=arc-20160816; b=O3GzCUAK1e5Qqb1MU+UvZmLhFY1Vvd9ArUPEwi2OhE04O+z8fuQgZDbGSgZjkUuBFA rrWMTfGtIiDCtCdz8dUTW4hUFhLlM1PRW157s5PrKXiAnKENwtdZdZ53xwM7zB/0O+dB RKATRv92WoVbacrYRqRU5fLRIroBx9oaw6HyZ5hA9U9gHgD1xl3ShoZpY6rp9Q4/kOja ckHWZID5OgB3ySGggYgTLQwU+L5dmcMYY5HI9V1SBLK40NTYioKXtipTCxbAKwc/KBSE 1of5jF1vLUBh74MC4ZdUzKBpvw0A21YcX0udzeoSrwYiiE2LKzOIXsCsu4OW+Q6eh3Ym HpsQ== 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=FUdRlSiiUa5Y1q43J/1tupaWVg9evxJCbTVAbgek4vI=; b=b8HwIK5aEm/c/qUFDhUzHtlzOkvUaLYH3uYtez9/ErALpwFhifoVp1exPaOGsqDp5M N2xtENF9w+krFSFVG06DG/zCofs+YWVMhctZZlMPm8x2DxkAmxLNGL+DBL15RQwmfPU1 yF6xlQ3tkTVooMv8asELbJk2ezb5kQ0K61lTC+A0986Z4zPVO5xgUDOZShNQMe8z3nkT njkDcYR8LZyq1pIr+LHUKIoDCpynyAJWcOu2Q01uIMYra2jv8sCe1omhi9azcfDXNPrw lba5SbEeioWYCqcHK1zdGa+jo7QMhef3tBd2vKCq9mDqWjkQ+3ZeR9HEZvYIaj/TGPNl C5aQ== 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 m24si15525125jao.105.2021.05.10.05.52.50; Mon, 10 May 2021 05:53:03 -0700 (PDT) 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 S1349255AbhEJMsz (ORCPT + 99 others); Mon, 10 May 2021 08:48:55 -0400 Received: from mail-lj1-f176.google.com ([209.85.208.176]:46603 "EHLO mail-lj1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238980AbhEJLah (ORCPT ); Mon, 10 May 2021 07:30:37 -0400 Received: by mail-lj1-f176.google.com with SMTP id e11so6806960ljn.13; Mon, 10 May 2021 04:29:32 -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=FUdRlSiiUa5Y1q43J/1tupaWVg9evxJCbTVAbgek4vI=; b=dgjsUgegtyTHJkdbswxRfr4v+Ta+Vh2k79+vT4njV2BZ/v/0me8KTY0psfJISF956u wksRoUMIQaMaqR3YUbMQPhedx4zPJdrjpF9aLFTaGm/DQFKMg44gJ5Kf51K1uGyrZ9UX 3Zf7YC5uocSfEZclI9Zd8tY2KJtvLM1weEWZisLWq0Z5clmm63Bwud4bTcogGA8eZO4w b7/IQE/0gnuosespA8Qx4IsXXeMdDcrBO+BeKtkF2CLUh8vD5xn0I+sJUToXBmuryfy7 1ytfEGFkj+bjwUGrsFtnDvey5/Eiy1uhNInwfRc/RNkI/csOLfHzEfCBFxmFKM2Eo2GI jw+g== X-Gm-Message-State: AOAM532MGqSYI0pIva8BFwxKXga2K9w/J20F193pAUO7DCcywc0jaBIH B2YUiCg4EeQe1WEHOyCsXkw= X-Received: by 2002:a2e:b0c2:: with SMTP id g2mr19621429ljl.492.1620646171486; Mon, 10 May 2021 04:29:31 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyyby-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::2]) by smtp.gmail.com with ESMTPSA id h19sm3222897ljg.119.2021.05.10.04.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 04:29:30 -0700 (PDT) Date: Mon, 10 May 2021 14:29:25 +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 04/10] regulator: add warning flags Message-ID: <5976be0ed8418f4b5e74a809c8353835279d61cd.1620645507.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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/c= onsumer.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 =20 /* * 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) =20 +#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) =20 /** * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event --=20 2.25.4 --=20 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 =3D]=20 --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmCZGRUACgkQeFA3/03a ocVtWAf9HpTkWb8S/YPZm7Bb3Fd+koeatvSWJZhjpiGOvCWS2rNNbQYj1spxsQoG VyAN2YQGqvucbQik6kWshsEqMIsnIMwW6SX2azn40bA3C4VV0yKK0s95Z9r3Glvj oZ40mjupnveuf2Bzsl5d7s6+aW6AGtm5LdHr2i7s7TrP01DsoKln+S7mOWUmsfwM F01JEAMarVNR8AFcNBmBmn81KomgeGoZxK1LBzciZgrIHkWEdVoI+u04MKToSyXk rUDFgFP2zcaOjO0CWb69wHANU9XCND8JURSyiWP+mwUvBZwV1dOi/E1QoM84YD2h ftLHZ8j0eWqzsvzHaS2B+JtoQZFPNg== =Htol -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt--