Allow to set a specific thermal profile at start-up time
This commit is contained in:
parent
cb9b5e5c4a
commit
d608d07d89
6 changed files with 20 additions and 4 deletions
|
|
@ -23,6 +23,7 @@ int main(int argc, char ** argv) {
|
||||||
.m1m2_mode = 0,
|
.m1m2_mode = 0,
|
||||||
.touchbar = true,
|
.touchbar = true,
|
||||||
.enable_thermal_profiles_switching = false,
|
.enable_thermal_profiles_switching = false,
|
||||||
|
.default_thermal_profile = -1,
|
||||||
.enable_leds_commands = false,
|
.enable_leds_commands = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,5 @@ controller_bluetooth = true;
|
||||||
dualsense_edge = false;
|
dualsense_edge = false;
|
||||||
swap_y_z = true;
|
swap_y_z = true;
|
||||||
enable_thermal_profiles_switching = true;
|
enable_thermal_profiles_switching = true;
|
||||||
|
default_thermal_profile = -1;
|
||||||
enable_leds_commands = true;
|
enable_leds_commands = true;
|
||||||
1
main.c
1
main.c
|
|
@ -22,6 +22,7 @@ int main(int argc, char ** argv) {
|
||||||
.m1m2_mode = 1,
|
.m1m2_mode = 1,
|
||||||
.touchbar = true,
|
.touchbar = true,
|
||||||
.enable_thermal_profiles_switching = false,
|
.enable_thermal_profiles_switching = false,
|
||||||
|
.default_thermal_profile = -1,
|
||||||
.enable_leds_commands = false,
|
.enable_leds_commands = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
13
rog_ally.c
13
rog_ally.c
|
|
@ -124,7 +124,7 @@ static rc71l_platform_t hw_platform = {
|
||||||
.g = 0x40,
|
.g = 0x40,
|
||||||
.b = 0x40,
|
.b = 0x40,
|
||||||
},
|
},
|
||||||
.current_thermal_profile = 0xFFFFFFFFFFFFFFFF,
|
.current_thermal_profile = 0,
|
||||||
.next_thermal_profile = 0,
|
.next_thermal_profile = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1528,14 +1528,19 @@ input_dev_composite_t rc71l_composite = {
|
||||||
.leds_fn = rc71l_platform_leds,
|
.leds_fn = rc71l_platform_leds,
|
||||||
};
|
};
|
||||||
|
|
||||||
input_dev_composite_t* rog_ally_device_def(const dev_in_settings_t *const settings) {
|
input_dev_composite_t* rog_ally_device_def(const dev_in_settings_t *const conf) {
|
||||||
if (settings->touchbar) {
|
if (conf->touchbar) {
|
||||||
rc71l_composite.dev[rc71l_composite.dev_count++] = &in_touchscreen_dev;
|
rc71l_composite.dev[rc71l_composite.dev_count++] = &in_touchscreen_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((settings->enable_leds_commands) || (settings->enable_thermal_profiles_switching)) {
|
if ((conf->enable_leds_commands) || (conf->enable_thermal_profiles_switching)) {
|
||||||
rc71l_composite.dev[rc71l_composite.dev_count++] = &nkey_dev;
|
rc71l_composite.dev[rc71l_composite.dev_count++] = &nkey_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((conf->enable_thermal_profiles_switching) && (conf->default_thermal_profile >= 0) && (conf->default_thermal_profile < 3)) {
|
||||||
|
hw_platform.current_thermal_profile = 0xFFFFFFFFFFFFFFFF;
|
||||||
|
hw_platform.next_thermal_profile = conf->default_thermal_profile;
|
||||||
|
}
|
||||||
|
|
||||||
return &rc71l_composite;
|
return &rc71l_composite;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,13 @@ void load_in_config(dev_in_settings_t *const out_conf, const char* const filepat
|
||||||
fprintf(stderr, "enable_thermal_profiles_switching (bool) configuration not found. Default value will be used.\n");
|
fprintf(stderr, "enable_thermal_profiles_switching (bool) configuration not found. Default value will be used.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int default_thermal_profile;
|
||||||
|
if (config_lookup_int(&cfg, "default_thermal_profile", &default_thermal_profile) != CONFIG_FALSE) {
|
||||||
|
out_conf->default_thermal_profile = default_thermal_profile;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "default_thermal_profile (int) configuration not found. Default value will be used.\n");
|
||||||
|
}
|
||||||
|
|
||||||
int enable_leds_commands;
|
int enable_leds_commands;
|
||||||
if (config_lookup_bool(&cfg, "enable_leds_commands", &enable_leds_commands) != CONFIG_FALSE) {
|
if (config_lookup_bool(&cfg, "enable_leds_commands", &enable_leds_commands) != CONFIG_FALSE) {
|
||||||
out_conf->enable_leds_commands = enable_leds_commands;
|
out_conf->enable_leds_commands = enable_leds_commands;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ typedef struct dev_in_settings {
|
||||||
uint8_t m1m2_mode;
|
uint8_t m1m2_mode;
|
||||||
bool touchbar;
|
bool touchbar;
|
||||||
bool enable_thermal_profiles_switching;
|
bool enable_thermal_profiles_switching;
|
||||||
|
int default_thermal_profile;
|
||||||
bool enable_leds_commands;
|
bool enable_leds_commands;
|
||||||
} dev_in_settings_t;
|
} dev_in_settings_t;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue