aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/power_supply.h
diff options
context:
space:
mode:
authorSebastian Reichel <sre@debian.org>2013-11-24 17:49:29 +0100
committerAnton Vorontsov <anton@enomsg.org>2013-12-23 18:21:11 -0800
commitabce97708a9b5ba897ad94fa289804d8af8d3ea9 (patch)
tree130cb8a31d312f755b0f26303218b377863c3b7c /include/linux/power_supply.h
parentbq2415x_charger: Use power_supply notifier for automode (diff)
downloadwireguard-linux-abce97708a9b5ba897ad94fa289804d8af8d3ea9.tar.xz
wireguard-linux-abce97708a9b5ba897ad94fa289804d8af8d3ea9.zip
power_supply: Add power_supply_get_by_phandle
Add method to get power supply by device tree phandle. Signed-off-by: Sebastian Reichel <sre@debian.org> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'include/linux/power_supply.h')
-rw-r--r--include/linux/power_supply.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3e28fe188d17..c9dc4e09854c 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -244,6 +244,14 @@ 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);