chassis: Monitor the PowerSystemInputs for power status

In addition to the uPower interface, monitor the PowerSystemInputs
interface to detect a Brownout condition. Reference:
https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/48015

Tested: In simulation, trigger a power supply brownout and clear it,
verify that phosphor-chassis-check-power-status detects the condition:

Mar 29 19:02:21 p10bmc phosphor-chassis-state-manager[1101]: Power
System Inputs status changed to
xyz.openbmc_project.State.Decorator.PowerSystemInputs.Status.Fault
Mar 29 19:02:21 p10bmc phosphor-chassis-state-manager[1101]: Power
System Inputs status is in Fault state

root@p10bmc:~# /usr/bin/phosphor-chassis-check-power-status --chassis 0
<3> Chassis power status is not good:
xyz.openbmc_project.State.Chassis.PowerStatus.BrownOut
Mar 29 19:08:20 p10bmc phosphor-chassis-check-power-status[1133]:
Chassis power status is not good:
xyz.openbmc_project.State.Chassis.PowerStatus.BrownOut
Mar 29 19:08:20 p10bmc phosphor-log-manager[319]: Created PEL 0x50000004
(BMC ID 4) with SRC BDA13402
Mar 29 19:08:20 p10bmc phosphor-ledmanager[447]: SAI: FRU path:
/xyz/openbmc_project/inventory/system

Mar 29 19:02:21 p10bmc phosphor-chassis-state-manager[1101]: Power
System Inputs status changed to
xyz.openbmc_project.State.Decorator.PowerSystemInputs.Status.Good
Mar 29 19:02:21 p10bmc phosphor-chassis-state-manager[1101]:
determineStatusOfPSUPower(): Good

root@p10bmc:~# /usr/bin/phosphor-chassis-check-power-status --chassis 0
<6> Chassis power status good, start power on

Change-Id: I6adbb6474155e50219b6a48dd9b2cf872934f4a6
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/chassis_state_manager.hpp b/chassis_state_manager.hpp
index b48409b..7d10c2a 100644
--- a/chassis_state_manager.hpp
+++ b/chassis_state_manager.hpp
@@ -92,9 +92,21 @@
     /** @brief Determine initial chassis state and set internally */
     void determineInitialState();
 
-    /** @brief Determine status of power into system */
+    /** @brief Determine status of power into system by examining all the
+     *        power-related interfaces of interest
+     */
     void determineStatusOfPower();
 
+    /** @brief Determine status of power provided by an Uninterruptible Power
+     *         Supply into the system
+     */
+    void determineStatusOfUPSPower();
+
+    /** @brief Determine status of power provided by the power supply units into
+     *         the system
+     */
+    void determineStatusOfPSUPower();
+
     /**
      * @brief subscribe to the systemd signals
      *
@@ -140,9 +152,12 @@
     /** @brief Used to subscribe to dbus systemd signals **/
     sdbusplus::bus::match_t systemdSignals;
 
-    /** @brief Watch for any changes to UPS properties  **/
+    /** @brief Watch for any changes to UPS properties **/
     std::unique_ptr<sdbusplus::bus::match_t> uPowerPropChangeSignal;
 
+    /** @brief Watch for any changes to PowerSystemInputs properties **/
+    std::unique_ptr<sdbusplus::bus::match_t> powerSysInputsPropChangeSignal;
+
     /** @brief Chassis id. **/
     const size_t id = 0;
 
@@ -228,6 +243,16 @@
      *
      */
     void uPowerChangeEvent(sdbusplus::message::message& msg);
+
+    /** @brief Process PowerSystemInputs property changes
+     *
+     * Instance specific interface to monitor for changes to the
+     * PowerSystemInputs properties which may impact CurrentPowerStatus
+     *
+     * @param[in]  msg              - Data associated with subscribed signal
+     *
+     */
+    void powerSysInputsChangeEvent(sdbusplus::message::message& msg);
 };
 
 } // namespace manager