We are developing a small battery, based on capacitor, which can keep the machine ON for 2 minutes once the AC Power is lost.

We are going to write a Linux device driver for the module, it provides us with the status information like AC is connected or disconnected.

Is there any way for the Linux driver to send standard messages such as

  1. AC Power Lost
  2. AC Power restored
  3. Shutdown

All the applications registered for that event should get the message.


Yes this must have already been solved: It is what every laptop does, your battery only differs in being smaller capacity, and hopefully having a longer life. You may not need to create a driver (this is preferable: as no need to install custom software), if you make the hardware comply with existing standards.

The driver will not send a message, but will send an event. The driver should not send a shutdown, as this is up to the policy. It should send power lost, or power critical, the policy then will send a shutdown event.

  • What is the event . Can you provide how to send that event – md.jamal Feb 2 at 13:41
  • No. Look at existing code, or better design the hardware to be compatible with a standard, so that existing drivers can be used. – ctrl-alt-delor Feb 2 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.