aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorOndrej Čerman <ondrej.cerman@gmail.com>2018-11-06 14:52:59 +0100
committerLeandro A. F. Pereira <leandro@hardinfo.org>2018-11-06 07:18:08 -0800
commit335687f8d11626225b7a1b6d38e75af9f2da6282 (patch)
treee0f6f4e659f01011a7120a40121a131b28b7d308 /modules
parent01da9b5465d1dd825aad40e5cba257321243dda0 (diff)
devices/sensors - hwmon: added support for cpu_vid
Diffstat (limited to 'modules')
-rw-r--r--modules/devices/sensors.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/devices/sensors.c b/modules/devices/sensors.c
index e66aac67..ab34b74b 100644
--- a/modules/devices/sensors.c
+++ b/modules/devices/sensors.c
@@ -235,6 +235,15 @@ static const struct HwmonSensor hwmon_sensors[] = {
1000.0,
0
},
+ {
+ "Voltage",
+ "%s/cpu%d_vid",
+ NULL,
+ "cpu%d_vid",
+ "V",
+ 1000.0,
+ 0
+ },
{ }
};
@@ -244,6 +253,9 @@ static gboolean read_raw_hwmon_value(gchar *path_hwmon, const gchar *item_path_f
gchar *full_path;
gboolean file_result;
+ if (item_path_format == NULL)
+ return FALSE;
+
full_path = g_strdup_printf(item_path_format, path_hwmon, item_id);
file_result = g_file_get_contents(full_path, result, NULL, NULL);