aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power_supply.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 09:43:54 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 10:06:11 -0400
commit7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch)
tree5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /include/linux/power_supply.h
parent7d754596756240fa918b94cd0c3011c77a638987 (diff)
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
Merge 'Linux v3.0' into Litmus
Some notes: * Litmus^RT scheduling class is the topmost scheduling class (above stop_sched_class). * scheduler_ipi() function (e.g., in smp_reschedule_interrupt()) may increase IPI latencies. * Added path into schedule() to quickly re-evaluate scheduling decision without becoming preemptive again. This used to be a standard path before the removal of BKL. Conflicts: Makefile arch/arm/kernel/calls.S arch/arm/kernel/smp.c arch/x86/include/asm/unistd_32.h arch/x86/kernel/smp.c arch/x86/kernel/syscall_table_32.S include/linux/hrtimer.h kernel/printk.c kernel/sched.c kernel/sched_fair.c
Diffstat (limited to 'include/linux/power_supply.h')
-rw-r--r--include/linux/power_supply.h53
1 files changed, 52 insertions, 1 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 30083a896f36..204c18dfdc9e 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -89,6 +89,7 @@ enum power_supply_property {
89 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, 89 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
90 POWER_SUPPLY_PROP_VOLTAGE_NOW, 90 POWER_SUPPLY_PROP_VOLTAGE_NOW,
91 POWER_SUPPLY_PROP_VOLTAGE_AVG, 91 POWER_SUPPLY_PROP_VOLTAGE_AVG,
92 POWER_SUPPLY_PROP_CURRENT_MAX,
92 POWER_SUPPLY_PROP_CURRENT_NOW, 93 POWER_SUPPLY_PROP_CURRENT_NOW,
93 POWER_SUPPLY_PROP_CURRENT_AVG, 94 POWER_SUPPLY_PROP_CURRENT_AVG,
94 POWER_SUPPLY_PROP_POWER_NOW, 95 POWER_SUPPLY_PROP_POWER_NOW,
@@ -125,7 +126,10 @@ enum power_supply_type {
125 POWER_SUPPLY_TYPE_BATTERY = 0, 126 POWER_SUPPLY_TYPE_BATTERY = 0,
126 POWER_SUPPLY_TYPE_UPS, 127 POWER_SUPPLY_TYPE_UPS,
127 POWER_SUPPLY_TYPE_MAINS, 128 POWER_SUPPLY_TYPE_MAINS,
128 POWER_SUPPLY_TYPE_USB, 129 POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */
130 POWER_SUPPLY_TYPE_USB_DCP, /* Dedicated Charging Port */
131 POWER_SUPPLY_TYPE_USB_CDP, /* Charging Downstream Port */
132 POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
129}; 133};
130 134
131union power_supply_propval { 135union power_supply_propval {
@@ -169,6 +173,8 @@ struct power_supply {
169 char *full_trig_name; 173 char *full_trig_name;
170 struct led_trigger *online_trig; 174 struct led_trigger *online_trig;
171 char *online_trig_name; 175 char *online_trig_name;
176 struct led_trigger *charging_blink_full_solid_trig;
177 char *charging_blink_full_solid_trig_name;
172#endif 178#endif
173}; 179};
174 180
@@ -209,4 +215,49 @@ extern void power_supply_unregister(struct power_supply *psy);
209/* For APM emulation, think legacy userspace. */ 215/* For APM emulation, think legacy userspace. */
210extern struct class *power_supply_class; 216extern struct class *power_supply_class;
211 217
218static inline bool power_supply_is_amp_property(enum power_supply_property psp)
219{
220 switch (psp) {
221 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
222 case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
223 case POWER_SUPPLY_PROP_CHARGE_FULL:
224 case POWER_SUPPLY_PROP_CHARGE_EMPTY:
225 case POWER_SUPPLY_PROP_CHARGE_NOW:
226 case POWER_SUPPLY_PROP_CHARGE_AVG:
227 case POWER_SUPPLY_PROP_CHARGE_COUNTER:
228 case POWER_SUPPLY_PROP_CURRENT_MAX:
229 case POWER_SUPPLY_PROP_CURRENT_NOW:
230 case POWER_SUPPLY_PROP_CURRENT_AVG:
231 return 1;
232 default:
233 break;
234 }
235
236 return 0;
237}
238
239static inline bool power_supply_is_watt_property(enum power_supply_property psp)
240{
241 switch (psp) {
242 case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
243 case POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN:
244 case POWER_SUPPLY_PROP_ENERGY_FULL:
245 case POWER_SUPPLY_PROP_ENERGY_EMPTY:
246 case POWER_SUPPLY_PROP_ENERGY_NOW:
247 case POWER_SUPPLY_PROP_ENERGY_AVG:
248 case POWER_SUPPLY_PROP_VOLTAGE_MAX:
249 case POWER_SUPPLY_PROP_VOLTAGE_MIN:
250 case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
251 case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
252 case POWER_SUPPLY_PROP_VOLTAGE_NOW:
253 case POWER_SUPPLY_PROP_VOLTAGE_AVG:
254 case POWER_SUPPLY_PROP_POWER_NOW:
255 return 1;
256 default:
257 break;
258 }
259
260 return 0;
261}
262
212#endif /* __LINUX_POWER_SUPPLY_H__ */ 263#endif /* __LINUX_POWER_SUPPLY_H__ */