Skip to content

Hotplug

username-removed-207648 requested to merge sre/tint2:hotplug into master

Hi,

So I went on and added the hotplug stuff. It's currently used for two things:

  1. reconfigure battery if a power_supply add/remove event has been received (e.g. new battery)
  2. update battery if a power_supply change event has been received (e.g. sent for AC connect/disconnect)

The second one is useful to make "ac_connect_cmd" and "ac_disconnect_cmd" react instantly. Otherwise they are only executed when the battery update routine is scheduled again. It does not introduce any new library dependencies and the kernel interface is considered as ABI, so there won't be any frequent changes.

I also added a little fix on top, that prevents ac_connect_cmd execution during tint2 startup (with AC connected).

-- Sebastian

Merge request reports