Skip to content

Commit 35b9539

Browse files
committed
Merge branch 'tf_new_fan_control_set_fans_auto' into 'master'
Tf new fan control set fans auto See merge request tuxedocomputers/development/packages/tuxedo-keyboard!32
2 parents 0ebd4a4 + ab675b1 commit 35b9539

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/tuxedo_io/tuxedo_io.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,21 @@ static u32 uw_set_fan_auto(void)
407407
u8 mode_data;
408408

409409
if (has_universal_ec_fan_control() == 1) {
410+
u16 addr_use_custom_fan_table_0 = 0x07c5; // use different tables for both fans (0x0f00-0x0f2f and 0x0f30-0x0f5f respectivly)
411+
u16 addr_use_custom_fan_table_1 = 0x07c6; // enable 0x0fxx fantables
412+
u8 offset_use_custom_fan_table_0 = 7;
413+
u8 offset_use_custom_fan_table_1 = 2;
414+
u8 value_use_custom_fan_table_0;
415+
u8 value_use_custom_fan_table_1;
416+
uniwill_read_ec_ram(addr_use_custom_fan_table_1, &value_use_custom_fan_table_1);
417+
if ((value_use_custom_fan_table_1 >> offset_use_custom_fan_table_1) & 1) {
418+
uniwill_write_ec_ram_with_retry(addr_use_custom_fan_table_1, value_use_custom_fan_table_1 - (1 << offset_use_custom_fan_table_1), 3);
419+
}
420+
uniwill_read_ec_ram(addr_use_custom_fan_table_0, &value_use_custom_fan_table_0);
421+
if ((value_use_custom_fan_table_0 >> offset_use_custom_fan_table_0) & 1) {
422+
uniwill_write_ec_ram_with_retry(addr_use_custom_fan_table_0, value_use_custom_fan_table_0 - (1 << offset_use_custom_fan_table_0), 3);
423+
}
424+
fans_initialized = false;
410425
}
411426
else {
412427
// Get current mode

0 commit comments

Comments
 (0)