regulator: Add protection limit properties

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>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/ae2c6056d5ed1334912d27e736d23c9151065433.1622628333.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Matti Vaittinen 2021-06-03 08:40:28 +03:00 committed by Mark Brown
parent 8124c8a6b3
commit 673e851b7d
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 82 additions and 0 deletions

View File

@ -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: