diff --git a/pmbus.cpp b/pmbus.cpp
index b525bd9..95e3bbb 100644
--- a/pmbus.cpp
+++ b/pmbus.cpp
@@ -53,7 +53,7 @@
     switch (type)
     {
         default:
-            /* fall through */
+        /* fall through */
         case Type::Base:
             return basePath;
             break;
@@ -111,7 +111,7 @@
         auto rc = errno;
 
         log<level::ERR>("Failed to read sysfs file",
-                entry("FILENAME=%s", path.c_str()));
+                        entry("FILENAME=%s", path.c_str()));
 
         elog<ReadFailure>(xyz::openbmc_project::Sensor::Device::
                           ReadFailure::CALLOUT_ERRNO(rc),
@@ -123,6 +123,38 @@
     return value != 0;
 }
 
+uint64_t PMBus::read(const std::string& name, Type type)
+{
+    uint64_t data = 0;
+    std::ifstream file;
+    auto path = getPath(type);
+    path /= name;
+
+    file.exceptions(std::ifstream::failbit |
+                    std::ifstream::badbit |
+                    std::ifstream::eofbit);
+
+    try
+    {
+        file.open(path);
+        file >> std::hex >> data;
+    }
+    catch (std::exception& e)
+    {
+        auto rc = errno;
+        log<level::ERR>("Failed to read sysfs file",
+                        entry("FILENAME=%s", path.c_str()));
+
+        using metadata = xyz::openbmc_project::Sensor::Device::ReadFailure;
+
+        elog<ReadFailure>(metadata::CALLOUT_ERRNO(rc),
+                          metadata::CALLOUT_DEVICE_PATH(
+                                  fs::canonical(basePath).c_str()));
+    }
+
+    return data;
+}
+
 void PMBus::write(const std::string& name, int value, Type type)
 {
     std::ofstream file;
@@ -144,7 +176,7 @@
         auto rc = errno;
 
         log<level::ERR>("Failed to write sysfs file",
-                entry("FILENAME=%s", path.c_str()));
+                        entry("FILENAME=%s", path.c_str()));
 
         elog<WriteFailure>(xyz::openbmc_project::Control::Device::
                            WriteFailure::CALLOUT_ERRNO(rc),
@@ -163,7 +195,7 @@
     for (auto& f : fs::directory_iterator(path))
     {
         if ((f.path().filename().string().find("hwmon") !=
-            std::string::npos) &&
+             std::string::npos) &&
             (fs::is_directory(f.path())))
         {
             hwmonDir = f.path().filename();
diff --git a/pmbus.hpp b/pmbus.hpp
index 4946829..82e2ffc 100644
--- a/pmbus.hpp
+++ b/pmbus.hpp
@@ -61,7 +61,7 @@
          *
          * @param[in] name - path concatenated to
          *                   basePath to read
-         * @param[in] type - one of Base, Hwmon, or Debug
+         * @param[in] type - one of Base, Hwmon, or Debug (path type)
          *
          * @return bool - false if result was 0, else true
          */
@@ -75,13 +75,22 @@
          * @param[in] name - path concatenated to
          *                   basePath to read
          * @param[in] page - page number
-         * @param[in] type - one of Base, Hwmon, or Debug
+         * @param[in] type - one of Base, Hwmon, or Debug (path type)
          *
          * @return bool - false if result was 0, else true
          */
         bool readBitInPage(const std::string& name,
                            size_t page,
                            Type type);
+        /**
+         * Read byte(s) from file in sysfs.
+         *
+         * @param[in] name   - path concatenated to basePath to read
+         * @param[in] type   - one of Base, Hwmon, or Debug (path type)
+         *
+         * @return uint64_t - Up to 8 bytes of data read from file.
+         */
+        uint64_t read(const std::string& name, Type type);
 
         /**
          * Writes an integer value to the file, therefore doing
@@ -90,7 +99,7 @@
          * @param[in] name - path concatenated to
          *                   basePath to write
          * @param[in] value - the value to write
-         * @param[in] type - one of Base, Hwmon, or Debug
+         * @param[in] type - one of Base, Hwmon, or Debug (path type)
          */
         void write(const std::string& name, int value, Type type);
 
@@ -127,7 +136,7 @@
         /**
          * Returns the path to use for the passed in type.
          *
-         * @param[in] type - one of Base, Hwmon, or Debug
+         * @param[in] type - one of Base, Hwmon, or Debug (path type)
          *
          * @return fs::path - the full path to Base, Hwmon, or Debug path
          */
