cpuquiet: Fix cpuquiet for k3.4
Sai Charan Gurrappadi [Thu, 16 Aug 2012 00:56:11 +0000 (17:56 -0700)]
Change-Id: I75d8dba6c9c4c43152c819e08beeccb1e3c07c0c
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/123850
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

arch/arm/mach-tegra/cpuquiet.c
drivers/cpuquiet/cpuquiet.c
drivers/cpuquiet/cpuquiet.h
drivers/cpuquiet/driver.c
drivers/cpuquiet/governors/balanced.c
drivers/cpuquiet/sysfs.c

index 8bc3517..5a5b4bc 100644 (file)
@@ -30,8 +30,8 @@
 #include <linux/clk.h>
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
-#include <linux/pm_qos_params.h>
 #include <linux/cpuquiet.h>
+#include <linux/pm_qos.h>
 
 #include "pm.h"
 #include "cpu-tegra.h"
index d902af2..a0f36c3 100644 (file)
@@ -26,7 +26,7 @@ DEFINE_MUTEX(cpuquiet_lock);
 
 static int __init cpuquiet_init(void)
 {
-       return cpuquiet_add_class_sysfs(&cpu_sysdev_class);
+       return cpuquiet_add_interface(cpu_subsys.dev_root);
 }
 
 core_initcall(cpuquiet_init);
index fa61946..bf5af94 100644 (file)
 #ifndef __DRIVER_CPUQUIET_H
 #define __DRIVER_CPUQUIET_H
 
-#include <linux/sysdev.h>
+#include <linux/device.h>
 
 extern struct mutex cpuquiet_lock;
 extern struct cpuquiet_governor *cpuquiet_curr_governor;
 extern struct list_head cpuquiet_governors;
-int cpuquiet_add_class_sysfs(struct sysdev_class *cls);
+int cpuquiet_add_interface(struct device *dev);
 struct cpuquiet_governor *cpuquiet_find_governor(const char *str);
 int cpuquiet_switch_governor(struct cpuquiet_governor *gov);
 struct cpuquiet_governor *cpuquiet_get_first_governor(void);
 struct cpuquiet_driver *cpuquiet_get_driver(void);
-void cpuquiet_add_dev(struct sys_device *sys_dev, unsigned int cpu);
+void cpuquiet_add_dev(struct device *dev, unsigned int cpu);
 void cpuquiet_remove_dev(unsigned int cpu);
 int cpuquiet_cpu_kobject_init(struct kobject *kobj, struct kobj_type *type,
                                char *name, int cpu);
index d9dbea7..4b888fa 100644 (file)
@@ -62,8 +62,7 @@ static void stats_update(struct cpuquiet_cpu_stat *stat, bool up)
        bool was_up = stat->up_down_count & 0x1;
 
        if (was_up)
-               stat->time_up_total = cputime64_add(stat->time_up_total,
-                       cputime64_sub(cur_jiffies, stat->last_update));
+               stat->time_up_total += cur_jiffies - stat->last_update;
 
        if (was_up != up)
                stat->up_down_count++;
@@ -136,7 +135,7 @@ int cpuquiet_register_driver(struct cpuquiet_driver *drv)
 {
        int err = -EBUSY;
        unsigned int cpu;
-       struct sys_device *sys_dev;
+       struct device *dev;
        u64 cur_jiffies;
 
        if (!drv)
@@ -151,9 +150,9 @@ int cpuquiet_register_driver(struct cpuquiet_driver *drv)
                stats[cpu].last_update = cur_jiffies;
                if (cpu_online(cpu))
                        stats[cpu].up_down_count = 1;
-               sys_dev = get_cpu_sysdev(cpu);
-               if (sys_dev) {
-                       cpuquiet_add_dev(sys_dev, cpu);
+               dev = get_cpu_device(cpu);
+               if (dev) {
+                       cpuquiet_add_dev(dev, cpu);
                        cpuquiet_cpu_kobject_init(&stats[cpu].cpu_kobject,
                                        &ktype_cpu_stats, "stats", cpu);
                }
index f0d2e03..61dd2cb 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/cpumask.h>
 #include <linux/module.h>
 #include <linux/cpufreq.h>
-#include <linux/pm_qos_params.h>
+#include <linux/pm_qos.h>
 #include <linux/jiffies.h>
 #include <linux/slab.h>
 #include <linux/cpu.h>
index 0d63eee..c3ae097 100644 (file)
@@ -180,7 +180,7 @@ int cpuquiet_cpu_kobject_init(struct kobject *kobj, struct kobj_type *type,
        return err;
 }
 
-int cpuquiet_add_class_sysfs(struct sysdev_class *cls)
+int cpuquiet_add_interface(struct device *dev)
 {
        int err;
 
@@ -190,7 +190,7 @@ int cpuquiet_add_class_sysfs(struct sysdev_class *cls)
                return -ENOMEM;
 
        err = kobject_init_and_add(cpuquiet_global_kobject,
-                       &ktype_cpuquiet_sysfs, &cls->kset.kobj, "cpuquiet");
+                       &ktype_cpuquiet_sysfs, &dev->kobj, "cpuquiet");
        if (!err)
                kobject_uevent(cpuquiet_global_kobject, KOBJ_ADD);
 
@@ -270,7 +270,7 @@ static struct kobj_type ktype_cpuquiet = {
        .default_attrs = cpuquiet_default_cpu_attrs,
 };
 
-void cpuquiet_add_dev(struct sys_device *sys_dev, unsigned int cpu)
+void cpuquiet_add_dev(struct device *device, unsigned int cpu)
 {
        struct cpuquiet_dev *dev;
        int err;
@@ -279,7 +279,7 @@ void cpuquiet_add_dev(struct sys_device *sys_dev, unsigned int cpu)
        dev->cpu = cpu;
        cpuquiet_cpu_devices[cpu] = dev;
        err = kobject_init_and_add(&dev->kobj, &ktype_cpuquiet,
-                               &sys_dev->kobj, "cpuquiet");
+                               &device->kobj, "cpuquiet");
        if (!err)
                kobject_uevent(&dev->kobj, KOBJ_ADD);
 }