psu-ng: Implement the PowerSystemInputs interface

Implement the PowerSystemInputs interface which contains the status of
the power inputs to the chassis. The psu monitor app will use the status
property to communicate if a brownout condition exists.
Implement this interface under a /chassis0 path to specify it applies to
the current chassis. This can later be enhanced to support a
multi-chassis configuration.

Tested: The status property exists and it's set to default value Good:
root@p10bmc:~# busctl get-property xyz.openbmc_project.Power.PSUMonitor\
    /xyz/openbmc_project/power/power_supplies/chassis0/psus\
    xyz.openbmc_project.State.Decorator.PowerSystemInputs Status
s "xyz.openbmc_project.State.Decorator.PowerSystemInputs.Status.Good"

Change-Id: I7cf4d13e632841e0b19b52af0d9eac886eb161ce
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/phosphor-power-supply/psu_manager.hpp b/phosphor-power-supply/psu_manager.hpp
index 2754eab..d291324 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -6,8 +6,11 @@
 
 #include <phosphor-logging/log.hpp>
 #include <sdbusplus/bus/match.hpp>
+#include <sdbusplus/server/manager.hpp>
+#include <sdbusplus/server/object.hpp>
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/utility/timer.hpp>
+#include <xyz/openbmc_project/State/Decorator/PowerSystemInputs/server.hpp>
 
 struct sys_properties
 {
@@ -22,11 +25,28 @@
 namespace phosphor::power::manager
 {
 
+using PowerSystemInputsInterface = sdbusplus::xyz::openbmc_project::State::
+    Decorator::server::PowerSystemInputs;
+using PowerSystemInputsObject =
+    sdbusplus::server::object_t<PowerSystemInputsInterface>;
+
 // Validation timeout. Allow 10s to detect if new EM interfaces show up in D-Bus
 // before performing the validation.
 constexpr auto validationTimeout = std::chrono::seconds(10);
 
 /**
+ * @class PowerSystemInputs
+ * @brief A concrete implementation for the PowerSystemInputs interface.
+ */
+class PowerSystemInputs : public PowerSystemInputsObject
+{
+  public:
+    PowerSystemInputs(sdbusplus::bus::bus& bus, const std::string& path) :
+        PowerSystemInputsObject(bus, path.c_str())
+    {}
+};
+
+/**
  * @class PSUManager
  *
  * This class will create an object used to manage and monitor a list of power
@@ -319,6 +339,16 @@
      * @brief The libgpiod object for setting the power supply config
      */
     std::unique_ptr<GPIOInterfaceBase> powerConfigGPIO = nullptr;
+
+    /**
+     * @brief PowerSystemInputs object
+     */
+    PowerSystemInputs powerSystemInputs;
+
+    /**
+     * @brief Implement the org.freedesktop.DBus.ObjectManager interface
+     */
+    sdbusplus::server::manager_t objectManager;
 };
 
 } // namespace phosphor::power::manager