@@ -127,6 +127,13 @@ static ssize_t pending_reboot_show(struct kobject *kobj, struct kobj_attribute *
127127
128128static struct kobj_attribute pending_reboot = __ATTR_RO (pending_reboot );
129129
130+ static ssize_t requires_fan_curve_show (struct kobject * kobj , struct kobj_attribute * attr , char * buf )
131+ {
132+ return sysfs_emit (buf , "%d\n" , asus_armoury .requires_fan_curve );
133+ }
134+
135+ static struct kobj_attribute requires_fan_curve = __ATTR_RO (requires_fan_curve );
136+
130137static bool asus_bios_requires_reboot (struct kobj_attribute * attr )
131138{
132139 return !strcmp (attr -> attr .name , "gpu_mux_mode" ) ||
@@ -914,6 +921,12 @@ static int asus_fw_attr_add(void)
914921 goto err_destroy_kset ;
915922 }
916923
924+ err = sysfs_create_file (& asus_armoury .fw_attr_kset -> kobj , & requires_fan_curve .attr );
925+ if (err ) {
926+ pr_err ("Failed to create requires_fan_curve attribute\n" );
927+ goto err_destroy_kset ;
928+ }
929+
917930 asus_armoury .mini_led_dev_id = 0 ;
918931 if (armoury_has_devstate (ASUS_WMI_DEVID_MINI_LED_MODE ))
919932 asus_armoury .mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE ;
@@ -987,6 +1000,7 @@ static int asus_fw_attr_add(void)
9871000 if (asus_armoury .mini_led_dev_id )
9881001 sysfs_remove_group (& asus_armoury .fw_attr_kset -> kobj , & mini_led_mode_attr_group );
9891002err_remove_file :
1003+ sysfs_remove_file (& asus_armoury .fw_attr_kset -> kobj , & requires_fan_curve .attr );
9901004 sysfs_remove_file (& asus_armoury .fw_attr_kset -> kobj , & pending_reboot .attr );
9911005err_destroy_kset :
9921006 kset_unregister (asus_armoury .fw_attr_kset );
@@ -1161,6 +1175,7 @@ static void __exit asus_fw_exit(void)
11611175 if (asus_armoury .mini_led_dev_id )
11621176 sysfs_remove_group (& asus_armoury .fw_attr_kset -> kobj , & mini_led_mode_attr_group );
11631177
1178+ sysfs_remove_file (& asus_armoury .fw_attr_kset -> kobj , & requires_fan_curve .attr );
11641179 sysfs_remove_file (& asus_armoury .fw_attr_kset -> kobj , & pending_reboot .attr );
11651180 kset_unregister (asus_armoury .fw_attr_kset );
11661181 device_destroy (& firmware_attributes_class , MKDEV (0 , 0 ));
0 commit comments