aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power_supply.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/power_supply.h')
-rw-r--r--include/linux/power_supply.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 594c494ac3f0..b5d096d3a9be 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -39,6 +39,13 @@ enum {
39}; 39};
40 40
41enum { 41enum {
42 POWER_SUPPLY_CHARGE_TYPE_UNKNOWN = 0,
43 POWER_SUPPLY_CHARGE_TYPE_NONE,
44 POWER_SUPPLY_CHARGE_TYPE_TRICKLE,
45 POWER_SUPPLY_CHARGE_TYPE_FAST,
46};
47
48enum {
42 POWER_SUPPLY_HEALTH_UNKNOWN = 0, 49 POWER_SUPPLY_HEALTH_UNKNOWN = 0,
43 POWER_SUPPLY_HEALTH_GOOD, 50 POWER_SUPPLY_HEALTH_GOOD,
44 POWER_SUPPLY_HEALTH_OVERHEAT, 51 POWER_SUPPLY_HEALTH_OVERHEAT,
@@ -58,9 +65,19 @@ enum {
58 POWER_SUPPLY_TECHNOLOGY_LiMn, 65 POWER_SUPPLY_TECHNOLOGY_LiMn,
59}; 66};
60 67
68enum {
69 POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0,
70 POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL,
71 POWER_SUPPLY_CAPACITY_LEVEL_LOW,
72 POWER_SUPPLY_CAPACITY_LEVEL_NORMAL,
73 POWER_SUPPLY_CAPACITY_LEVEL_HIGH,
74 POWER_SUPPLY_CAPACITY_LEVEL_FULL,
75};
76
61enum power_supply_property { 77enum power_supply_property {
62 /* Properties of type `int' */ 78 /* Properties of type `int' */
63 POWER_SUPPLY_PROP_STATUS = 0, 79 POWER_SUPPLY_PROP_STATUS = 0,
80 POWER_SUPPLY_PROP_CHARGE_TYPE,
64 POWER_SUPPLY_PROP_HEALTH, 81 POWER_SUPPLY_PROP_HEALTH,
65 POWER_SUPPLY_PROP_PRESENT, 82 POWER_SUPPLY_PROP_PRESENT,
66 POWER_SUPPLY_PROP_ONLINE, 83 POWER_SUPPLY_PROP_ONLINE,
@@ -89,6 +106,7 @@ enum power_supply_property {
89 POWER_SUPPLY_PROP_ENERGY_NOW, 106 POWER_SUPPLY_PROP_ENERGY_NOW,
90 POWER_SUPPLY_PROP_ENERGY_AVG, 107 POWER_SUPPLY_PROP_ENERGY_AVG,
91 POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ 108 POWER_SUPPLY_PROP_CAPACITY, /* in percents! */
109 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
92 POWER_SUPPLY_PROP_TEMP, 110 POWER_SUPPLY_PROP_TEMP,
93 POWER_SUPPLY_PROP_TEMP_AMBIENT, 111 POWER_SUPPLY_PROP_TEMP_AMBIENT,
94 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, 112 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
@@ -126,6 +144,7 @@ struct power_supply {
126 enum power_supply_property psp, 144 enum power_supply_property psp,
127 union power_supply_propval *val); 145 union power_supply_propval *val);
128 void (*external_power_changed)(struct power_supply *psy); 146 void (*external_power_changed)(struct power_supply *psy);
147 void (*set_charged)(struct power_supply *psy);
129 148
130 /* For APM emulation, think legacy userspace. */ 149 /* For APM emulation, think legacy userspace. */
131 int use_for_apm; 150 int use_for_apm;
@@ -165,8 +184,10 @@ struct power_supply_info {
165 int use_for_apm; 184 int use_for_apm;
166}; 185};
167 186
187extern struct power_supply *power_supply_get_by_name(char *name);
168extern void power_supply_changed(struct power_supply *psy); 188extern void power_supply_changed(struct power_supply *psy);
169extern int power_supply_am_i_supplied(struct power_supply *psy); 189extern int power_supply_am_i_supplied(struct power_supply *psy);
190extern int power_supply_set_battery_charged(struct power_supply *psy);
170 191
171#if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) 192#if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE)
172extern int power_supply_is_system_supplied(void); 193extern int power_supply_is_system_supplied(void);