aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2011-12-07 14:24:20 -0500
committerJeremy Fitzhardinge <jeremy@goop.org>2011-12-09 12:42:05 -0500
commit25a0bc2dfc2ea732f40af2dae52426ead66ae76e (patch)
tree180dc7e4122da2f40b241c5e936a0668420f4bb7 /include
parentcfcfc9eca2bcbd26a8e206baeb005b055dbf8e37 (diff)
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@goop.org> Cc: Richard Hughes <richard@hughsie.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/power_supply.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 204c18dfdc9e..040a7b08e7c7 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -74,6 +74,12 @@ enum {
74 POWER_SUPPLY_CAPACITY_LEVEL_FULL, 74 POWER_SUPPLY_CAPACITY_LEVEL_FULL,
75}; 75};
76 76
77enum {
78 POWER_SUPPLY_SCOPE_UNKNOWN = 0,
79 POWER_SUPPLY_SCOPE_SYSTEM,
80 POWER_SUPPLY_SCOPE_DEVICE,
81};
82
77enum power_supply_property { 83enum power_supply_property {
78 /* Properties of type `int' */ 84 /* Properties of type `int' */
79 POWER_SUPPLY_PROP_STATUS = 0, 85 POWER_SUPPLY_PROP_STATUS = 0,
@@ -116,6 +122,7 @@ enum power_supply_property {
116 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, 122 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
117 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, 123 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
118 POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ 124 POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
125 POWER_SUPPLY_PROP_SCOPE,
119 /* Properties of type `const char *' */ 126 /* Properties of type `const char *' */
120 POWER_SUPPLY_PROP_MODEL_NAME, 127 POWER_SUPPLY_PROP_MODEL_NAME,
121 POWER_SUPPLY_PROP_MANUFACTURER, 128 POWER_SUPPLY_PROP_MANUFACTURER,