psu-ng: Updates to get VPD data to inventory

Add in code to retrieve the VPD data and populate that data to the D-Bus
inventory properties.

Use the PMBus utilities to retrieve the model (CCIN for IBM power
supplies), part number, serial number, and firmware version information
from the sysfs "files" provided via the device driver.

Only build in IBM VPD data collection and reporting if meson ran with
-Dibm-vpd=true.

Tested:
    Copied SDK build of phospor-psu-monitor with -Dibm-vpd=true to
    Rainier hardware system, verified inventory properties updated/added.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I61688b154ead570e9d9390342596bf7d840f4dce
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 487fa53..eb310da 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -6,9 +6,30 @@
 
 #include <sdbusplus/bus/match.hpp>
 
+#include <stdexcept>
+
 namespace phosphor::power::psu
 {
 
+#ifdef IBM_VPD
+// PMBus device driver "file name" to read for CCIN value.
+constexpr auto CCIN = "ccin";
+constexpr auto PART_NUMBER = "part_number";
+constexpr auto FRU_NUMBER = "fru";
+constexpr auto SERIAL_HEADER = "header";
+constexpr auto SERIAL_NUMBER = "serial_number";
+constexpr auto FW_VERSION = "fw_version";
+
+// The D-Bus property name to update with the CCIN value.
+constexpr auto MODEL_PROP = "Model";
+constexpr auto PN_PROP = "PartNumber";
+constexpr auto SN_PROP = "SerialNumber";
+constexpr auto VERSION_PROP = "Version";
+
+// ipzVPD Keyword sizes
+static constexpr auto FL_KW_SIZE = 20;
+#endif
+
 /**
  * @class PowerSupply
  * Represents a PMBus power supply device.
@@ -34,6 +55,11 @@
         inventoryPath(invpath),
         pmbusIntf(phosphor::pmbus::createPMBus(i2cbus, i2caddr))
     {
+        if (inventoryPath.empty())
+        {
+            throw std::invalid_argument{"Invalid empty inventoryPath"};
+        }
+
         // Setup the functions to call when the D-Bus inventory path for the
         // Present property changes.
         presentMatch = std::make_unique<sdbusplus::bus::match_t>(
@@ -99,9 +125,7 @@
      * - CCIN (Customer Card Identification Number) - added as the Model
      * - Firmware version
      */
-    void updateInventory()
-    {
-    }
+    void updateInventory();
 
     /**
      * @brief Accessor function to indicate present status