#include <linux/init.h>
#include <linux/regulator/consumer.h>
#include <linux/suspend.h>
+#include <mach/cpufreq.h>
#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);
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");
--- /dev/null
+/* 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 <linux/cpufreq.h>
+
+/* 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