psu-ng: Add Availability support to power supplies

Add support for determining if a power supply is considered 'available'
or not, and set the Available D-Bus property on the
xyz.openbmc_project.State.Decorator.Availability interface with the
result.

A power supply is considered unavailable if any of the following are
true:
 - it isn't present
 - there is a input fault active
 - there is a Vin UV fault active
 - there is a PS KILL fault active
 - there is a Iout OC fault active

The latter four faults are the faults where it can't provide good
output power, hence the PS is unavailable.  These faults also don't
call out the power supply directly, so the Functional property won't
get set to false, unlike other faults.

The Available D-Bus property is then able to be used in Redfish
responses for the heath and state properties in the power supply
schema.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I349eddb8c052cf238276c832af0dde9e49f6d3f0
diff --git a/types.hpp b/types.hpp
index b79bbb9..19563e3 100644
--- a/types.hpp
+++ b/types.hpp
@@ -13,6 +13,8 @@
 constexpr auto OPERATIONAL_STATE_IFACE =
     "xyz.openbmc_project.State.Decorator.OperationalStatus";
 constexpr auto VERSION_IFACE = "xyz.openbmc_project.Software.Version";
+constexpr auto AVAILABILITY_IFACE =
+    "xyz.openbmc_project.State.Decorator.Availability";
 #ifdef IBM_VPD
 constexpr auto DINF_IFACE = "com.ibm.ipzvpd.DINF";
 constexpr auto VINI_IFACE = "com.ibm.ipzvpd.VINI";
@@ -23,6 +25,7 @@
 constexpr auto RESOLVED_PROP = "Resolved";
 constexpr auto PRESENT_PROP = "Present";
 constexpr auto FUNCTIONAL_PROP = "Functional";
+constexpr auto AVAILABLE_PROP = "Available";
 
 constexpr auto INVENTORY_OBJ_PATH = "/xyz/openbmc_project/inventory";
 constexpr auto POWER_OBJ_PATH = "/org/openbmc/control/power0";