On Tue, Oct 10, 2023 at 02:55:31PM +0200, Oleksij Rempel wrote: > Hi, > > On Tue, Oct 10, 2023 at 01:19:36PM +0100, Mark Brown wrote: > > On Tue, Oct 10, 2023 at 10:59:06AM +0200, Oleksij Rempel wrote: > > > Add handler to forward under-voltage events. > > > On systems for more or less complicated regulator chains we need to > > > forward under-voltage events to actual driver which need to react on > > > them. > > > > It isn't clear to me why this would be implemented in one specific > > driver, nor why this would be done unconditionally. Could you provide > > some information on the problem you're trying to solve here? > > The hardware I am working with has an under-voltage sensor on the 24V > supply regulator and some backup capacitors to run SoC for 100ms. I want > to forward under-voltage events across a chain of different regulators > to a designated consumer. For instance, to the mmc driver, enabling it > to initiate shutdown before power loss occurs. Additionally, a bit can > be set in the volatile memory of a scratch pad in an RTC clock to record > sudden power loss, which can be checked on the next system start. The bit picture of my HW may potentially be even more advanced: - some regulator chain paths are disabled by the HW. With other words under-voltage event is converted to fail or disable. There is nothing what software can do, but it will be good to reflect it on the SW side for diagnostic. - some paths can be disabled by software to get some more milliseconds of life and complete emergency shutdown task. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |