summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-06-12 10:44:04 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2019-06-23 19:47:48 +0200
commite67d4dfc9ff19dbe74b29617cf2592ccc50c3920 (patch)
tree53334515e7f23b3ae073935f57d9af7784160414 /include
parentpower: supply: sbs-manager: simplify getting the adapter of a client (diff)
downloadlinux-e67d4dfc9ff19dbe74b29617cf2592ccc50c3920.tar.xz
linux-e67d4dfc9ff19dbe74b29617cf2592ccc50c3920.zip
power: supply: Add HWMON compatibility layer
Add code implementing HWMON adapter/compatibility layer to allow expositing various sensors present on power supply devices via HWMON subsystem. This is done in order to allow userspace to use single ABI/library(libsensors) to access/manipulate all of the sensors of the system. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Chris Healy <cphealy@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Cory Tusar <cory.tusar@zii.aero> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Sebastian Reichel <sre@kernel.org> Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/power_supply.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index d9c0c094f8a0..d5b15e039f4f 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -481,4 +481,17 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
return 0;
}
+#ifdef CONFIG_POWER_SUPPLY_HWMON
+int power_supply_add_hwmon_sysfs(struct power_supply *psy);
+void power_supply_remove_hwmon_sysfs(struct power_supply *psy);
+#else
+static inline int power_supply_add_hwmon_sysfs(struct power_supply *psy)
+{
+ return 0;
+}
+
+static inline
+void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {}
+#endif
+
#endif /* __LINUX_POWER_SUPPLY_H__ */