libspark/pwrmngr: don't fall-back to default cpu frequency

This commit is contained in:
martii
2012-12-09 10:18:03 +01:00
parent 82a0c1aa10
commit 4720ec559c

View File

@@ -49,14 +49,14 @@ bool cPowerManager::SetStandby(bool Active, bool Passive)
bool cCpuFreqManager::SetCpuFreq(unsigned long f) bool cCpuFreqManager::SetCpuFreq(unsigned long f)
{ {
#ifdef MARTII #ifdef MARTII
if (f == 0) if (f) {
f = 450000000; FILE *pll0 = fopen ("/proc/cpu_frequ/pll0_ndiv_mdiv", "w");
FILE *pll0 = fopen ("/proc/cpu_frequ/pll0_ndiv_mdiv", "w"); if (pll0) {
if (pll0) { f /= 1000000;
f /= 1000000; fprintf(pll0, "%lu\n", (f/10 << 8) | 3);
fprintf(pll0, "%lu\n", f/10 * 256 + 3); fclose (pll0);
fclose (pll0); return false;
return 0; }
} }
#else #else
/* actually SetCpuFreq is used to determine if the system is in standby /* actually SetCpuFreq is used to determine if the system is in standby