xref: /openbmc/phosphor-power/phosphor-power-supply/psu_manager.hpp (revision aca86d059b92947cd5e430a5d4d1f1fee2ff5b89)
12bac8609SBrandon Wyman #pragma once
22bac8609SBrandon Wyman 
3a0f33ce3SBrandon Wyman #include "power_supply.hpp"
4a0f33ce3SBrandon Wyman #include "types.hpp"
5a0f33ce3SBrandon Wyman #include "utility.hpp"
6a0f33ce3SBrandon Wyman 
7a0f33ce3SBrandon Wyman #include <phosphor-logging/log.hpp>
82bac8609SBrandon Wyman #include <sdbusplus/bus/match.hpp>
9c9b05736SAdriana Kobylak #include <sdbusplus/server/manager.hpp>
10c9b05736SAdriana Kobylak #include <sdbusplus/server/object.hpp>
112bac8609SBrandon Wyman #include <sdeventplus/event.hpp>
122bac8609SBrandon Wyman #include <sdeventplus/utility/timer.hpp>
13c9b05736SAdriana Kobylak #include <xyz/openbmc_project/State/Decorator/PowerSystemInputs/server.hpp>
142bac8609SBrandon Wyman 
15aed1f75dSBrandon Wyman struct sys_properties
16aed1f75dSBrandon Wyman {
17d3a70d98SAdriana Kobylak     int powerSupplyCount;
18d3a70d98SAdriana Kobylak     std::vector<uint64_t> inputVoltage;
19886574cdSAdriana Kobylak     bool powerConfigFullLoad;
20aed1f75dSBrandon Wyman };
21aed1f75dSBrandon Wyman 
22a0f33ce3SBrandon Wyman using namespace phosphor::power::psu;
23a0f33ce3SBrandon Wyman using namespace phosphor::logging;
24a0f33ce3SBrandon Wyman 
2563ea78b9SBrandon Wyman namespace phosphor::power::manager
262bac8609SBrandon Wyman {
272bac8609SBrandon Wyman 
28c9b05736SAdriana Kobylak using PowerSystemInputsInterface = sdbusplus::xyz::openbmc_project::State::
29c9b05736SAdriana Kobylak     Decorator::server::PowerSystemInputs;
30c9b05736SAdriana Kobylak using PowerSystemInputsObject =
31c9b05736SAdriana Kobylak     sdbusplus::server::object_t<PowerSystemInputsInterface>;
32c9b05736SAdriana Kobylak 
332aba2b25SAdriana Kobylak // Validation timeout. Allow 10s to detect if new EM interfaces show up in D-Bus
342aba2b25SAdriana Kobylak // before performing the validation.
352aba2b25SAdriana Kobylak constexpr auto validationTimeout = std::chrono::seconds(10);
36a4d38fadSAdriana Kobylak 
372bac8609SBrandon Wyman /**
38c9b05736SAdriana Kobylak  * @class PowerSystemInputs
39c9b05736SAdriana Kobylak  * @brief A concrete implementation for the PowerSystemInputs interface.
40c9b05736SAdriana Kobylak  */
41c9b05736SAdriana Kobylak class PowerSystemInputs : public PowerSystemInputsObject
42c9b05736SAdriana Kobylak {
43c9b05736SAdriana Kobylak   public:
44c9b05736SAdriana Kobylak     PowerSystemInputs(sdbusplus::bus::bus& bus, const std::string& path) :
45c9b05736SAdriana Kobylak         PowerSystemInputsObject(bus, path.c_str())
46c9b05736SAdriana Kobylak     {}
47c9b05736SAdriana Kobylak };
48c9b05736SAdriana Kobylak 
49c9b05736SAdriana Kobylak /**
502bac8609SBrandon Wyman  * @class PSUManager
512bac8609SBrandon Wyman  *
522bac8609SBrandon Wyman  * This class will create an object used to manage and monitor a list of power
532bac8609SBrandon Wyman  * supply devices.
542bac8609SBrandon Wyman  */
552bac8609SBrandon Wyman class PSUManager
562bac8609SBrandon Wyman {
572bac8609SBrandon Wyman   public:
582bac8609SBrandon Wyman     PSUManager() = delete;
592bac8609SBrandon Wyman     ~PSUManager() = default;
602bac8609SBrandon Wyman     PSUManager(const PSUManager&) = delete;
612bac8609SBrandon Wyman     PSUManager& operator=(const PSUManager&) = delete;
622bac8609SBrandon Wyman     PSUManager(PSUManager&&) = delete;
632bac8609SBrandon Wyman     PSUManager& operator=(PSUManager&&) = delete;
642bac8609SBrandon Wyman 
652bac8609SBrandon Wyman     /**
66510acaabSBrandon Wyman      * Constructor to read configuration from D-Bus.
67510acaabSBrandon Wyman      *
68510acaabSBrandon Wyman      * @param[in] bus - D-Bus bus object
69510acaabSBrandon Wyman      * @param[in] e - event object
70510acaabSBrandon Wyman      */
71510acaabSBrandon Wyman     PSUManager(sdbusplus::bus::bus& bus, const sdeventplus::Event& e);
72510acaabSBrandon Wyman 
73510acaabSBrandon Wyman     /**
74510acaabSBrandon Wyman      * Get PSU properties from D-Bus, use that to build a power supply
75510acaabSBrandon Wyman      * object.
76510acaabSBrandon Wyman      *
77510acaabSBrandon Wyman      * @param[in] properties - A map of property names and values
78510acaabSBrandon Wyman      *
79510acaabSBrandon Wyman      */
80510acaabSBrandon Wyman     void getPSUProperties(util::DbusPropertyMap& properties);
81510acaabSBrandon Wyman 
82510acaabSBrandon Wyman     /**
83510acaabSBrandon Wyman      * Get PSU configuration from D-Bus
84510acaabSBrandon Wyman      */
85510acaabSBrandon Wyman     void getPSUConfiguration();
86510acaabSBrandon Wyman 
87510acaabSBrandon Wyman     /**
889bab9e10SAdriana Kobylak      * @brief Initialize the system properties from the Supported Configuration
899bab9e10SAdriana Kobylak      *        D-Bus object provided by Entity Manager.
909bab9e10SAdriana Kobylak      */
919bab9e10SAdriana Kobylak     void getSystemProperties();
929bab9e10SAdriana Kobylak 
939bab9e10SAdriana Kobylak     /**
942bac8609SBrandon Wyman      * Initializes the manager.
952bac8609SBrandon Wyman      *
962bac8609SBrandon Wyman      * Get current BMC state, ...
972bac8609SBrandon Wyman      */
98*aca86d05SJim Wright     void initialize();
992bac8609SBrandon Wyman 
1002bac8609SBrandon Wyman     /**
1012bac8609SBrandon Wyman      * Starts the timer to start monitoring the list of devices.
1022bac8609SBrandon Wyman      */
1032bac8609SBrandon Wyman     int run()
1042bac8609SBrandon Wyman     {
1052fe5186eSBrandon Wyman         return timer->get_event().loop();
1062bac8609SBrandon Wyman     }
1072bac8609SBrandon Wyman 
1082bac8609SBrandon Wyman     /**
10959a35793SBrandon Wyman      * Write PMBus ON_OFF_CONFIG
11059a35793SBrandon Wyman      *
11159a35793SBrandon Wyman      * This function will be called to cause the PMBus device driver to send the
11259a35793SBrandon Wyman      * ON_OFF_CONFIG command. Takes one byte of data.
11359a35793SBrandon Wyman      */
11459a35793SBrandon Wyman     void onOffConfig(const uint8_t data)
11559a35793SBrandon Wyman     {
11659a35793SBrandon Wyman         for (auto& psu : psus)
11759a35793SBrandon Wyman         {
11859a35793SBrandon Wyman             psu->onOffConfig(data);
11959a35793SBrandon Wyman         }
12059a35793SBrandon Wyman     }
12159a35793SBrandon Wyman 
12259a35793SBrandon Wyman     /**
1232bac8609SBrandon Wyman      * This function will be called in various situations in order to clear
1242bac8609SBrandon Wyman      * any fault status bits that may have been set, in order to start over
1252bac8609SBrandon Wyman      * with a clean state. Presence changes and power state changes will want
1262bac8609SBrandon Wyman      * to clear any faults logged.
1272bac8609SBrandon Wyman      */
1282bac8609SBrandon Wyman     void clearFaults()
1292bac8609SBrandon Wyman     {
13010fc6e87SBrandon Wyman         setPowerSupplyError("");
131a0f33ce3SBrandon Wyman         for (auto& psu : psus)
132a0f33ce3SBrandon Wyman         {
133aed1f75dSBrandon Wyman             psu->clearFaults();
134a0f33ce3SBrandon Wyman         }
1352bac8609SBrandon Wyman     }
1362bac8609SBrandon Wyman 
1372bac8609SBrandon Wyman   private:
1382bac8609SBrandon Wyman     /**
1392bac8609SBrandon Wyman      * The D-Bus object
1402bac8609SBrandon Wyman      */
1412bac8609SBrandon Wyman     sdbusplus::bus::bus& bus;
1422bac8609SBrandon Wyman 
1432bac8609SBrandon Wyman     /**
1442bac8609SBrandon Wyman      * The timer that runs to periodically check the power supplies.
1452bac8609SBrandon Wyman      */
1462fe5186eSBrandon Wyman     std::unique_ptr<
1472fe5186eSBrandon Wyman         sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>>
1482fe5186eSBrandon Wyman         timer;
1492bac8609SBrandon Wyman 
1502bac8609SBrandon Wyman     /**
151a4d38fadSAdriana Kobylak      * The timer that performs power supply validation as the entity manager
152a4d38fadSAdriana Kobylak      * interfaces show up in d-bus.
153a4d38fadSAdriana Kobylak      */
154a4d38fadSAdriana Kobylak     std::unique_ptr<
155a4d38fadSAdriana Kobylak         sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>>
156a4d38fadSAdriana Kobylak         validationTimer;
157a4d38fadSAdriana Kobylak 
158a4d38fadSAdriana Kobylak     /**
15910fc6e87SBrandon Wyman      * Let power control/sequencer application know of PSU error(s).
16010fc6e87SBrandon Wyman      *
16110fc6e87SBrandon Wyman      * @param[in] psuErrorString - string for power supply error
16210fc6e87SBrandon Wyman      */
16310fc6e87SBrandon Wyman     void setPowerSupplyError(const std::string& psuErrorString);
16410fc6e87SBrandon Wyman 
16510fc6e87SBrandon Wyman     /**
166b76ab249SBrandon Wyman      * Create an error
167b76ab249SBrandon Wyman      *
168b76ab249SBrandon Wyman      * @param[in] faultName - 'name' message for the BMC error log entry
1698b66288aSBrandon Wyman      * @param[in,out] additionalData - The AdditionalData property for the error
170b76ab249SBrandon Wyman      */
171b76ab249SBrandon Wyman     void createError(const std::string& faultName,
1728b66288aSBrandon Wyman                      std::map<std::string, std::string>& additionalData);
173b76ab249SBrandon Wyman 
174b76ab249SBrandon Wyman     /**
1752bac8609SBrandon Wyman      * Analyze the status of each of the power supplies.
176b76ab249SBrandon Wyman      *
177b76ab249SBrandon Wyman      * Log errors for faults, when and where appropriate.
1782bac8609SBrandon Wyman      */
17963ea78b9SBrandon Wyman     void analyze();
1802bac8609SBrandon Wyman 
1812bac8609SBrandon Wyman     /** @brief True if the power is on. */
1822bac8609SBrandon Wyman     bool powerOn = false;
1832bac8609SBrandon Wyman 
184*aca86d05SJim Wright     /** @brief True if power control is in the window between chassis pgood loss
185*aca86d05SJim Wright      * and power off. */
186*aca86d05SJim Wright     bool powerFaultOccurring = false;
187*aca86d05SJim Wright 
1882549d792SAdriana Kobylak     /** @brief True if an error for a brownout has already been logged. */
1892549d792SAdriana Kobylak     bool brownoutLogged = false;
1902549d792SAdriana Kobylak 
191a0f33ce3SBrandon Wyman     /** @brief Used as part of subscribing to power on state changes*/
192a0f33ce3SBrandon Wyman     std::string powerService;
193a0f33ce3SBrandon Wyman 
1942bac8609SBrandon Wyman     /** @brief Used to subscribe to D-Bus power on state changes */
1952bac8609SBrandon Wyman     std::unique_ptr<sdbusplus::bus::match_t> powerOnMatch;
1962bac8609SBrandon Wyman 
1979ba38235SAdriana Kobylak     /** @brief Used to subscribe to D-Bus power supply presence changes */
1989ba38235SAdriana Kobylak     std::vector<std::unique_ptr<sdbusplus::bus::match_t>> presenceMatches;
1999ba38235SAdriana Kobylak 
2009bab9e10SAdriana Kobylak     /** @brief Used to subscribe to Entity Manager interfaces added */
2019bab9e10SAdriana Kobylak     std::unique_ptr<sdbusplus::bus::match_t> entityManagerIfacesAddedMatch;
2029bab9e10SAdriana Kobylak 
2032bac8609SBrandon Wyman     /**
2042bac8609SBrandon Wyman      * @brief Callback for power state property changes
2052bac8609SBrandon Wyman      *
2062bac8609SBrandon Wyman      * Process changes to the powered on state property for the system.
2072bac8609SBrandon Wyman      *
2082bac8609SBrandon Wyman      * @param[in] msg - Data associated with the power state signal
2092bac8609SBrandon Wyman      */
2102bac8609SBrandon Wyman     void powerStateChanged(sdbusplus::message::message& msg);
2112bac8609SBrandon Wyman 
2122bac8609SBrandon Wyman     /**
2139ba38235SAdriana Kobylak      * @brief Callback for inventory property changes
2149ba38235SAdriana Kobylak      *
2159ba38235SAdriana Kobylak      * Process change of the Present property for power supply.
2169ba38235SAdriana Kobylak      *
2179ba38235SAdriana Kobylak      * @param[in]  msg - Data associated with the Present change signal
2189ba38235SAdriana Kobylak      **/
2199ba38235SAdriana Kobylak     void presenceChanged(sdbusplus::message::message& msg);
2209ba38235SAdriana Kobylak 
2219ba38235SAdriana Kobylak     /**
2223e42913fSBrandon Wyman      * @brief Callback for entity-manager interface added
2239bab9e10SAdriana Kobylak      *
2243e42913fSBrandon Wyman      * Process the information from the supported configuration and or IBM CFFPS
2253e42913fSBrandon Wyman      * Connector interface being added.
2269bab9e10SAdriana Kobylak      *
2279bab9e10SAdriana Kobylak      * @param[in] msg - Data associated with the interfaces added signal
2289bab9e10SAdriana Kobylak      */
2293e42913fSBrandon Wyman     void entityManagerIfaceAdded(sdbusplus::message::message& msg);
2309bab9e10SAdriana Kobylak 
2319bab9e10SAdriana Kobylak     /**
2322bac8609SBrandon Wyman      * @brief Adds properties to the inventory.
2332bac8609SBrandon Wyman      *
2342bac8609SBrandon Wyman      * Reads the values from the devices and writes them to the associated
2352bac8609SBrandon Wyman      * power supply D-Bus inventory objects.
2362bac8609SBrandon Wyman      *
2372bac8609SBrandon Wyman      * This needs to be done on startup, and each time the presence state
2382bac8609SBrandon Wyman      * changes.
2392bac8609SBrandon Wyman      */
240a0f33ce3SBrandon Wyman     void updateInventory()
241a0f33ce3SBrandon Wyman     {
242a0f33ce3SBrandon Wyman         for (auto& psu : psus)
243a0f33ce3SBrandon Wyman         {
244aed1f75dSBrandon Wyman             psu->updateInventory();
245a0f33ce3SBrandon Wyman         }
246a0f33ce3SBrandon Wyman     }
247a0f33ce3SBrandon Wyman 
248a0f33ce3SBrandon Wyman     /**
249e1074d8eSAdriana Kobylak      * @brief Helper function to populate the system properties
250e1074d8eSAdriana Kobylak      *
251e1074d8eSAdriana Kobylak      * @param[in] properties - A map of property names and values
252e1074d8eSAdriana Kobylak      */
253e1074d8eSAdriana Kobylak     void populateSysProperties(const util::DbusPropertyMap& properties);
254e1074d8eSAdriana Kobylak 
255e1074d8eSAdriana Kobylak     /**
25664e9775dSBrandon Wyman      * @brief Update inventory for missing required power supplies
25764e9775dSBrandon Wyman      */
25864e9775dSBrandon Wyman     void updateMissingPSUs();
25964e9775dSBrandon Wyman 
26064e9775dSBrandon Wyman     /**
2618f16fb5eSAdriana Kobylak      * @brief Perform power supply configuration validation.
2628f16fb5eSAdriana Kobylak      * @details Validates if the existing power supply properties are a
2638f16fb5eSAdriana Kobylak      * supported configuration, and acts on its findings such as logging errors.
2648f16fb5eSAdriana Kobylak      */
2658f16fb5eSAdriana Kobylak     void validateConfig();
2668f16fb5eSAdriana Kobylak 
2678f16fb5eSAdriana Kobylak     /**
2688f16fb5eSAdriana Kobylak      * @brief Flag to indicate if the validateConfig() function should be run.
2698f16fb5eSAdriana Kobylak      * Set to false once the configuration has been validated to avoid running
2708f16fb5eSAdriana Kobylak      * multiple times due to interfaces added signal. Set to true during power
2718f16fb5eSAdriana Kobylak      * off to trigger the validation on power on.
2728f16fb5eSAdriana Kobylak      */
2738f16fb5eSAdriana Kobylak     bool runValidateConfig = true;
2748f16fb5eSAdriana Kobylak 
2758f16fb5eSAdriana Kobylak     /**
2764d9aaf91SAdriana Kobylak      * @brief Check that all PSUs have the same model name and that the system
2774d9aaf91SAdriana Kobylak      * has the required number of PSUs present as specified in the Supported
2784d9aaf91SAdriana Kobylak      * Configuration interface.
2794d9aaf91SAdriana Kobylak      *
2804d9aaf91SAdriana Kobylak      * @param[out] additionalData - Contains debug information on why the check
2814d9aaf91SAdriana Kobylak      *             might have failed. Can be used to fill in error logs.
2824d9aaf91SAdriana Kobylak      * @return true if all the required PSUs are present, false otherwise.
2834d9aaf91SAdriana Kobylak      */
2844d9aaf91SAdriana Kobylak     bool hasRequiredPSUs(std::map<std::string, std::string>& additionalData);
2854d9aaf91SAdriana Kobylak 
2864d9aaf91SAdriana Kobylak     /**
2879252b7e3SShawn McCarney      * @brief Returns the number of PSUs that are required to be present.
2889252b7e3SShawn McCarney      *
2899252b7e3SShawn McCarney      * @return required number of PSUs, or 0 if the number could not be
2909252b7e3SShawn McCarney      *         determined.
2919252b7e3SShawn McCarney      */
2929252b7e3SShawn McCarney     unsigned int getRequiredPSUCount();
2939252b7e3SShawn McCarney 
2949252b7e3SShawn McCarney     /**
2959252b7e3SShawn McCarney      * @brief Returns whether the specified PSU is required to be present.
2969252b7e3SShawn McCarney      *
2979252b7e3SShawn McCarney      * @param[in] psu - Power supply to check
2989252b7e3SShawn McCarney      * @return true if PSU is required, false otherwise.
2999252b7e3SShawn McCarney      */
3009252b7e3SShawn McCarney     bool isRequiredPSU(const PowerSupply& psu);
3019252b7e3SShawn McCarney 
3029252b7e3SShawn McCarney     /**
303523704d0SAdriana Kobylak      * @brief Helper function to validate that all PSUs have the same model name
304523704d0SAdriana Kobylak      *
305523704d0SAdriana Kobylak      * @param[out] model - The model name. Empty if there is a mismatch.
306523704d0SAdriana Kobylak      * @param[out] additionalData - If there is a mismatch, it contains debug
307523704d0SAdriana Kobylak      *             information such as the mismatched model name.
308523704d0SAdriana Kobylak      * @return true if all the PSUs have the same model name, false otherwise.
309523704d0SAdriana Kobylak      */
310523704d0SAdriana Kobylak     bool validateModelName(std::string& model,
311523704d0SAdriana Kobylak                            std::map<std::string, std::string>& additionalData);
312523704d0SAdriana Kobylak 
313523704d0SAdriana Kobylak     /**
314c0a07580SAdriana Kobylak      * @brief Set the power-config-full-load GPIO depending on the EM full load
315c0a07580SAdriana Kobylak      *        property value.
316c0a07580SAdriana Kobylak      */
317c0a07580SAdriana Kobylak     void setPowerConfigGPIO();
318c0a07580SAdriana Kobylak 
319c0a07580SAdriana Kobylak     /**
320e5b1e087SAdriana Kobylak      * @brief Indicate that the system is in a brownout condition by creating an
321e5b1e087SAdriana Kobylak      * error log and setting the PowerSystemInputs status property to Fault.
322e5b1e087SAdriana Kobylak      *
323e5b1e087SAdriana Kobylak      * @param[in] additionalData - Contains debug information on the number of
324e5b1e087SAdriana Kobylak      *            PSUs in fault state or not present.
325e5b1e087SAdriana Kobylak      */
326e5b1e087SAdriana Kobylak     void setBrownout(std::map<std::string, std::string>& additionalData);
327e5b1e087SAdriana Kobylak 
328e5b1e087SAdriana Kobylak     /**
329e5b1e087SAdriana Kobylak      * @brief Indicate that the system is no longer in a brownout condition by
330e5b1e087SAdriana Kobylak      * setting the PowerSystemInputs status property to Good.
331e5b1e087SAdriana Kobylak      */
332e5b1e087SAdriana Kobylak     void clearBrownout();
333e5b1e087SAdriana Kobylak 
334e5b1e087SAdriana Kobylak     /**
3359ea66a67SAdriana Kobylak      * @brief Map of supported PSU configurations that include the model name
3369ea66a67SAdriana Kobylak      * and their properties.
337aed1f75dSBrandon Wyman      */
338d3a70d98SAdriana Kobylak     std::map<std::string, sys_properties> supportedConfigs;
339aed1f75dSBrandon Wyman 
340aed1f75dSBrandon Wyman     /**
341a0f33ce3SBrandon Wyman      * @brief The vector for power supplies.
342a0f33ce3SBrandon Wyman      */
343aed1f75dSBrandon Wyman     std::vector<std::unique_ptr<PowerSupply>> psus;
344c0a07580SAdriana Kobylak 
345c0a07580SAdriana Kobylak     /**
346c0a07580SAdriana Kobylak      * @brief The libgpiod object for setting the power supply config
347c0a07580SAdriana Kobylak      */
348c0a07580SAdriana Kobylak     std::unique_ptr<GPIOInterfaceBase> powerConfigGPIO = nullptr;
349c9b05736SAdriana Kobylak 
350c9b05736SAdriana Kobylak     /**
351c9b05736SAdriana Kobylak      * @brief PowerSystemInputs object
352c9b05736SAdriana Kobylak      */
353c9b05736SAdriana Kobylak     PowerSystemInputs powerSystemInputs;
354c9b05736SAdriana Kobylak 
355c9b05736SAdriana Kobylak     /**
356c3324424SBrandon Wyman      * @brief Implement the ObjectManager for PowerSystemInputs object.
357c3324424SBrandon Wyman      *
358c3324424SBrandon Wyman      * Implements the org.freedesktop.DBus.ObjectManager interface used to
359c3324424SBrandon Wyman      * communicate updates to the PowerSystemInputs object on the
360c3324424SBrandon Wyman      * /xyz/openbmc_project/power/power_supplies root D-Bus path.
361c9b05736SAdriana Kobylak      */
362c9b05736SAdriana Kobylak     sdbusplus::server::manager_t objectManager;
363c3324424SBrandon Wyman 
364c3324424SBrandon Wyman     /**
365c3324424SBrandon Wyman      * @brief Implement the ObjectManager for power supply input history.
366c3324424SBrandon Wyman      *
367c3324424SBrandon Wyman      * Implements the org.freedesktop.DBus.ObjectManager interface used to
368c3324424SBrandon Wyman      * communicate updates to the Average and Maximum interface properties on
369c3324424SBrandon Wyman      * the /org/open_power/sensors root D-Bus path.
370c3324424SBrandon Wyman      */
371c3324424SBrandon Wyman     sdbusplus::server::manager_t historyManager;
37218a24d92SBrandon Wyman 
37318a24d92SBrandon Wyman     /**
37418a24d92SBrandon Wyman      * @brief GPIO to toggle to 'sync' power supply input history.
37518a24d92SBrandon Wyman      */
37618a24d92SBrandon Wyman     std::unique_ptr<GPIOInterfaceBase> syncHistoryGPIO = nullptr;
37718a24d92SBrandon Wyman 
37818a24d92SBrandon Wyman     /**
37918a24d92SBrandon Wyman      * @brief Toggles the GPIO to sync power supply input history readings
38018a24d92SBrandon Wyman      *
38118a24d92SBrandon Wyman      * This GPIO is connected to all supplies.  This will clear the
38218a24d92SBrandon Wyman      * previous readings out of the supplies and restart them both at the
38318a24d92SBrandon Wyman      * same time zero and at record ID 0.  The supplies will return 0
38418a24d92SBrandon Wyman      * bytes of data for the input history command right after this until
38518a24d92SBrandon Wyman      * a new entry shows up.
38618a24d92SBrandon Wyman      *
38718a24d92SBrandon Wyman      * This will cause the code to delete all previous history data and
38818a24d92SBrandon Wyman      * start fresh.
38918a24d92SBrandon Wyman      */
39018a24d92SBrandon Wyman     void syncHistory();
3912bac8609SBrandon Wyman };
3922bac8609SBrandon Wyman 
39363ea78b9SBrandon Wyman } // namespace phosphor::power::manager
394