Add PMBus device hwmon debug access type
This can be used to find a file in:
/sys/kernel/debug/pmbus/hwmonX/<device type>
For example: /sys/kernel/debug/pmbus/hwmon3/cffps1
Change-Id: Ifd9ae3a58f9097c89ebf80e3e19a180962968f0f
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/pmbus.cpp b/pmbus.cpp
index b68f6fb..6ec4965 100644
--- a/pmbus.cpp
+++ b/pmbus.cpp
@@ -62,9 +62,14 @@
return debugPath / "pmbus" / hwmonDir;
break;
case Type::DeviceDebug:
+ {
auto dir = driverName + "." + std::to_string(instance);
return debugPath / dir;
break;
+ }
+ case Type::HwmonDeviceDebug:
+ return debugPath / "pmbus" / hwmonDir / getDeviceName();
+ break;
}
}
diff --git a/pmbus.hpp b/pmbus.hpp
index 9ab57c0..89274dc 100644
--- a/pmbus.hpp
+++ b/pmbus.hpp
@@ -88,17 +88,15 @@
}
/**
- * If the access should be done in the base
- * device directory, the hwmon directory, the
- * pmbus debug directory, or the device debug
- * directory.
+ * Where the access should be done
*/
enum class Type
{
- Base,
- Hwmon,
- Debug,
- DeviceDebug
+ Base, // base device directory
+ Hwmon, // hwmon directory
+ Debug, // pmbus debug directory
+ DeviceDebug, // device debug directory
+ HwmonDeviceDebug // hwmon device debug directory
};
/**