diff --git a/lenovo_fix.py b/lenovo_fix.py index ce65310..aa672f9 100755 --- a/lenovo_fix.py +++ b/lenovo_fix.py @@ -548,6 +548,15 @@ def get_config_write_time(): return None +def reload_config(): + config = load_config() + regs = calc_reg_values(get_cpu_platform_info(), config) + undervolt(config) + set_icc_max(config) + log('[I] Reloading changes.') + return config, regs + + def power_thread(config, regs, exit_event): try: mchbar_mmio = MMIO(0xFED159A0, 8) @@ -570,8 +579,7 @@ def power_thread(config, regs, exit_event): config_write_time = get_config_write_time() if config_write_time and last_config_write_time != config_write_time: last_config_write_time = config_write_time - config = load_config() - log('[I] Reloading changes.') + config, regs = reload_config() # switch back to sysfs polling if power['method'] == 'polling':