update CPU clock profiles and battery info for lakka-switch

This commit is contained in:
plaidman 2019-05-11 08:24:58 -04:00
parent 4212e5b190
commit 5eb2f7962d
3 changed files with 40 additions and 36 deletions

View File

@ -1089,7 +1089,11 @@ static bool frontend_unix_powerstate_check_acpi_sysfs(
{ {
const char *node = retro_dirent_get_name(entry); const char *node = retro_dirent_get_name(entry);
#ifdef HAVE_LAKKA_SWITCH
if (node && strstr(node, "max170xx_battery"))
#else
if (node && strstr(node, "BAT")) if (node && strstr(node, "BAT"))
#endif
check_proc_acpi_sysfs_battery(node, check_proc_acpi_sysfs_battery(node,
&have_battery, &charging, seconds, percent); &have_battery, &charging, seconds, percent);
} }

View File

@ -2731,7 +2731,7 @@ static int action_ok_set_switch_cpu_profile(const char *path,
char command[PATH_MAX_LENGTH] = {0}; char command[PATH_MAX_LENGTH] = {0};
#ifdef HAVE_LAKKA_SWITCH #ifdef HAVE_LAKKA_SWITCH
snprintf(command, sizeof(command), "cpu-profile set %s", profile_name); snprintf(command, sizeof(command), "cpu-profile set '%s'", profile_name);
system(command); system(command);
snprintf(command, sizeof(command), "Current profile set to %s", profile_name); snprintf(command, sizeof(command), "Current profile set to %s", profile_name);
@ -2765,7 +2765,7 @@ static int action_ok_set_switch_gpu_profile(const char *path,
char command[PATH_MAX_LENGTH] = {0}; char command[PATH_MAX_LENGTH] = {0};
snprintf(command, sizeof(command), "gpu-profile set %s", profile_name); snprintf(command, sizeof(command), "gpu-profile set '%s'", profile_name);
system(command); system(command);

View File

@ -20,23 +20,21 @@
#if defined(HAVE_LAKKA_SWITCH) || defined(HAVE_LIBNX) #if defined(HAVE_LAKKA_SWITCH) || defined(HAVE_LIBNX)
#ifdef HAVE_LAKKA_SWITCH #ifdef HAVE_LAKKA_SWITCH
static char *SWITCH_GPU_PROFILES[] = { static char *SWITCH_GPU_PROFILES[] = {
"docked-overclock-3", "Docked Stock +2",
"docked-overclock-2", "Docked Stock +1",
"docked-overclock-1", "Docked Stock Mode",
"docked", "Handheld Boost +3",
"non-docked-overclock-5", "Handheld Boost +2",
"non-docked-overclock-4", "Handheld Boost +1",
"non-docked-overclock-3", "Handheld Boost Mode",
"non-docked-overclock-2", "Handheld Stock +1",
"non-docked-overclock-1", "Handheld Stock Mode",
"non-docked", "Powersaving +2",
"non-docked-underclock-1", "Powersaving +1",
"non-docked-underclock-2", "Powersaving Mode",
"non-docked-underclock-3",
}; };
static char *SWITCH_GPU_SPEEDS[] = { static char *SWITCH_GPU_SPEEDS[] = {
"998 Mhz",
"921 Mhz", "921 Mhz",
"844 Mhz", "844 Mhz",
"768 Mhz", "768 Mhz",
@ -48,7 +46,8 @@ static char *SWITCH_GPU_SPEEDS[] = {
"307 Mhz", "307 Mhz",
"230 Mhz", "230 Mhz",
"153 Mhz", "153 Mhz",
"76 Mhz"}; "76 Mhz"
};
static int SWITCH_BRIGHTNESS[] = { static int SWITCH_BRIGHTNESS[] = {
10, 10,
@ -65,11 +64,14 @@ static int SWITCH_BRIGHTNESS[] = {
static char *SWITCH_CPU_PROFILES[] = { static char *SWITCH_CPU_PROFILES[] = {
#ifndef HAVE_LIBNX #ifndef HAVE_LIBNX
"overclock-4", // for switch-lakka - same as LIBNX but only by coincidence
"overclock-3", "Maximum Performance",
"overclock-2", "High Performance",
"overclock-1", "Boost Performance",
"default", "Stock Performance",
"Powersaving Mode 1",
"Powersaving Mode 2",
"Powersaving Mode 3",
#else #else
"Maximum Performance", "Maximum Performance",
"High Performance", "High Performance",
@ -86,11 +88,14 @@ static char *SWITCH_CPU_PROFILES[] = {
static char *SWITCH_CPU_SPEEDS[] = { static char *SWITCH_CPU_SPEEDS[] = {
#ifndef HAVE_LIBNX #ifndef HAVE_LIBNX
"1912 MHz", // for switch-lakka - same as LIBNX but only by coincidence
"1734 MHz", "1785 MHz",
"1530 MHz", "1581 MHz",
"1224 MHz", "1224 MHz",
"1020 MHz" "1020 MHz",
"918 MHz",
"816 MHz",
"714 MHz"
#else #else
"1785 MHz", "1785 MHz",
"1581 MHz", "1581 MHz",
@ -102,14 +107,9 @@ static char *SWITCH_CPU_SPEEDS[] = {
#endif #endif
}; };
#ifdef HAVE_LIBNX
// not used in switch-lakka
static unsigned SWITCH_CPU_SPEEDS_VALUES[] = { static unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
#ifndef HAVE_LIBNX
1912000000,
1734000000,
1530000000,
1224000000,
1020000000
#else
1785000000, 1785000000,
1581000000, 1581000000,
1224000000, 1224000000,
@ -117,8 +117,8 @@ static unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
918000000, 918000000,
816000000, 816000000,
714000000 714000000
#endif
}; };
#endif
#endif #endif