#define POLICY_MIN_DIV 20
-/* DEBUG
- * Define it if you want verbose debug output
- */
-
-#define SUSPMOD_DEBUG 1
-
-#ifdef SUSPMOD_DEBUG
-#define dprintk(msg...) printk(KERN_DEBUG "cpufreq:" msg)
-#else
-#define dprintk(msg...) do { } while(0)
-#endif
+#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg)
/**
* we can detect a core multipiler from dir0_lsb
/* check if CPU is a MediaGX or a Geode. */
if ((current_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
(current_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
- printk(KERN_INFO "gx-suspmod: error: no MediaGX/Geode processor found!\n");
+ dprintk("error: no MediaGX/Geode processor found!\n");
return NULL;
}
/* detect which companion chip is used */
- while ((gx_pci = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) {
+ while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) {
if ((pci_match_device (gx_chipset_tbl, gx_pci)) != NULL) {
return gx_pci;
}
}
- dprintk(KERN_INFO "gx-suspmod: error: no supported chipset found!\n");
+ dprintk("error: no supported chipset found!\n");
return NULL;
}
if ((gx_params->pci_suscfg & SUSMOD) == 0)
return stock_freq;
- return (stock_freq * gx_params->on_duration)
+ return (stock_freq * gx_params->off_duration)
/ (gx_params->on_duration + gx_params->off_duration);
}
static void __exit cpufreq_gx_exit(void)
{
cpufreq_unregister_driver(&gx_suspmod_driver);
+ pci_dev_put(gx_params->cs55x0);
kfree(gx_params);
}