]> git.hungrycats.org Git - linux/commitdiff
[CPUFREQ] Add longrun ->get
authorDave Jones <davej@redhat.com>
Fri, 7 May 2004 16:31:46 +0000 (17:31 +0100)
committerDave Jones <davej@delerium.codemonkey.org.uk>
Fri, 7 May 2004 16:31:46 +0000 (17:31 +0100)
Longrun users might be interested in their CPU's current frequency as
well, so use a longrun-specific cpuid-call in longrun_get().

arch/i386/kernel/cpu/cpufreq/longrun.c

index e51bb030424355ce473f973450a53e11388c8346..5e4dacf938cedb43df3ac4014e1717cb4189df75 100644 (file)
@@ -128,6 +128,17 @@ static int longrun_verify_policy(struct cpufreq_policy *policy)
        return 0;
 }
 
+static unsigned int longrun_get(unsigned int cpu)
+{
+       u32 eax, ebx, ecx, edx;
+
+       if (cpu)
+               return 0;
+
+       cpuid(0x80860007, &eax, &ebx, &ecx, &edx);
+
+       return (eax * 1000);
+}
 
 /**
  * longrun_determine_freqs - determines the lowest and highest possible core frequency
@@ -250,8 +261,10 @@ static int __init longrun_cpu_init(struct cpufreq_policy *policy)
 
 
 static struct cpufreq_driver longrun_driver = {
+       .flags          = CPUFREQ_CONST_LOOPS,
        .verify         = longrun_verify_policy,
        .setpolicy      = longrun_set_policy,
+       .get            = longrun_get,
        .init           = longrun_cpu_init,
        .name           = "longrun",
        .owner          = THIS_MODULE,