use g_info.hw_caps->can_cpufreq to control the cpu frequency

Origin commit data
------------------
Branch: ni/coolstream
Commit: 474e66e129
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-08-30 (Sun, 30 Aug 2020)

Origin message was:
------------------
- use g_info.hw_caps->can_cpufreq to control the cpu frequency

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2020-08-30 22:49:37 +02:00
parent deae82f80e
commit 2105bac1a1
4 changed files with 21 additions and 29 deletions

View File

@@ -211,7 +211,6 @@ const CMenuOptionChooser::keyval CHANNELLIST_NEW_ZAP_MODE_OPTIONS[CHANNELLIST_NE
{ 2, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE }
};
#ifdef CPU_FREQ
#define CPU_FREQ_OPTION_COUNT 13
const CMenuOptionChooser::keyval_ext CPU_FREQ_OPTIONS[CPU_FREQ_OPTION_COUNT] =
{
@@ -229,7 +228,6 @@ const CMenuOptionChooser::keyval_ext CPU_FREQ_OPTIONS[CPU_FREQ_OPTION_COUNT] =
{ 550, NONEXISTANT_LOCALE, "550 Mhz"},
{ 600, NONEXISTANT_LOCALE, "600 Mhz"}
};
#endif /*CPU_FREQ*/
const CMenuOptionChooser::keyval EPG_SCAN_OPTIONS[] =
{
@@ -335,12 +333,13 @@ int CMiscMenue::showMiscSettingsMenu()
mf->setHint("", LOCALE_MENU_HINT_MISC_ONLINESERVICES);
misc_menue.addItem(mf);
#ifdef CPU_FREQ
//CPU
CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width);
showMiscSettingsMenuCPUFreq(&misc_menue_cpu);
misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::convertDigitToKey(shortcut++)));
#endif /*CPU_FREQ*/
if (g_info.hw_caps->can_cpufreq)
{
CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width);
showMiscSettingsMenuCPUFreq(&misc_menue_cpu);
misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::convertDigitToKey(shortcut++)));
}
// Infoicons Setup
CInfoIconsSetup infoicons_setup;
@@ -770,7 +769,6 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation()
return res;
}
#ifdef CPU_FREQ
//CPU
void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu)
{
@@ -780,7 +778,6 @@ void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu)
ms_cpu->addItem(new CMenuOptionChooser(LOCALE_CPU_FREQ_NORMAL, &g_settings.cpufreq, CPU_FREQ_OPTIONS, CPU_FREQ_OPTION_COUNT, true, cpuNotifier));
ms_cpu->addItem(new CMenuOptionChooser(LOCALE_CPU_FREQ_STANDBY, &g_settings.standby_cpufreq, CPU_FREQ_OPTIONS, CPU_FREQ_OPTION_COUNT, true));
}
#endif /*CPU_FREQ*/
bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data*/)
{

View File

@@ -33,8 +33,6 @@
#include <string>
//#define CPU_FREQ
class CMiscMenue : public CMenuTarget, CChangeObserver
{
private:
@@ -79,9 +77,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver
int showMiscSettingsMenuOnlineServices();
int showMiscSettingsSelectWeatherLocation();
int showMiscSettingsMenuPlugins();
#ifdef CPU_FREQ
void showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu);
#endif /*CPU_FREQ*/
public:
CMiscMenue();
~CMiscMenue();

View File

@@ -486,13 +486,8 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.zappingmode = configfile.getInt32( "zappingmode", 0);
#endif
#ifdef CPU_FREQ
g_settings.cpufreq = configfile.getInt32("cpufreq", 0);
g_settings.standby_cpufreq = configfile.getInt32("standby_cpufreq", 100);
#else
g_settings.cpufreq = 0;
g_settings.standby_cpufreq = 50;
#endif
g_settings.cpufreq = g_info.hw_caps->can_cpufreq ? configfile.getInt32("cpufreq", 0) : 0;
g_settings.standby_cpufreq = g_info.hw_caps->can_cpufreq ? configfile.getInt32("standby_cpufreq", 100) : 50;
// ci-settings
g_settings.ci_standby_reset = configfile.getInt32("ci_standby_reset", 0);
@@ -2895,8 +2890,9 @@ TIMER_START();
powerManager = new cPowerManager;
powerManager->Open();
cpuFreq = new cCpuFreqManager();
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
cpuFreq = g_info.hw_caps->can_cpufreq ? new cCpuFreqManager() : NULL;
if (cpuFreq)
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
//fan speed
if (g_info.hw_caps->has_fan)
@@ -3644,7 +3640,8 @@ bool CNeutrinoApp::wakeupFromStandby(void)
CStreamManager::getInstance()->StreamStatus();
if ((mode == NeutrinoModes::mode_standby) && !alive) {
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
if (cpuFreq)
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
if(g_settings.ci_standby_reset) {
g_CamHandler->exec(NULL, "ca_ci_reset0");
g_CamHandler->exec(NULL, "ca_ci_reset1");
@@ -3671,7 +3668,8 @@ void CNeutrinoApp::standbyToStandby(void)
}
g_Zapit->setStandby(true);
g_Sectionsd->setPauseScanning(true);
cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000);
if (cpuFreq)
cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000);
}
}
@@ -4847,9 +4845,8 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
InfoIcons->saveIconstate();
CEpgScan::getInstance()->Start(true);
bool alive = recordingstatus || CEpgScan::getInstance()->Running() ||
CStreamManager::getInstance()->StreamStatus();
if(!alive)
bool alive = recordingstatus || CEpgScan::getInstance()->Running() || CStreamManager::getInstance()->StreamStatus();
if (!alive && cpuFreq)
cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000);
//fan speed
@@ -4871,7 +4868,8 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
powerManager->SetStandby(false, false);
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
CVFD::getInstance()->ShowText("Resume ...");
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
if (cpuFreq)
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
videoDecoder->Standby(false);
CEpgScan::getInstance()->Stop();
CSectionsdClient::CurrentNextInfo dummy;

View File

@@ -743,7 +743,8 @@ extern cCpuFreqManager * cpuFreq;
printf("CCpuFreqNotifier: %d Mhz\n", freq);
freq *= 1000*1000;
cpuFreq->SetCpuFreq(freq);
if (cpuFreq)
cpuFreq->SetCpuFreq(freq);
return false;
}