MALI: rockchip: adjust code about thermal for kernel 4.4
authorchenzhen <chenzhen@rock-chips.com>
Mon, 18 Apr 2016 08:18:17 +0000 (16:18 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Fri, 22 Apr 2016 07:50:06 +0000 (15:50 +0800)
Change-Id: Ic5f3947b032deaaa800ee316636a8cc61259ba5d
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c
drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c
drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.h
drivers/gpu/arm/midgard/mali_kbase_defs.h

index 531c4328ccfd0706818c1f71db040ffbde4ca1fc..86227d9962570bfaf25e292293b99dbb86f0a118 100644 (file)
@@ -14,6 +14,9 @@
  */
 
 
+#define ENABLE_DEBUG_LOG
+#include "../../platform/rk/custom_log.h"
+
 
 #include <mali_kbase.h>
 #include <mali_kbase_config_defaults.h>
@@ -132,12 +135,6 @@ kbase_devfreq_status(struct device *dev, struct devfreq_dev_status *stat)
 
        stat->private_data = NULL;
 
-#ifdef CONFIG_DEVFREQ_THERMAL
-       if (kbdev->devfreq_cooling)
-               memcpy(&kbdev->devfreq_cooling->last_status, stat,
-                               sizeof(*stat));
-#endif
-
        return 0;
 }
 
@@ -256,6 +253,7 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
        } else {
                err = 0;
        }
+       I("success initing power_model_simple.");
 #endif
 
        return 0;
index cd4f0a2bb24f44885150302e76ad506dc2cdd044..9d3eb10bd3c9db9d96734d9a085a8dbfbdd5c1ea 100644 (file)
@@ -36,7 +36,7 @@ static struct thermal_zone_device *gpu_tz;
 
 static unsigned long model_static_power(unsigned long voltage)
 {
-       unsigned long temperature, temp;
+       int temperature, temp;
        unsigned long temp_squared, temp_cubed, temp_scaling_factor;
        const unsigned long voltage_cubed = (voltage * voltage * voltage) >> 10;
 
@@ -85,7 +85,7 @@ static unsigned long model_dynamic_power(unsigned long freq,
        return (dynamic_coefficient * v2 * f_mhz) / 1000000; /* mW */
 }
 
-struct devfreq_cooling_ops power_model_simple_ops = {
+struct devfreq_cooling_power power_model_simple_ops = {
        .get_static_power = model_static_power,
        .get_dynamic_power = model_dynamic_power,
 };
index d20de1ef6170d4238397e28a7fae6c02b83d3375..17eede4d917c0a72e1c800daa8da0e61d8393cb5 100644 (file)
@@ -38,6 +38,6 @@
  */
 int kbase_power_model_simple_init(struct kbase_device *kbdev);
 
-extern struct devfreq_cooling_ops power_model_simple_ops;
+extern struct devfreq_cooling_power power_model_simple_ops;
 
 #endif /* _BASE_POWER_MODEL_SIMPLE_H_ */
index 7d8590af031e1f2dfa9bdd5f698c69da9fdd3e75..e5eae36d11af82103b26299d619b743b478c0dec 100644 (file)
@@ -944,7 +944,7 @@ struct kbase_device {
        unsigned long current_freq;
        unsigned long current_voltage;
 #ifdef CONFIG_DEVFREQ_THERMAL
-       struct devfreq_cooling_device *devfreq_cooling;
+       struct thermal_cooling_device *devfreq_cooling;
 #endif
 #endif