Refactor: move get pmbus access type to utility

The function to get the pmbus access type is common, move it to utility.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I26e7da044c88c1efba141349ee4c18b24cdef81f
diff --git a/utility.hpp b/utility.hpp
index 78b9425..f6c40d8 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "pmbus.hpp"
+
 #include <nlohmann/json.hpp>
 #include <phosphor-logging/elog.hpp>
 #include <phosphor-logging/log.hpp>
@@ -114,6 +116,15 @@
  */
 nlohmann::json loadJSONFromFile(const char* path);
 
+/**
+ * Get PmBus access type from the json config
+ *
+ * @param[in] json - The json object
+ *
+ * @return The pmbus access type
+ */
+phosphor::pmbus::Type getPMBusAccessType(const nlohmann::json& json);
+
 } // namespace util
 } // namespace power
 } // namespace phosphor