aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch')
-rw-r--r--target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch56
1 files changed, 28 insertions, 28 deletions
diff --git a/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch b/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch
index 166964961b..26ea9f3c14 100644
--- a/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch
+++ b/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch
@@ -12,15 +12,15 @@ Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -48,11 +48,41 @@ static int set_target(struct cpufreq_pol
- struct private_data *priv = policy->driver_data;
- int ret;
- unsigned long target_freq = policy->freq_table[index].frequency * 1000;
+ struct private_data *priv = policy->driver_data;
+ int ret;
+ unsigned long target_freq = policy->freq_table[index].frequency * 1000;
+ struct clk *l2_clk = policy->l2_clk;
+ unsigned int l2_freq;
+ unsigned long new_l2_freq = 0;
-
- mutex_lock(&priv->lock);
- ret = dev_pm_opp_set_rate(priv->cpu_dev, target_freq);
+
+ mutex_lock(&priv->lock);
+ ret = dev_pm_opp_set_rate(priv->cpu_dev, target_freq);
- if (!ret)
+
+ if (!ret) {
@@ -48,25 +48,25 @@ Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
+ }
+ }
+
- priv->opp_freq = target_freq;
+ priv->opp_freq = target_freq;
+ }
+
- mutex_unlock(&priv->lock);
-
- return ret;
+ mutex_unlock(&priv->lock);
+
+ return ret;
@@ -196,6 +226,8 @@ static int cpufreq_init(struct cpufreq_p
- const char *name;
- int ret;
- struct srcu_notifier_head *opp_srcu_head;
+ const char *name;
+ int ret;
+ struct srcu_notifier_head *opp_srcu_head;
+ struct device_node *l2_np;
+ struct clk *l2_clk = NULL;
-
- cpu_dev = get_cpu_device(policy->cpu);
- if (!cpu_dev) {
+
+ cpu_dev = get_cpu_device(policy->cpu);
+ if (!cpu_dev) {
@@ -303,6 +335,13 @@ static int cpufreq_init(struct cpufreq_p
-
- policy->suspend_freq = dev_pm_opp_get_suspend_opp_freq(cpu_dev) / 1000;
-
+
+ policy->suspend_freq = dev_pm_opp_get_suspend_opp_freq(cpu_dev) / 1000;
+
+ l2_clk = clk_get(cpu_dev, "l2");
+ if (!IS_ERR(l2_clk))
+ policy->l2_clk = l2_clk;
@@ -74,17 +74,17 @@ Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
+ if (l2_np)
+ of_property_read_u32_array(l2_np, "qcom,l2-rates", policy->l2_rate, 3);
+
- ret = cpufreq_table_validate_and_show(policy, freq_table);
- if (ret) {
- dev_err(cpu_dev, "%s: invalid frequency table: %d\n", __func__,
+ ret = cpufreq_table_validate_and_show(policy, freq_table);
+ if (ret) {
+ dev_err(cpu_dev, "%s: invalid frequency table: %d\n", __func__,
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -73,6 +73,8 @@ struct cpufreq_policy {
- unsigned int cpu; /* cpu managing this policy, must be online */
-
- struct clk *clk;
+ unsigned int cpu; /* cpu managing this policy, must be online */
+
+ struct clk *clk;
+ struct clk *l2_clk; /* L2 clock */
+ unsigned int l2_rate[3]; /* L2 bus clock rate thresholds */
- struct cpufreq_cpuinfo cpuinfo;/* see above */
-
- unsigned int min; /* in kHz */
+ struct cpufreq_cpuinfo cpuinfo;/* see above */
+
+ unsigned int min; /* in kHz */