On Sat, 2019-09-28 at 14:18 +0200, Greg KH wrote: > Again, the power_supply api is for power going the other way in the > system. That's not an "existing clearly defined API in kernel > space". No it isn't, not since 2011. commit 25a0bc2dfc2ea732f40af2dae52426ead66ae76e Author: Jeremy Fitzhardinge <jeremy@xxxxxxxx> Date: Wed Dec 7 11:24:20 2011 -0800 power_supply: add SCOPE attribute to power supplies This adds a "scope" attribute to a power_supply, which indicates how much of the system it powers. It appears in sysfs as "scope" or in the uevent file as POWER_SUPPLY_SCOPE=. There are presently three possible values: Unknown - unknown power topology System - the power supply powers the whole system Device - it powers a specific device, or tree of devices A power supply which doesn't have a "scope" attribute should be assumed to have "System" scope. In general, usermode should assume that loss of all System-scoped power supplies will power off the whole system, but any single one is sufficient to power the system. Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxx> Cc: Richard Hughes <richard@xxxxxxxxxxx>