Add clear faults support
Add support to send the clear-logged-faults command to
the UCD90160 chip. This is a manufacturer specific command.
The PMBus standard clear-faults command is done automatically
by the device driver every time a PMBus sysfs file is read.
Change-Id: I6a9f670502ce1e1b4ffbaab63db335daa0865f46
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/power-sequencer/ucd90160.cpp b/power-sequencer/ucd90160.cpp
index 739cff2..7a69a64 100644
--- a/power-sequencer/ucd90160.cpp
+++ b/power-sequencer/ucd90160.cpp
@@ -30,6 +30,8 @@
using namespace std::string_literals;
+const auto CLEAR_LOGGED_FAULTS = "clear_logged_faults"s;
+
const auto DEVICE_NAME = "UCD90160"s;
const auto DRIVER_NAME = "ucd9000"s;
@@ -94,7 +96,19 @@
void UCD90160::clearFaults()
{
-
+ try
+ {
+ interface.write(CLEAR_LOGGED_FAULTS, 1, Type::Base);
+ }
+ catch (WriteFailure& e)
+ {
+ if (!accessError)
+ {
+ log<level::ERR>("UCD90160 clear logged faults command failed");
+ commit<WriteFailure>();
+ accessError = true;
+ }
+ }
}
bool UCD90160::checkVOUTFaults()