@@ -360,6 +360,16 @@ static u32 uw_set_fan(u32 fan_index, u8 fan_speed)
360
360
else
361
361
return - EINVAL ;
362
362
363
+ if (fan_speed == 0 ) {
364
+ // Avoid hard coded EC behaviour: Setting fan speed = 0x00 spins the fan up
365
+ // to 0x3c (30%) for 3 minutes before going to 0x00. Setting fan speed = 1
366
+ // also causes the fan to stop since on 2020 or later TF devices the
367
+ // microcontroller in the fan itself is intelligent enough to not try to
368
+ // start up the motor when the speed is to slow. Older devices don't use
369
+ // this fan controll anyway, but the else case below.
370
+ fan_speed = 1 ;
371
+ }
372
+
363
373
uniwill_write_ec_ram (addr_for_fan , fan_speed & 0xff );
364
374
}
365
375
else { // old workaround using full fan mode
@@ -576,23 +586,25 @@ static long uniwill_ioctl_interface(struct file *file, unsigned int cmd, unsigne
576
586
copy_result = copy_to_user ((void * ) arg , & result , sizeof (result ));
577
587
break ;
578
588
case R_UW_FANS_OFF_AVAILABLE :
579
- result = has_universal_ec_fan_control ();
589
+ /* result = has_universal_ec_fan_control();
580
590
if (result == 1) {
581
591
result = 0;
582
592
}
583
593
else if (result == 0) {
584
594
result = 1;
585
- }
595
+ }*/
596
+ result = 1 ;
586
597
copy_result = copy_to_user ((void * ) arg , & result , sizeof (result ));
587
598
break ;
588
599
case R_UW_FANS_MIN_SPEED :
589
- result = has_universal_ec_fan_control ();
600
+ /* result = has_universal_ec_fan_control();
590
601
if (result == 1) {
591
602
result = 20;
592
603
}
593
604
else if (result == 0) {
594
605
result = 0;
595
- }
606
+ }*/
607
+ result = 20 ;
596
608
copy_result = copy_to_user ((void * ) arg , & result , sizeof (result ));
597
609
break ;
598
610
case R_UW_TDP0 :
0 commit comments