From 68695f45f7a3e21d27917abf57de0c410a1744d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 14 Jun 2011 09:45:56 +0800 Subject: [PATCH] rk29: cpufreq: add board_update_cpufreq_table API, support board specific freq table --- arch/arm/mach-rk29/cpufreq.c | 30 ++++++++++++--------- arch/arm/mach-rk29/include/mach/cpufreq.h | 32 +++++++++++++++++++++++ 2 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 arch/arm/mach-rk29/include/mach/cpufreq.h diff --git a/arch/arm/mach-rk29/cpufreq.c b/arch/arm/mach-rk29/cpufreq.c index c13a4b3b5ab1..ae4db7fa4fd1 100755 --- a/arch/arm/mach-rk29/cpufreq.c +++ b/arch/arm/mach-rk29/cpufreq.c @@ -24,30 +24,36 @@ #include #include #include +#include #define SLEEP_FREQ (800 * 1000) /* Use 800MHz when entering sleep */ -/* additional symantics for "relation" in cpufreq with pm */ -#define DISABLE_FURTHER_CPUFREQ 0x10 -#define ENABLE_FURTHER_CPUFREQ 0x20 -#define MASK_FURTHER_CPUFREQ 0x30 -/* With 0x00(NOCHANGE), it depends on the previous "further" status */ static int no_cpufreq_access; -static struct cpufreq_frequency_table freq_table[] = { -// { .index = 950000, .frequency = 204000 }, -// { .index = 1050000, .frequency = 300000 }, +static struct cpufreq_frequency_table default_freq_table[] = { +// { .index = 1100000, .frequency = 24000 }, +// { .index = 1200000, .frequency = 204000 }, +// { .index = 1200000, .frequency = 300000 }, { .index = 1200000, .frequency = 408000 }, -// { .index = 1125000, .frequency = 600000 }, - { .index = 1200000, .frequency = 816000 }, +// { .index = 1200000, .frequency = 600000 }, + { .index = 1200000, .frequency = 816000 }, /* must enable, see SLEEP_FREQ above */ // { .index = 1250000, .frequency = 1008000 }, -// { .index = 1300000, .frequency = 1200000 }, +// { .index = 1300000, .frequency = 1104000 }, +// { .index = 1400000, .frequency = 1176000 }, +// { .index = 1400000, .frequency = 1200000 }, { .frequency = CPUFREQ_TABLE_END }, }; +static struct cpufreq_frequency_table *freq_table = default_freq_table; static struct clk *arm_clk; static struct regulator *vcore; static int vcore_uV; +int board_update_cpufreq_table(struct cpufreq_frequency_table *table) +{ + freq_table = table; + return 0; +} + static int rk29_cpufreq_verify(struct cpufreq_policy *policy) { return cpufreq_frequency_table_verify(policy, freq_table); @@ -128,8 +134,6 @@ err_vol: return err; } -extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); - static int __init rk29_cpufreq_init(struct cpufreq_policy *policy) { arm_clk = clk_get(NULL, "arm_pll"); diff --git a/arch/arm/mach-rk29/include/mach/cpufreq.h b/arch/arm/mach-rk29/include/mach/cpufreq.h new file mode 100644 index 000000000000..540a67c4f53a --- /dev/null +++ b/arch/arm/mach-rk29/include/mach/cpufreq.h @@ -0,0 +1,32 @@ +/* arch/arm/mach-rk29/include/mach/cpufreq.h + * + * Copyright (C) 2011 ROCKCHIP, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __ASM_ARCH_RK29_CPUFREQ_H + +#include + +/* additional symantics for "relation" in cpufreq with pm */ +#define DISABLE_FURTHER_CPUFREQ 0x10 +#define ENABLE_FURTHER_CPUFREQ 0x20 +#define MASK_FURTHER_CPUFREQ 0x30 +/* With 0x00(NOCHANGE), it depends on the previous "further" status */ + +#ifdef CONFIG_CPU_FREQ +int board_update_cpufreq_table(struct cpufreq_frequency_table *table); +#else +static inline int board_update_cpufreq_table(struct cpufreq_frequency_table *table) { return 0; } +#endif + +#endif -- 2.34.1