psu-ng: Add accessor to get GPIO line name
Update the utilities to give the line name for a GPIO.
Add accessor to power supply class to get the name of the presence GPIO
line.
Signed-off-by: B. J. Wyman <bjwyman@gmail.com>
Change-Id: Ic10fd81c6de024dbcb27088c5935ac9947af9465
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 86eb926..f67d2a1 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -70,6 +70,18 @@
return presenceGPIO.get();
}
+ std::string getPresenceGPIOName() const
+ {
+ if (presenceGPIO != nullptr)
+ {
+ return presenceGPIO->getName();
+ }
+ else
+ {
+ return std::string();
+ }
+ }
+
/**
* Power supply specific function to analyze for faults/errors.
*