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

Origin commit data
------------------
Branch: master
Commit: 4720ec559c
Author: martii <m4rtii@gmx.de>
Date: 2012-12-09 (Sun, 09 Dec 2012)


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

------------------
This commit was generated by Migit
This commit is contained in:
martii
2012-12-09 10:18:03 +01:00
parent 9434a3311b
commit 1da43a9f88

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 * 256 + 3); fprintf(pll0, "%lu\n", (f/10 << 8) | 3);
fclose (pll0); fclose (pll0);
return 0; return false;
}
} }
#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