]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/power_supply.h
power_supply: Prevent suspend until power supply events are processed
[karo-tx-linux.git] / include / linux / power_supply.h
index 3828cefb4f65876e635e5533d24233d32ab6590b..5c2600630dc99ace79f3d001416db6d37f568806 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <linux/workqueue.h>
 #include <linux/leds.h>
+#include <linux/spinlock.h>
 
 struct device;
 
@@ -162,6 +163,8 @@ union power_supply_propval {
        const char *strval;
 };
 
+struct device_node;
+
 struct power_supply {
        const char *name;
        enum power_supply_type type;
@@ -173,9 +176,7 @@ struct power_supply {
 
        char **supplied_from;
        size_t num_supplies;
-#ifdef CONFIG_OF
        struct device_node *of_node;
-#endif
 
        int (*get_property)(struct power_supply *psy,
                            enum power_supply_property psp,
@@ -194,6 +195,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;