summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2018-05-19 06:06:03 -0500
committerRaptor Engineering Development Team <support@raptorengineering.com>2018-05-19 06:06:03 -0500
commitc9eb5cb08f51c4563e018422a1a6b87ca3d2d262 (patch)
tree738f1757d675c2aa6d6ab7500c38571024bb2950
parent6323218846f9db94874ed127acd8afeac993a481 (diff)
downloadphosphor-hwmon-05-18-2018.tar.gz
phosphor-hwmon-05-18-2018.zip
Add frequency capability to hwmon publisherHEADmaster05-18-2018
-rw-r--r--hwmon.hpp7
-rw-r--r--sensorset.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/hwmon.hpp b/hwmon.hpp
index 18197d9..77e3611 100644
--- a/hwmon.hpp
+++ b/hwmon.hpp
@@ -33,6 +33,7 @@ static constexpr auto ccurr = "curr";
static constexpr auto cenergy = "energy";
static constexpr auto cpower = "power";
static constexpr auto cpwm = "pwm";
+static constexpr auto cfreq = "freq";
static const std::string fan = cfan;
@@ -42,6 +43,7 @@ static const std::string curr = ccurr;
static const std::string energy = cenergy;
static const std::string power = cpower;
static const std::string pwm = cpwm;
+static const std::string freq = cfreq;
}
static constexpr auto typeAttrMap =
@@ -80,6 +82,11 @@ static constexpr auto typeAttrMap =
ValueInterface::Unit::Watts,
-6,
"power"),
+ std::make_tuple(
+ hwmon::type::cfreq,
+ ValueInterface::Unit::MHz,
+ 0,
+ "frequency"),
};
inline auto getHwmonType(decltype(typeAttrMap)::const_reference attrs)
diff --git a/sensorset.cpp b/sensorset.cpp
index 2952775..6ccf714 100644
--- a/sensorset.cpp
+++ b/sensorset.cpp
@@ -22,7 +22,7 @@
// TODO: Issue#2 - STL regex generates really bloated code. Use POSIX regex
// interfaces instead.
static const std::regex sensors_regex =
- std::regex("^(fan|in|temp|power|energy|curr)([0-9]+)_([a-z]*)",
+ std::regex("^(fan|in|temp|power|energy|curr|freq)([0-9]+)_([a-z]*)",
std::regex::extended);
static const auto sensor_regex_match_count = 4;
OpenPOWER on IntegriCloud