From: 黄涛 Date: Mon, 26 Aug 2013 03:13:24 +0000 (+0800) Subject: rk3026: cpufreq: support thermal throttle X-Git-Tag: firefly_0821_release~6683 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2192a21c68845080d4b7a6ffcd45fbdf733746b6;p=firefly-linux-kernel-4.4.55.git rk3026: cpufreq: support thermal throttle also bump version to 2.2 --- diff --git a/arch/arm/mach-rk3188/cpufreq.c b/arch/arm/mach-rk3188/cpufreq.c index a25fcb7bca0a..73f0f1a911d3 100644 --- a/arch/arm/mach-rk3188/cpufreq.c +++ b/arch/arm/mach-rk3188/cpufreq.c @@ -38,7 +38,7 @@ #include #include -#define VERSION "2.1" +#define VERSION "2.2" #ifdef DEBUG #define FREQ_DBG(fmt, args...) pr_debug(fmt, ## args) @@ -156,6 +156,34 @@ static struct cpufreq_frequency_table temp_limits_cpu_perf[] = { static struct cpufreq_frequency_table temp_limits_gpu_perf[] = { {.frequency = 1008 * 1000, .index = 0}, }; +#elif defined(CONFIG_ARCH_RK3026) +static struct cpufreq_frequency_table temp_limits[2][1] = { + { // 1 CPU busy + {.frequency = -1, .index = 0}, + }, { // 2 CPUs busy + {.frequency = 816 * 1000, .index = 0}, + } +}; + +static struct cpufreq_frequency_table temp_limits_cpu_perf[] = { + {.frequency = 1008 * 1000, .index = 0}, +}; + +static struct cpufreq_frequency_table temp_limits_gpu_perf[] = { + {.frequency = 1008 * 1000, .index = 0}, +}; + +static struct cpufreq_frequency_table temp_limits_3028a[2][1] = { + { // 1 CPU busy + {.frequency = -1, .index = 0}, + }, { // 2 CPUs busy + {.frequency = 1008 * 1000, .index = 0}, + } +}; + +static struct cpufreq_frequency_table temp_limits_cpu_perf_3028a[] = { + {.frequency = 1200 * 1000, .index = 0}, +}; #else /* 3188/3168 etc */ static struct cpufreq_frequency_table temp_limits[4][4] = { { // 1 CPU busy @@ -331,6 +359,13 @@ static void rk3188_cpufreq_temp_limit_init(struct cpufreq_policy *policy) unsigned int i; struct cpufreq_frequency_table *table; +#if defined(CONFIG_ARCH_RK3026) + if (soc_is_rk3028a()) { + memcpy(temp_limits, temp_limits_3028a, sizeof(temp_limits)); + memcpy(temp_limits_cpu_perf, temp_limits_cpu_perf_3028a, sizeof(temp_limits_cpu_perf)); + } +#endif + table = temp_limits[0]; for (i = 0; i < sizeof(temp_limits) / sizeof(struct cpufreq_frequency_table); i++) { table[i].frequency = get_freq_from_table(table[i].frequency);