From: chenzhen Date: Mon, 18 Apr 2016 08:18:17 +0000 (+0800) Subject: MALI: rockchip: adjust code about thermal for kernel 4.4 X-Git-Tag: firefly_0821_release~2756 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=firefly-linux-kernel-4.4.55.git;a=commitdiff_plain;h=c2ce740bf6fdc7c18870c48b70fce9fc62392cff MALI: rockchip: adjust code about thermal for kernel 4.4 Change-Id: Ic5f3947b032deaaa800ee316636a8cc61259ba5d Signed-off-by: chenzhen --- diff --git a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c index 531c4328ccfd..86227d996257 100644 --- a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c +++ b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c @@ -14,6 +14,9 @@ */ +#define ENABLE_DEBUG_LOG +#include "../../platform/rk/custom_log.h" + #include #include @@ -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; diff --git a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c index cd4f0a2bb24f..9d3eb10bd3c9 100644 --- a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c +++ b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c @@ -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, }; diff --git a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.h b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.h index d20de1ef6170..17eede4d917c 100644 --- a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.h +++ b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.h @@ -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_ */ diff --git a/drivers/gpu/arm/midgard/mali_kbase_defs.h b/drivers/gpu/arm/midgard/mali_kbase_defs.h index 7d8590af031e..e5eae36d11af 100644 --- a/drivers/gpu/arm/midgard/mali_kbase_defs.h +++ b/drivers/gpu/arm/midgard/mali_kbase_defs.h @@ -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