Merge branch 'cpus4096' into irq/threaded
[safe/jmp/linux-2.6] / arch / x86 / kernel / cpu / cpufreq / e_powersaver.c
index 34a227e..41ab3f0 100644 (file)
@@ -55,7 +55,6 @@ static int eps_set_state(struct eps_cpu_data *centaur,
 {
        struct cpufreq_freqs freqs;
        u32 lo, hi;
-       u8 current_multiplier, current_voltage;
        int err = 0;
        int i;
 
@@ -95,6 +94,10 @@ postchange:
        rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
        freqs.new = centaur->fsb * ((lo >> 8) & 0xff);
 
+#ifdef DEBUG
+       {
+       u8 current_multiplier, current_voltage;
+
        /* Print voltage and multiplier */
        rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
        current_voltage = lo & 0xff;
@@ -103,7 +106,8 @@ postchange:
        current_multiplier = (lo >> 8) & 0xff;
        printk(KERN_INFO "eps: Current multiplier = %d\n",
                current_multiplier);
-
+       }
+#endif
        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        return err;
 }
@@ -165,7 +169,7 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
                return -ENODEV;
 
        /* Check brand */
-       printk("eps: Detected VIA ");
+       printk(KERN_INFO "eps: Detected VIA ");
 
        switch (c->x86_model) {
        case 10:
@@ -182,31 +186,31 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
 
        switch(brand) {
        case EPS_BRAND_C7M:
-               printk("C7-M\n");
+               printk(KERN_CONT "C7-M\n");
                break;
        case EPS_BRAND_C7:
-               printk("C7\n");
+               printk(KERN_CONT "C7\n");
                break;
        case EPS_BRAND_EDEN:
-               printk("Eden\n");
+               printk(KERN_CONT "Eden\n");
                break;
        case EPS_BRAND_C7D:
                printk(KERN_CONT "C7-D\n");
                break;
        case EPS_BRAND_C3:
-               printk("C3\n");
+               printk(KERN_CONT "C3\n");
                return -ENODEV;
                break;
        }
        /* Enable Enhanced PowerSaver */
        rdmsrl(MSR_IA32_MISC_ENABLE, val);
-       if (!(val & 1 << 16)) {
-               val |= 1 << 16;
+       if (!(val & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
+               val |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP;
                wrmsrl(MSR_IA32_MISC_ENABLE, val);
                /* Can be locked at 0 */
                rdmsrl(MSR_IA32_MISC_ENABLE, val);
-               if (!(val & 1 << 16)) {
-                       printk("eps: Can't enable Enhanced PowerSaver\n");
+               if (!(val & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
+                       printk(KERN_INFO "eps: Can't enable Enhanced PowerSaver\n");
                        return -ENODEV;
                }
        }
@@ -214,19 +218,19 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
        /* Print voltage and multiplier */
        rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
        current_voltage = lo & 0xff;
-       printk("eps: Current voltage = %dmV\n", current_voltage * 16 + 700);
+       printk(KERN_INFO "eps: Current voltage = %dmV\n", current_voltage * 16 + 700);
        current_multiplier = (lo >> 8) & 0xff;
-       printk("eps: Current multiplier = %d\n", current_multiplier);
+       printk(KERN_INFO "eps: Current multiplier = %d\n", current_multiplier);
 
        /* Print limits */
        max_voltage = hi & 0xff;
-       printk("eps: Highest voltage = %dmV\n", max_voltage * 16 + 700);
+       printk(KERN_INFO "eps: Highest voltage = %dmV\n", max_voltage * 16 + 700);
        max_multiplier = (hi >> 8) & 0xff;
-       printk("eps: Highest multiplier = %d\n", max_multiplier);
+       printk(KERN_INFO "eps: Highest multiplier = %d\n", max_multiplier);
        min_voltage = (hi >> 16) & 0xff;
-       printk("eps: Lowest voltage = %dmV\n", min_voltage * 16 + 700);
+       printk(KERN_INFO "eps: Lowest voltage = %dmV\n", min_voltage * 16 + 700);
        min_multiplier = (hi >> 24) & 0xff;
-       printk("eps: Lowest multiplier = %d\n", min_multiplier);
+       printk(KERN_INFO "eps: Lowest multiplier = %d\n", min_multiplier);
 
        /* Sanity checks */
        if (current_multiplier == 0 || max_multiplier == 0