regulator: bd9576: Support error reporting
authorMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Thu, 3 Jun 2021 05:42:46 +0000 (08:42 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 21 Jun 2021 12:08:51 +0000 (13:08 +0100)
commite7bf1fa58c46db9f72220c4472272d6da0a54c91
tree36066f6444a3ceff363aca53f25ccf8bdd72c581
parent627793e4ca4f511837de893545baf0e1b8174dc2
regulator: bd9576: Support error reporting

BD9573 and BD9576 support set of "protection" interrupts for "fatal"
issues. Those lead to SOC reset as PMIC shuts the power outputs. Thus
there is no relevant IRQ handling for them.

Few "detection" interrupts were added to the BD9576 with the idea that
SOC could take some recovery-action before error gets unrecoverable.

Add support for over and under voltage detection for Vout1 ... Vout4
and VoutL1. Add over-current detection for VoutS1 and finally a
thermal warning (common for all regulators) which alerts 30 C
before temperature reaches the thermal shutdown point. This way
consumer drivers can build error-recovery mechanisms.

Unfortunately the BD9576 interrupt logic was not re-evaluated. IRQs
are not designed to be properly acknowleged - and IRQ line is kept
active for whole duration of error condition (in comparison to
informing only about state change).

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/05c4f7a8e30ef1d4d5f3ceab07da4ebe68f5b4ed.1622628334.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/bd9576-regulator.c