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/util.cpp b/phosphor-power-supply/util.cpp
index f80bac7..5942ce7 100644
--- a/phosphor-power-supply/util.cpp
+++ b/phosphor-power-supply/util.cpp
@@ -31,6 +31,11 @@
return std::make_unique<GPIOReader>(namedGpio);
}
+std::string GPIOReader::getName() const
+{
+ return line.name();
+}
+
int GPIOReader::read()
{
using namespace phosphor::logging;