psu: Introduce the PowerSupply class

The Power Supply Manager (PSUManager) class will need a list of power
supplies to work with. Create these via the PowerSupply class.

Update Power Supply Manager to call the initialization function, and
update the power state.

Update clearFaults() to go through the list of power supplies and call
their individual clearFaults() functions.

Update the power supply manager analyze() function to go through the
list of power supplies and call their analyze() function.

Update the power supply manager updateInventory() function to call the
updateInventory() function in each power supply in the list.

Update the meson.build file to include the header files in the parent
directory, and link with the library containing the utility functions
the binary will need to use.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I743180d47f1b25d34c7e7001b64a6197905b86ff
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
new file mode 100644
index 0000000..3bfa77a
--- /dev/null
+++ b/phosphor-power-supply/power_supply.hpp
@@ -0,0 +1,66 @@
+#pragma once
+
+namespace phosphor::power::psu
+{
+/**
+ * @class PowerSupply
+ * Represents a PMBus power supply device.
+ */
+class PowerSupply
+{
+  public:
+    PowerSupply();
+    PowerSupply(const PowerSupply&) = delete;
+    PowerSupply(PowerSupply&&) = delete;
+    PowerSupply& operator=(const PowerSupply&) = delete;
+    PowerSupply& operator=(PowerSupply&&) = delete;
+    ~PowerSupply() = default;
+
+    /**
+     * Power supply specific function to analyze for faults/errors.
+     *
+     * Various PMBus status bits will be checked for fault conditions.
+     * If a certain fault bits are on, the appropriate error will be
+     * committed.
+     */
+    void analyze()
+    {
+    }
+
+    /**
+     * Write PMBus CLEAR_FAULTS
+     *
+     * This function will be called in various situations in order to clear
+     * any fault status bits that may have been set, in order to start over
+     * with a clean state. Presence changes and power state changes will
+     * want to clear any faults logged.
+     */
+    void clearFaults()
+    {
+    }
+
+    /**
+     * @brief Adds properties to the inventory.
+     *
+     * Reads the values from the device and writes them to the
+     * associated power supply D-Bus inventory object.
+     *
+     * This needs to be done on startup, and each time the presence
+     * state changes.
+     *
+     * Properties added:
+     * - Serial Number
+     * - Part Number
+     * - CCIN (Customer Card Identification Number) - added as the Model
+     * - Firmware version
+     */
+    void updateInventory()
+    {
+    }
+
+  private:
+    /** @brief True if a fault has already been found and not cleared */
+    bool faultFound = false;
+};
+
+} // namespace phosphor::power::psu