psu-ng: INPUT_HISTORY syncHistory

Add in the function that syncs the power supply input history data
between all the installed power supplies.

Use the GPIO line name instead of gpiochip and number. Use libgpiod via
helper utility. Create a toggleLowHigh() to use for synchronizing the
input history.

Add in indicator and helper functions to indicate a syncHistory is
needed if a power supply goes from missing to present.

Trace when syncHistory is called. This should be infrequent enough that
I do not think it would be a problem.

Initial testing on Rainier 2S2U did not need a lengthy delay between
lowering and raising the power-ffs-sync-history GPIO, but testing on
Rainier 2S4u required a longer delay.

Depends-On: Ib1ac2456f7f715360d089dfa4b6b379b516439ab

Change-Id: I022806155139d70fb4a42cc27eb9f279f6a3aedc
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/phosphor-power-supply/util.hpp b/phosphor-power-supply/util.hpp
index 92e4eeb..caa5bac 100644
--- a/phosphor-power-supply/util.hpp
+++ b/phosphor-power-supply/util.hpp
@@ -11,6 +11,7 @@
 #include <phosphor-logging/log.hpp>
 
 #include <bitset>
+#include <chrono>
 
 namespace phosphor::power::psu
 {
@@ -260,6 +261,15 @@
     void write(int value, std::bitset<32> flags) override;
 
     /**
+     * @brief Attempts to toggle (write) a GPIO low then high.
+     *
+     * Relies on write, so throws exception if line not found, etc.
+     *
+     * @param[in] delay - Milliseconds to delay betwen low/high toggle.
+     */
+    void toggleLowHigh(const std::chrono::milliseconds& delay) override;
+
+    /**
      * @brief Returns the name of the GPIO, if not empty.
      */
     std::string getName() const override;