Skip to content

Commit e6c3092

Browse files
M-Vaittinenbroonie
authored andcommitted
regulator: add warning flags
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 <[email protected]> Link: https://lore.kernel.org/r/9b54aa5589ae4b5945d53d114bac3fae55fa4818.1622628333.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <[email protected]>
1 parent db0aeb4 commit e6c3092

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/linux/regulator/consumer.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ struct regulator_dev;
119119
#define REGULATOR_EVENT_PRE_DISABLE 0x400
120120
#define REGULATOR_EVENT_ABORT_DISABLE 0x800
121121
#define REGULATOR_EVENT_ENABLE 0x1000
122+
/*
123+
* Following notifications should be emitted only if detected condition
124+
* is such that the HW is likely to still be working but consumers should
125+
* take a recovery action to prevent problems esacalating into errors.
126+
*/
127+
#define REGULATOR_EVENT_UNDER_VOLTAGE_WARN 0x2000
128+
#define REGULATOR_EVENT_OVER_CURRENT_WARN 0x4000
129+
#define REGULATOR_EVENT_OVER_VOLTAGE_WARN 0x8000
130+
#define REGULATOR_EVENT_OVER_TEMP_WARN 0x10000
131+
#define REGULATOR_EVENT_WARN_MASK 0x1E000
122132

123133
/*
124134
* Regulator errors that can be queried using regulator_get_error_flags
@@ -138,6 +148,10 @@ struct regulator_dev;
138148
#define REGULATOR_ERROR_FAIL BIT(4)
139149
#define REGULATOR_ERROR_OVER_TEMP BIT(5)
140150

151+
#define REGULATOR_ERROR_UNDER_VOLTAGE_WARN BIT(6)
152+
#define REGULATOR_ERROR_OVER_CURRENT_WARN BIT(7)
153+
#define REGULATOR_ERROR_OVER_VOLTAGE_WARN BIT(8)
154+
#define REGULATOR_ERROR_OVER_TEMP_WARN BIT(9)
141155

142156
/**
143157
* struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event

0 commit comments

Comments
 (0)