diff options
author | Andrey Smirnov | 2019-06-12 01:44:04 -0700 |
---|---|---|
committer | Sebastian Reichel | 2019-06-23 19:47:48 +0200 |
commit | e67d4dfc9ff19dbe74b29617cf2592ccc50c3920 (patch) | |
tree | 53334515e7f23b3ae073935f57d9af7784160414 /include/linux/power_supply.h | |
parent | 22ee8384dc688cbcb8ac03112ce81c43d55a961b (diff) |
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/linux/power_supply.h')
-rw-r--r-- | include/linux/power_supply.h | 13 |
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__ */ |