Commit 2ac79696 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Use the unified cpufreq debug infrastructure in the powernow-k7 driver.

Modified existing dprintks, and removed the driver-only debug module
parameter.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent e8f15876
No related merge requests found
...@@ -87,7 +87,6 @@ static int fid_codes[32] = { ...@@ -87,7 +87,6 @@ static int fid_codes[32] = {
*/ */
static int acpi_force; static int acpi_force;
static int debug;
static struct cpufreq_frequency_table *powernow_table; static struct cpufreq_frequency_table *powernow_table;
...@@ -100,20 +99,7 @@ static unsigned int fsb; ...@@ -100,20 +99,7 @@ static unsigned int fsb;
static unsigned int latency; static unsigned int latency;
static char have_a0; static char have_a0;
static void dprintk(const char *fmt, ...) #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k7", msg)
{
char s[256];
va_list args;
if (debug==0)
return;
va_start(args,fmt);
vsprintf(s, fmt, args);
printk(s);
va_end(args);
}
static int check_fsb(unsigned int fsbspeed) static int check_fsb(unsigned int fsbspeed)
{ {
...@@ -202,9 +188,6 @@ static int get_ranges (unsigned char *pst) ...@@ -202,9 +188,6 @@ static int get_ranges (unsigned char *pst)
#endif #endif
} }
dprintk (KERN_INFO PFX " FID: 0x%x (%d.%dx [%dMHz]) ", fid,
fid_codes[fid] / 10, fid_codes[fid] % 10, speed/1000);
if (speed < minimum_speed) if (speed < minimum_speed)
minimum_speed = speed; minimum_speed = speed;
if (speed > maximum_speed) if (speed > maximum_speed)
...@@ -212,7 +195,11 @@ static int get_ranges (unsigned char *pst) ...@@ -212,7 +195,11 @@ static int get_ranges (unsigned char *pst)
vid = *pst++; vid = *pst++;
powernow_table[j].index |= (vid << 8); /* upper 8 bits */ powernow_table[j].index |= (vid << 8); /* upper 8 bits */
dprintk ("VID: 0x%x (%d.%03dV)\n", vid, mobile_vid_table[vid]/1000,
dprintk (" FID: 0x%x (%d.%dx [%dMHz]) "
"VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
fid_codes[fid] % 10, speed/1000, vid,
mobile_vid_table[vid]/1000,
mobile_vid_table[vid]%1000); mobile_vid_table[vid]%1000);
} }
powernow_table[number_scales].frequency = CPUFREQ_TABLE_END; powernow_table[number_scales].frequency = CPUFREQ_TABLE_END;
...@@ -361,7 +348,7 @@ static int powernow_acpi_init(void) ...@@ -361,7 +348,7 @@ static int powernow_acpi_init(void)
unsigned int speed; unsigned int speed;
pc.val = (unsigned long) acpi_processor_perf->states[i].control; pc.val = (unsigned long) acpi_processor_perf->states[i].control;
dprintk (KERN_INFO PFX "acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", dprintk ("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n",
i, i,
(u32) acpi_processor_perf->states[i].core_frequency, (u32) acpi_processor_perf->states[i].core_frequency,
(u32) acpi_processor_perf->states[i].power, (u32) acpi_processor_perf->states[i].power,
...@@ -383,9 +370,10 @@ static int powernow_acpi_init(void) ...@@ -383,9 +370,10 @@ static int powernow_acpi_init(void)
powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
} }
dprintk (KERN_INFO PFX " FID: 0x%x (%d.%dx [%dMHz]) ", fid, dprintk (" FID: 0x%x (%d.%dx [%dMHz]) "
fid_codes[fid] / 10, fid_codes[fid] % 10, speed/1000); "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
dprintk ("VID: 0x%x (%d.%03dV)\n", vid, mobile_vid_table[vid]/1000, fid_codes[fid] % 10, speed/1000, vid,
mobile_vid_table[vid]/1000,
mobile_vid_table[vid]%1000); mobile_vid_table[vid]%1000);
if (latency < pc.bits.sgtc) if (latency < pc.bits.sgtc)
...@@ -436,21 +424,20 @@ static int powernow_decode_bios (int maxfid, int startvid) ...@@ -436,21 +424,20 @@ static int powernow_decode_bios (int maxfid, int startvid)
p = phys_to_virt(i); p = phys_to_virt(i);
if (memcmp(p, "AMDK7PNOW!", 10) == 0){ if (memcmp(p, "AMDK7PNOW!", 10) == 0){
dprintk (KERN_INFO PFX "Found PSB header at %p\n", p); dprintk ("Found PSB header at %p\n", p);
psb = (struct psb_s *) p; psb = (struct psb_s *) p;
dprintk (KERN_INFO PFX "Table version: 0x%x\n", psb->tableversion); dprintk ("Table version: 0x%x\n", psb->tableversion);
if (psb->tableversion != 0x12) { if (psb->tableversion != 0x12) {
printk (KERN_INFO PFX "Sorry, only v1.2 tables supported right now\n"); printk (KERN_INFO PFX "Sorry, only v1.2 tables supported right now\n");
return -ENODEV; return -ENODEV;
} }
dprintk (KERN_INFO PFX "Flags: 0x%x (", psb->flags); dprintk ("Flags: 0x%x\n", psb->flags);
if ((psb->flags & 1)==0) { if ((psb->flags & 1)==0) {
dprintk ("Mobile"); dprintk ("Mobile voltage regulator\n");
} else { } else {
dprintk ("Desktop"); dprintk ("Desktop voltage regulator\n");
} }
dprintk (" voltage regulator)\n");
latency = psb->settlingtime; latency = psb->settlingtime;
if (latency < 100) { if (latency < 100) {
...@@ -458,8 +445,8 @@ static int powernow_decode_bios (int maxfid, int startvid) ...@@ -458,8 +445,8 @@ static int powernow_decode_bios (int maxfid, int startvid)
"Should be at least 100. Correcting.\n", latency); "Should be at least 100. Correcting.\n", latency);
latency = 100; latency = 100;
} }
dprintk (KERN_INFO PFX "Settling Time: %d microseconds.\n", psb->settlingtime); dprintk ("Settling Time: %d microseconds.\n", psb->settlingtime);
dprintk (KERN_INFO PFX "Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst); dprintk ("Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst);
p += sizeof (struct psb_s); p += sizeof (struct psb_s);
...@@ -472,11 +459,9 @@ static int powernow_decode_bios (int maxfid, int startvid) ...@@ -472,11 +459,9 @@ static int powernow_decode_bios (int maxfid, int startvid)
if ((etuple == pst->cpuid) && check_fsb(pst->fsbspeed) && if ((etuple == pst->cpuid) && check_fsb(pst->fsbspeed) &&
(maxfid==pst->maxfid) && (startvid==pst->startvid)) (maxfid==pst->maxfid) && (startvid==pst->startvid))
{ {
dprintk (KERN_INFO PFX "PST:%d (@%p)\n", i, pst); dprintk ("PST:%d (@%p)\n", i, pst);
dprintk (KERN_INFO PFX " cpuid: 0x%x ", pst->cpuid); dprintk (" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n",
dprintk ("fsb: %d ", pst->fsbspeed); pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid);
dprintk ("maxFID: 0x%x ", pst->maxfid);
dprintk ("startvid: 0x%x\n", pst->startvid);
ret = get_ranges ((char *) pst + sizeof (struct pst_s)); ret = get_ranges ((char *) pst + sizeof (struct pst_s));
return ret; return ret;
...@@ -602,7 +587,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) ...@@ -602,7 +587,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
printk(KERN_WARNING PFX "can not determine bus frequency\n"); printk(KERN_WARNING PFX "can not determine bus frequency\n");
return -EINVAL; return -EINVAL;
} }
dprintk(KERN_INFO PFX "FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000); dprintk("FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);
if (dmi_check_system(powernow_dmi_table) || acpi_force) { if (dmi_check_system(powernow_dmi_table) || acpi_force) {
printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n"); printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n");
...@@ -685,8 +670,6 @@ static void __exit powernow_exit (void) ...@@ -685,8 +670,6 @@ static void __exit powernow_exit (void)
kfree(powernow_table); kfree(powernow_table);
} }
module_param(debug, int, 0444);
MODULE_PARM_DESC(debug, "enable debug output.");
module_param(acpi_force, int, 0444); module_param(acpi_force, int, 0444);
MODULE_PARM_DESC(acpi_force, "Force ACPI to be used."); MODULE_PARM_DESC(acpi_force, "Force ACPI to be used.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment