electrified / asus-wmi-sensors

Linux HWMON (lmsensors) sensors driver for various ASUS Ryzen and Threadripper motherboards
GNU General Public License v2.0
252 stars 30 forks source link

Fixes for CentOS-7 #29

Open dd1dd1 opened 5 years ago

dd1dd1 commented 5 years ago

Hi, your driver works just fine with the el7 kernel 3.10.0-957.21.3.el7.x86_64 on ASUS PRIME X399-A fw 1002, but it needs the following changes:

@@ -90,10 +90,10 @@ static enum hwmon_sensor_types asus_data_types[] = {

 static u32 hwmon_attributes[] = {
    [hwmon_chip] = HWMON_C_REGISTER_TZ,
-   [hwmon_temp] = HWMON_T_INPUT | HWMON_T_LABEL,
-   [hwmon_in] = HWMON_I_INPUT | HWMON_I_LABEL,
-   [hwmon_curr] = HWMON_C_INPUT | HWMON_C_LABEL,
-   [hwmon_fan] = HWMON_F_INPUT | HWMON_F_LABEL,
+   [hwmon_temp] = HWMON_T_INPUT, // | HWMON_T_LABEL,
+   [hwmon_in] = HWMON_I_INPUT, // | HWMON_I_LABEL,
+   [hwmon_curr] = HWMON_C_INPUT, // | HWMON_C_LABEL,
+   [hwmon_fan] = HWMON_F_INPUT, // | HWMON_F_LABEL,
 };

 struct asus_wmi_sensor_info {
@@ -394,7 +394,7 @@ static int asus_wmi_hwmon_add_chan_info(struct hwmon_channel_info *asus_wmi_hwmo
 static const struct hwmon_ops asus_wmi_hwmon_ops = {
    .is_visible = asus_wmi_hwmon_is_visible,
    .read = asus_wmi_hwmon_read,
-   .read_string = asus_wmi_hwmon_read_string,
+   //.read_string = asus_wmi_hwmon_read_string,
 };

 static struct hwmon_chip_info asus_wmi_chip_info = {

Please consider adding this to your sources plus a note in the README file stating that your driver works on CentOS-7. (3.10 kernels vs 4.x as you say now).

K.O.

electrified commented 5 years ago

Centos must have backported the WMI interface, as in mainline kernels it isn't present before 4.12.

https://elixir.bootlin.com/linux/latest/source/include/linux/wmi.h

I will have a look at what the implications of removing the labels from the attributes is, I guess it could be put within a conditional.