fs/ramfs/file-nommu.c: make ramfs_nommu_get_unmapped_area() and ramfs_nommu_mmap...
[deliverable/linux.git] / include / linux / power_supply.h
index 804b90643a85eae1b42f46f6870b5be3f23b36c2..c9dc4e09854cb87f728ad797d940ac4c8b1b4b14 100644 (file)
@@ -15,6 +15,8 @@
 
 #include <linux/workqueue.h>
 #include <linux/leds.h>
+#include <linux/spinlock.h>
+#include <linux/notifier.h>
 
 struct device;
 
@@ -157,6 +159,10 @@ enum power_supply_type {
        POWER_SUPPLY_TYPE_USB_ACA,      /* Accessory Charger Adapters */
 };
 
+enum power_supply_notifier_events {
+       PSY_EVENT_PROP_CHANGED,
+};
+
 union power_supply_propval {
        int intval;
        const char *strval;
@@ -194,6 +200,8 @@ struct power_supply {
        /* private */
        struct device *dev;
        struct work_struct changed_work;
+       spinlock_t changed_lock;
+       bool changed;
 #ifdef CONFIG_THERMAL
        struct thermal_zone_device *tzd;
        struct thermal_cooling_device *tcd;
@@ -232,7 +240,18 @@ struct power_supply_info {
        int use_for_apm;
 };
 
+extern struct atomic_notifier_head power_supply_notifier;
+extern int power_supply_reg_notifier(struct notifier_block *nb);
+extern void power_supply_unreg_notifier(struct notifier_block *nb);
 extern struct power_supply *power_supply_get_by_name(const char *name);
+#ifdef CONFIG_OF
+extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
+                                                       const char *property);
+#else /* !CONFIG_OF */
+static inline struct power_supply *
+power_supply_get_by_phandle(struct device_node *np, const char *property)
+{ return NULL; }
+#endif /* CONFIG_OF */
 extern void power_supply_changed(struct power_supply *psy);
 extern int power_supply_am_i_supplied(struct power_supply *psy);
 extern int power_supply_set_battery_charged(struct power_supply *psy);
This page took 0.025488 seconds and 5 git commands to generate.