Message ID | eacb8a0aad9190219b36763927602e9a566649c2.1613042245.git.matti.vaittinen@fi.rohmeurope.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | Extend regulator notification support | expand |
On Thu, Feb 11, 2021 at 02:34:17PM +0200, Matti Vaittinen wrote: > 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 <matti.vaittinen@fi.rohmeurope.com> > --- > .../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: Kind of long and 'current' is implied by 'microamp'. Perhaps regulator-oc-protection-microamp and similar. > + 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 =]
On Fri, 2021-03-05 at 13:30 -0600, Rob Herring wrote: > On Thu, Feb 11, 2021 at 02:34:17PM +0200, Matti Vaittinen wrote: > > 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 <matti.vaittinen@fi.rohmeurope.com> > > --- > > .../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: > > Kind of long and 'current' is implied by 'microamp'. Perhaps > regulator-oc-protection-microamp and similar. I like this idea but... regulator-over-current-protection: description: Enable over current protection. type: boolean is an existing property so it kind of makes sense to me to name the limit setting in a similar way. But I will change it as you suggested as I don't think this is a big thing. Br, Matti Vaittinen > > > -- > > 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 =]
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:
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 <matti.vaittinen@fi.rohmeurope.com> --- .../bindings/regulator/regulator.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+)