summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/devfreq/rockchip_dmc.c6
-rwxr-xr-xdrivers/gpu/arm/mali400/mali/platform/arm/arm.c6
-rw-r--r--drivers/gpu/arm/mali400/mali/platform/rk/rk.c6
-rw-r--r--drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c6
-rw-r--r--drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_power_model_simple.c6
-rw-r--r--drivers/staging/imgtec/rogue/rk3368/rk_init_v2.c6
-rw-r--r--drivers/thermal/devfreq_cooling.c5
-rw-r--r--include/linux/devfreq_cooling.h6
8 files changed, 31 insertions, 16 deletions
diff --git a/drivers/devfreq/rockchip_dmc.c b/drivers/devfreq/rockchip_dmc.c
index 05dd77ebbca8..4c29695e95d2 100644
--- a/drivers/devfreq/rockchip_dmc.c
+++ b/drivers/devfreq/rockchip_dmc.c
@@ -2225,7 +2225,8 @@ static struct devfreq_governor devfreq_dmc_ondemand = {
.event_handler = devfreq_dmc_ondemand_handler,
};
-static unsigned long model_static_power(unsigned long voltage)
+static unsigned long model_static_power(struct devfreq *devfreq,
+ unsigned long voltage)
{
struct rockchip_dmcfreq *dmcfreq = rk_dmcfreq;
struct device *dev = dmcfreq->dev;
@@ -2267,7 +2268,8 @@ static unsigned long model_static_power(unsigned long voltage)
* temp_scaling_factor) / 1000000;
}
-static unsigned long model_dynamic_power(unsigned long freq,
+static unsigned long model_dynamic_power(struct devfreq *devfreq,
+ unsigned long freq,
unsigned long voltage)
{
/*
diff --git a/drivers/gpu/arm/mali400/mali/platform/arm/arm.c b/drivers/gpu/arm/mali400/mali/platform/arm/arm.c
index bf7ffaff87e4..3bfcf3a2d441 100755
--- a/drivers/gpu/arm/mali400/mali/platform/arm/arm.c
+++ b/drivers/gpu/arm/mali400/mali/platform/arm/arm.c
@@ -183,7 +183,8 @@ static struct resource mali_gpu_resources_m400_mp2[] = {
static struct thermal_zone_device *gpu_tz;
/* Calculate gpu static power example for reference */
-static unsigned long arm_model_static_power(unsigned long voltage)
+static unsigned long arm_model_static_power(struct devfreq *devfreq,
+ unsigned long voltage)
{
int temperature, temp;
int temp_squared, temp_cubed, temp_scaling_factor;
@@ -223,7 +224,8 @@ static unsigned long arm_model_static_power(unsigned long voltage)
}
/* Calculate gpu dynamic power example for reference */
-static unsigned long arm_model_dynamic_power(unsigned long freq,
+static unsigned long arm_model_dynamic_power(struct devfreq *devfreq,
+ unsigned long freq,
unsigned long voltage)
{
/* The inputs: freq (f) is in Hz, and voltage (v) in mV.
diff --git a/drivers/gpu/arm/mali400/mali/platform/rk/rk.c b/drivers/gpu/arm/mali400/mali/platform/rk/rk.c
index 103acdd5c319..3c0d1cc7e4d6 100644
--- a/drivers/gpu/arm/mali400/mali/platform/rk/rk.c
+++ b/drivers/gpu/arm/mali400/mali/platform/rk/rk.c
@@ -301,7 +301,8 @@ static int power_model_simple_init(struct platform_device *pdev)
}
/* Calculate gpu static power example for reference */
-static unsigned long rk_model_static_power(unsigned long voltage)
+static unsigned long rk_model_static_power(struct devfreq *devfreq,
+ unsigned long voltage)
{
int temperature, temp;
int temp_squared, temp_cubed, temp_scaling_factor;
@@ -340,7 +341,8 @@ static unsigned long rk_model_static_power(unsigned long voltage)
}
/* Calculate gpu dynamic power example for reference */
-static unsigned long rk_model_dynamic_power(unsigned long freq,
+static unsigned long rk_model_dynamic_power(struct devfreq *devfreq,
+ unsigned long freq,
unsigned long voltage)
{
/* The inputs: freq (f) is in Hz, and voltage (v) in mV.
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 eeba4523199c..fee077a466fe 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
@@ -34,7 +34,8 @@ static u32 static_coefficient;
static s32 ts[4];
static struct thermal_zone_device *gpu_tz;
-static unsigned long model_static_power(unsigned long voltage)
+static unsigned long model_static_power(struct devfreq *devfreq,
+ unsigned long voltage)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
unsigned long temperature;
@@ -75,7 +76,8 @@ static unsigned long model_static_power(unsigned long voltage)
/ 1000000;
}
-static unsigned long model_dynamic_power(unsigned long freq,
+static unsigned long model_dynamic_power(struct devfreq *devfreq,
+ unsigned long freq,
unsigned long voltage)
{
/* The inputs: freq (f) is in Hz, and voltage (v) in mV.
diff --git a/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_power_model_simple.c b/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_power_model_simple.c
index d965033905ca..08d8819e7702 100644
--- a/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_power_model_simple.c
+++ b/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_power_model_simple.c
@@ -34,7 +34,8 @@ static u32 static_coefficient;
static s32 ts[4];
static struct thermal_zone_device *gpu_tz;
-static unsigned long model_static_power(unsigned long voltage)
+static unsigned long model_static_power(struct devfreq *devfreq,
+ unsigned long voltage)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
unsigned long temperature;
@@ -75,7 +76,8 @@ static unsigned long model_static_power(unsigned long voltage)
/ 1000000;
}
-static unsigned long model_dynamic_power(unsigned long freq,
+static unsigned long model_dynamic_power(struct devfreq *devfreq,
+ unsigned long freq,
unsigned long voltage)
{
/* The inputs: freq (f) is in Hz, and voltage (v) in mV.
diff --git a/drivers/staging/imgtec/rogue/rk3368/rk_init_v2.c b/drivers/staging/imgtec/rogue/rk3368/rk_init_v2.c
index 553d0c1377e5..dbb9f9f0b32b 100644
--- a/drivers/staging/imgtec/rogue/rk3368/rk_init_v2.c
+++ b/drivers/staging/imgtec/rogue/rk3368/rk_init_v2.c
@@ -436,7 +436,8 @@ static u32 static_coefficient;
static s32 ts[4];
static struct thermal_zone_device *gpu_tz;
-static unsigned long model_static_power(unsigned long voltage)
+static unsigned long model_static_power(struct devfreq *devfreq,
+ unsigned long voltage)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
unsigned long temperature;
@@ -477,7 +478,8 @@ static unsigned long model_static_power(unsigned long voltage)
/ 1000000;
}
-static unsigned long model_dynamic_power(unsigned long freq,
+static unsigned long model_dynamic_power(struct devfreq *devfreq,
+ unsigned long freq,
unsigned long voltage)
{
/* The inputs: freq (f) is in Hz, and voltage (v) in mV.
diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
index 01f0015f80dc..c549d83a0c7d 100644
--- a/drivers/thermal/devfreq_cooling.c
+++ b/drivers/thermal/devfreq_cooling.c
@@ -238,7 +238,7 @@ get_static_power(struct devfreq_cooling_device *dfc, unsigned long freq)
return 0;
}
- return dfc->power_ops->get_static_power(voltage);
+ return dfc->power_ops->get_static_power(df, voltage);
}
/**
@@ -262,7 +262,8 @@ get_dynamic_power(struct devfreq_cooling_device *dfc, unsigned long freq,
struct devfreq_cooling_power *dfc_power = dfc->power_ops;
if (dfc_power->get_dynamic_power)
- return dfc_power->get_dynamic_power(freq, voltage);
+ return dfc_power->get_dynamic_power(dfc->devfreq, freq,
+ voltage);
freq_mhz = freq / 1000000;
power = (u64)dfc_power->dyn_power_coeff * freq_mhz * voltage * voltage;
diff --git a/include/linux/devfreq_cooling.h b/include/linux/devfreq_cooling.h
index 7adf6cc4b305..959714e93e5b 100644
--- a/include/linux/devfreq_cooling.h
+++ b/include/linux/devfreq_cooling.h
@@ -37,8 +37,10 @@
* @dyn_power_coeff * frequency * voltage^2
*/
struct devfreq_cooling_power {
- unsigned long (*get_static_power)(unsigned long voltage);
- unsigned long (*get_dynamic_power)(unsigned long freq,
+ unsigned long (*get_static_power)(struct devfreq *devfreq,
+ unsigned long voltage);
+ unsigned long (*get_dynamic_power)(struct devfreq *devfreq,
+ unsigned long freq,
unsigned long voltage);
unsigned long dyn_power_coeff;
};