Update clearFaults and use for power and presence

If the power supply changes to the powered on state, or changes to
present, call the clearFaults() function instead of individually
clearing the variables.

Ensure powerOnFault is in the clearFaults() list.

Change-Id: I02ca222c4a5ddc8041c6796f0aba23bbcf30ff8f
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/power-supply/power_supply.cpp b/power-supply/power_supply.cpp
index 0952cb9..cdb3a73 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -155,13 +155,7 @@
 
         if (present)
         {
-            readFailLogged = false;
-            vinUVFault = false;
-            inputFault = false;
-            outputOCFault = false;
-            outputOVFault = false;
-            fanFault = false;
-            temperatureFault = false;
+            clearFaults();
         }
     }
 
@@ -196,14 +190,7 @@
         // and start the power on timer when the state changes to 1.
         if (state)
         {
-            readFailLogged = false;
-            vinUVFault = false;
-            inputFault = false;
-            powerOnFault = 0;
-            outputOCFault = false;
-            outputOVFault = false;
-            fanFault = false;
-            temperatureFault = false;
+            clearFaults();
             powerOnTimer.start(powerOnInterval, Timer::TimerType::oneshot);
         }
         else
@@ -481,7 +468,15 @@
 
 void PowerSupply::clearFaults()
 {
-    //TODO - Clear faults at pre-poweron. openbmc/openbmc#1736
+    readFailLogged = false;
+    vinUVFault = false;
+    inputFault = false;
+    powerOnFault = 0;
+    outputOCFault = false;
+    outputOVFault = false;
+    fanFault = false;
+    temperatureFault = false;
+
     return;
 }