From 335687f8d11626225b7a1b6d38e75af9f2da6282 Mon Sep 17 00:00:00 2001 From: Ondrej Čerman Date: Tue, 6 Nov 2018 14:52:59 +0100 Subject: devices/sensors - hwmon: added support for cpu_vid --- modules/devices/sensors.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/devices') 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); -- cgit v1.2.3