summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hopf <mhopf@suse.de>2009-11-12 14:57:40 +0100
committerMatthias Hopf <mhopf@suse.de>2009-11-12 14:57:40 +0100
commit6387ab4c1d0ff71e556b1c96f21b4e765a6c8e5a (patch)
tree486f4d00b562f0a4602e193a2bb11f7810c5226d
parentd6b4718350be61fba6b060f35941436ae2f236bd (diff)
PM: Validate known good configurations as well.
In some AtomBIOSes voltage values are broken (e.g. 0xff01).
-rw-r--r--src/rhd_pm.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/rhd_pm.c b/src/rhd_pm.c
index 9530e59..d126518 100644
--- a/src/rhd_pm.c
+++ b/src/rhd_pm.c
@@ -109,6 +109,23 @@ static void rhdPmValidateSetting (struct rhdPm *Pm, struct rhdPowerState *settin
/* Only set to lower Voltages than compare if 0 */
}
+/* Some AtomBIOSes provide broken current clocks (esp. memory) */
+static void rhdPmValidateClearSetting (struct rhdPm *Pm, struct rhdPowerState *setting)
+{
+ if (setting->EngineClock < COMPARE_MIN_ENGINE_CLOCK)
+ setting->EngineClock = 0;
+ if (setting->EngineClock > COMPARE_MAX_ENGINE_CLOCK)
+ setting->EngineClock = 0;
+ if (setting->MemoryClock < COMPARE_MIN_MEMORY_CLOCK)
+ setting->MemoryClock = 0;
+ if (setting->MemoryClock > COMPARE_MAX_MEMORY_CLOCK)
+ setting->MemoryClock = 0;
+ if (setting->VDDCVoltage < COMPARE_MIN_VOLTAGE)
+ setting->VDDCVoltage = 0;
+ if (setting->VDDCVoltage > COMPARE_MAX_VOLTAGE)
+ setting->VDDCVoltage = 0;
+}
+
static void rhdPmValidateMinMax (struct rhdPm *Pm)
{
if (Pm->Maximum.EngineClock < Pm->Default.EngineClock)
@@ -142,6 +159,7 @@ static void rhdPmValidateMinMax (struct rhdPm *Pm)
if (Pm->NumKnown) {
int i;
for (i = 0; i < Pm->NumKnown; i++) {
+ rhdPmValidateClearSetting (Pm, &Pm->Known[i]);
if (Pm->Maximum.EngineClock < Pm->Known[i].EngineClock)
Pm->Maximum.EngineClock = Pm->Known[i].EngineClock;
if (Pm->Maximum.MemoryClock < Pm->Known[i].MemoryClock)
@@ -161,23 +179,6 @@ static void rhdPmValidateMinMax (struct rhdPm *Pm)
Pm->Minimum.VDDCVoltage = Pm->Maximum.VDDCVoltage = Pm->Default.VDDCVoltage = 0;
}
-/* Some AtomBIOSes provide broken current clocks (esp. memory) */
-static void rhdPmValidateClearSetting (struct rhdPm *Pm, struct rhdPowerState *setting)
-{
- if (setting->EngineClock < COMPARE_MIN_ENGINE_CLOCK)
- setting->EngineClock = 0;
- if (setting->EngineClock > COMPARE_MAX_ENGINE_CLOCK)
- setting->EngineClock = 0;
- if (setting->MemoryClock < COMPARE_MIN_MEMORY_CLOCK)
- setting->MemoryClock = 0;
- if (setting->MemoryClock > COMPARE_MAX_MEMORY_CLOCK)
- setting->MemoryClock = 0;
- if (setting->VDDCVoltage < COMPARE_MIN_VOLTAGE)
- setting->VDDCVoltage = 0;
- if (setting->VDDCVoltage > COMPARE_MAX_VOLTAGE)
- setting->VDDCVoltage = 0;
-}
-
/* Have: a list of possible power settings, eventual minimum and maximum settings.
* Want: all rhdPowerState_e settings */
static void rhdPmSelectSettings (RHDPtr rhdPtr)