forked from len0rd/rockbox
iBasso DX50/DX90: User selectable freq scaling governor.
Depends on http://gerrit.rockbox.org/r/#/c/1043/. This patch adds a new setting in Settings -> General -> System: Freq Scaling Governor Usable in Quickscreen and Shortcuts. Possible settings are: - Conservative: Slow frequency switching. - Ondemand or Interactive: Fast frequency switching. - Powersave: Allways lowest frequency. - Performance: Allways highest frequency. German translation provided. This may be genric for Android kernel based devices but is only enabled for iBasso Devices. Other maintainers may choose do adopt this. Change-Id: I10296f5be9586ad3a409105db0cd03682a30e9c1
This commit is contained in:
parent
dbabd0d9c3
commit
040306a716
10 changed files with 232 additions and 3 deletions
|
|
@ -33,6 +33,7 @@
|
||||||
# - Kaspar Rothenfußer
|
# - Kaspar Rothenfußer
|
||||||
# - Johannes Linke
|
# - Johannes Linke
|
||||||
# - Kai Posadowsky
|
# - Kai Posadowsky
|
||||||
|
# - Udo Schläpfer
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SET_BOOL_YES
|
id: LANG_SET_BOOL_YES
|
||||||
desc: bool true representation
|
desc: bool true representation
|
||||||
|
|
@ -13054,3 +13055,23 @@
|
||||||
*: "Beschränke automatischen Verzeichniswechsel"
|
*: "Beschränke automatischen Verzeichniswechsel"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_IBASSO_FREQ_SCALING_GOVERNOR
|
||||||
|
desc: in Settings -> General -> System -> Freq Scaling Governor
|
||||||
|
user: core
|
||||||
|
<source>
|
||||||
|
*: none
|
||||||
|
ibassodx50: "Freq Scaling Governor"
|
||||||
|
ibassodx90: "Freq Scaling Governor"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: none
|
||||||
|
ibassodx50: "Freq Scaling Governor"
|
||||||
|
ibassodx90: "Freq Scaling Governor"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: none
|
||||||
|
ibassodx50: "Freq Scaling Governor"
|
||||||
|
ibassodx90: "Freq Scaling Governor"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
|
|
||||||
|
|
@ -13373,3 +13373,23 @@
|
||||||
swcodec: "Dry / Wet Mix"
|
swcodec: "Dry / Wet Mix"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_IBASSO_FREQ_SCALING_GOVERNOR
|
||||||
|
desc: in Settings -> General -> System -> Freq Scaling Governor
|
||||||
|
user: core
|
||||||
|
<source>
|
||||||
|
*: none
|
||||||
|
ibassodx50: "Freq Scaling Governor"
|
||||||
|
ibassodx90: "Freq Scaling Governor"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: none
|
||||||
|
ibassodx50: "Freq Scaling Governor"
|
||||||
|
ibassodx90: "Freq Scaling Governor"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: none
|
||||||
|
ibassodx50: "Freq Scaling Governor"
|
||||||
|
ibassodx90: "Freq Scaling Governor"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,10 @@
|
||||||
#endif
|
#endif
|
||||||
#include "folder_select.h"
|
#include "folder_select.h"
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
#include "governor-ibasso.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/***********************************/
|
/***********************************/
|
||||||
/* TAGCACHE MENU */
|
/* TAGCACHE MENU */
|
||||||
#ifdef HAVE_TAGCACHE
|
#ifdef HAVE_TAGCACHE
|
||||||
|
|
@ -325,6 +329,10 @@ MENUITEM_SETTING(touchpad_deadzone, &global_settings.touchpad_deadzone, NULL);
|
||||||
MENUITEM_SETTING(shortcuts_replaces_quickscreen, &global_settings.shortcuts_replaces_qs, NULL);
|
MENUITEM_SETTING(shortcuts_replaces_quickscreen, &global_settings.shortcuts_replaces_qs, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
MENUITEM_SETTING(governor, &global_settings.governor, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
||||||
0, Icon_System_menu,
|
0, Icon_System_menu,
|
||||||
#if (BATTERY_CAPACITY_INC > 0) || (BATTERY_TYPES_COUNT > 1)
|
#if (BATTERY_CAPACITY_INC > 0) || (BATTERY_TYPES_COUNT > 1)
|
||||||
|
|
@ -377,6 +385,10 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
||||||
#if defined(USB_ENABLE_STORAGE) && defined(HAVE_MULTIDRIVE)
|
#if defined(USB_ENABLE_STORAGE) && defined(HAVE_MULTIDRIVE)
|
||||||
&usb_skip_first_drive,
|
&usb_skip_first_drive,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
&governor,
|
||||||
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
/* SYSTEM MENU */
|
/* SYSTEM MENU */
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,11 @@ struct system_status global_status;
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
#include "governor-ibasso.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
long lasttime = 0;
|
long lasttime = 0;
|
||||||
|
|
||||||
/** NVRAM stuff, if the target doesnt have NVRAM it is saved in ROCKBOX_DIR /nvram.bin **/
|
/** NVRAM stuff, if the target doesnt have NVRAM it is saved in ROCKBOX_DIR /nvram.bin **/
|
||||||
|
|
@ -1081,6 +1086,10 @@ void settings_apply(bool read_disk)
|
||||||
memcpy(&calibration_parameters, &global_settings.ts_calibration_data, sizeof(struct touchscreen_parameter));
|
memcpy(&calibration_parameters, &global_settings.ts_calibration_data, sizeof(struct touchscreen_parameter));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
ibasso_set_governor(global_settings.governor);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This should stay last */
|
/* This should stay last */
|
||||||
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
||||||
enc_global_settings_apply();
|
enc_global_settings_apply();
|
||||||
|
|
|
||||||
|
|
@ -850,6 +850,10 @@ struct user_settings
|
||||||
int pbe_precut;
|
int pbe_precut;
|
||||||
|
|
||||||
int afr_enabled;
|
int afr_enabled;
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
int governor;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/** global variables **/
|
/** global variables **/
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,10 @@
|
||||||
#include "onplay.h"
|
#include "onplay.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
#include "governor-ibasso.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
|
#define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
|
||||||
/** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
|
/** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
|
||||||
and you may need to update it if you edit this file */
|
and you may need to update it if you edit this file */
|
||||||
|
|
@ -2193,6 +2197,22 @@ const struct settings_list settings[] = {
|
||||||
NULL, "root menu order",
|
NULL, "root menu order",
|
||||||
root_menu_load_from_cfg, root_menu_write_to_cfg,
|
root_menu_load_from_cfg, root_menu_write_to_cfg,
|
||||||
root_menu_is_changed, root_menu_set_default),
|
root_menu_is_changed, root_menu_set_default),
|
||||||
|
|
||||||
|
#if defined(DX50) || defined(DX90)
|
||||||
|
CHOICE_SETTING(0,
|
||||||
|
governor,
|
||||||
|
LANG_IBASSO_FREQ_SCALING_GOVERNOR,
|
||||||
|
GOVERNOR_POWERSAVE,
|
||||||
|
"freq scaling governor",
|
||||||
|
"conservative,ondemand,interactive,powersave,performance",
|
||||||
|
ibasso_set_governor,
|
||||||
|
5,
|
||||||
|
"Conservative",
|
||||||
|
"Ondemand",
|
||||||
|
"Interactive",
|
||||||
|
"Powersave",
|
||||||
|
"Performance"),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
||||||
|
|
|
||||||
|
|
@ -1841,6 +1841,7 @@ target/hosted/ibasso/button-ibasso.c
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
target/hosted/ibasso/debug-ibasso.c
|
target/hosted/ibasso/debug-ibasso.c
|
||||||
#endif
|
#endif
|
||||||
|
target/hosted/ibasso/governor-ibasso.c
|
||||||
target/hosted/ibasso/hostfs-ibasso.c
|
target/hosted/ibasso/hostfs-ibasso.c
|
||||||
target/hosted/ibasso/lcd-ibasso.c
|
target/hosted/ibasso/lcd-ibasso.c
|
||||||
target/hosted/ibasso/pcm-ibasso.c
|
target/hosted/ibasso/pcm-ibasso.c
|
||||||
|
|
|
||||||
90
firmware/target/hosted/ibasso/governor-ibasso.c
Normal file
90
firmware/target/hosted/ibasso/governor-ibasso.c
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 by Ilia Sergachev: Initial Rockbox port to iBasso DX50
|
||||||
|
* Copyright (C) 2014 by Mario Basister: iBasso DX90 port
|
||||||
|
* Copyright (C) 2014 by Simon Rothen: Initial Rockbox repository submission, additional features
|
||||||
|
* Copyright (C) 2014 by Udo Schläpfer: Code clean up, additional features
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "cpufreq-linux.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
#include "debug-ibasso.h"
|
||||||
|
#include "governor-ibasso.h"
|
||||||
|
#include "sysfs-ibasso.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* Default governor at boot. */
|
||||||
|
static int _last_governor = GOVERNOR_INTERACTIVE;
|
||||||
|
|
||||||
|
|
||||||
|
void ibasso_set_governor(int governor)
|
||||||
|
{
|
||||||
|
DEBUGF("DEBUG %s: _last_governor: %d, governor: %d.", __func__, _last_governor, governor);
|
||||||
|
|
||||||
|
if(_last_governor != governor)
|
||||||
|
{
|
||||||
|
switch(governor)
|
||||||
|
{
|
||||||
|
case GOVERNOR_CONSERVATIVE:
|
||||||
|
{
|
||||||
|
_last_governor = governor;
|
||||||
|
cpufreq_set_governor("conservative", CPUFREQ_ALL_CPUS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case GOVERNOR_ONDEMAND:
|
||||||
|
{
|
||||||
|
_last_governor = governor;
|
||||||
|
cpufreq_set_governor("ondemand", CPUFREQ_ALL_CPUS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case GOVERNOR_POWERSAVE:
|
||||||
|
{
|
||||||
|
_last_governor = governor;
|
||||||
|
cpufreq_set_governor("powersave", CPUFREQ_ALL_CPUS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case GOVERNOR_INTERACTIVE:
|
||||||
|
{
|
||||||
|
_last_governor = governor;
|
||||||
|
cpufreq_set_governor("interactive", CPUFREQ_ALL_CPUS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case GOVERNOR_PERFORMANCE:
|
||||||
|
{
|
||||||
|
_last_governor = governor;
|
||||||
|
cpufreq_set_governor("performance", CPUFREQ_ALL_CPUS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
DEBUGF("ERROR %s: Unknown governor: %d.", __func__, governor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
54
firmware/target/hosted/ibasso/governor-ibasso.h
Normal file
54
firmware/target/hosted/ibasso/governor-ibasso.h
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 by Ilia Sergachev: Initial Rockbox port to iBasso DX50
|
||||||
|
* Copyright (C) 2014 by Mario Basister: iBasso DX90 port
|
||||||
|
* Copyright (C) 2014 by Simon Rothen: Initial Rockbox repository submission, additional features
|
||||||
|
* Copyright (C) 2014 by Udo Schläpfer: Code clean up, additional features
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _GOVERNOR_IBASSO_H_
|
||||||
|
#define _GOVERNOR_IBASSO_H_
|
||||||
|
|
||||||
|
|
||||||
|
/* Supported freq scaling governors. */
|
||||||
|
enum ibasso_governors
|
||||||
|
{
|
||||||
|
/* Slow frequency switching. */
|
||||||
|
GOVERNOR_CONSERVATIVE = 0,
|
||||||
|
|
||||||
|
/* Fast frequency switching. */
|
||||||
|
GOVERNOR_ONDEMAND,
|
||||||
|
GOVERNOR_INTERACTIVE,
|
||||||
|
|
||||||
|
/* Allways lowest frequency. */
|
||||||
|
GOVERNOR_POWERSAVE,
|
||||||
|
|
||||||
|
/* Allways highest frequency. */
|
||||||
|
GOVERNOR_PERFORMANCE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Set the active freq scaling governor.
|
||||||
|
governor: ibasso_governors
|
||||||
|
*/
|
||||||
|
void ibasso_set_governor(int governor);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
#include <sys/reboot.h>
|
#include <sys/reboot.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "cpufreq-linux.h"
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#include "button-ibasso.h"
|
#include "button-ibasso.h"
|
||||||
|
|
@ -50,8 +49,7 @@ void system_init(void)
|
||||||
volatile uintptr_t stack = 0;
|
volatile uintptr_t stack = 0;
|
||||||
stackbegin = stackend = (uintptr_t*) &stack;
|
stackbegin = stackend = (uintptr_t*) &stack;
|
||||||
|
|
||||||
cpufreq_set_governor("powersave", CPUFREQ_ALL_CPUS);
|
vold_monitor_start();
|
||||||
vold_monitor_start();
|
|
||||||
ibasso_set_usb_mode(USB_MODE_MASS_STORAGE);
|
ibasso_set_usb_mode(USB_MODE_MASS_STORAGE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue