rk30_phone:add cpu_dvfs_table control,need modify hardware
authorlw@rock-chips.com <lw@rock-chips.com>
Thu, 19 Apr 2012 11:46:15 +0000 (19:46 +0800)
committerlw <lw@rock-chips.com>
Thu, 19 Apr 2012 11:47:27 +0000 (19:47 +0800)
arch/arm/configs/rk30_phone_defconfig
arch/arm/mach-rk30/board-rk30-phone.c
drivers/regulator/rk30-pwm-regulator.c

index da3fb17783442349140ab86be23ac37388aff08b..559cdca7a0b8bfacb89b8f1c32ea7f8df463e2d1 100755 (executable)
@@ -43,6 +43,12 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init"
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_CPU_IDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
@@ -264,6 +270,7 @@ CONFIG_MFD_WM8994=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_WM831X=y
 CONFIG_REGULATOR_WM8994=y
+CONFIG_RK30_PWM_REGULATOR=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_VIDEO_DEV=y
 CONFIG_SOC_CAMERA=y
index c7cbe28ab445aaf17eb6cd2b02c0a2510aa9f7fb..3ee16e1ebff85dffe05a3e56dd7efbf8de085e4f 100755 (executable)
@@ -24,6 +24,9 @@
 #include <linux/spi/spi.h>
 #include <linux/mmc/host.h>
 #include <linux/ion.h>
+#include <linux/cpufreq.h>
+#include <linux/clk.h>
+#include <mach/dvfs.h>
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -1864,9 +1867,24 @@ static void __init rk30_reserve(void)
        board_mem_reserved();
 }
 
+static struct cpufreq_frequency_table cpu_dvfs_table[] = {
+       //{.frequency   = 126*1000, .index      = 980*1000},
+       //{.frequency   = 252*1000, .index      = 980*1000},
+       //{.frequency   = 504*1000, .index      = 980*1000},
+       {.frequency = 816*1000, .index  = 1050*1000},
+       //{.frequency = 1008*1000,.index        = 1150*1000},
+       //{.frequency = 1200*1000,.index        = 1250*1000},
+       //{.frequency = 1416*1000,.index        = 1280*1000},
+       //{.frequency = 1512*1000,.index        = 1320*1000},
+       //{.frequency = 1560*1000,.index        = 1350*1000},
+       //{.frequency = 1608*1000,.index        = 1350*1000},
+       {.frequency     = CPUFREQ_TABLE_END},
+};
+
 void __init board_clock_init(void)
 {
        rk30_clock_data_init(periph_pll_297mhz, codec_pll_360mhz, max_i2s_12288khz);
+       dvfs_set_freq_volt_table(clk_get(NULL, "cpu"), cpu_dvfs_table);
 }
 
 MACHINE_START(RK30, "RK30board")
index 2a7439d10d76885cc35eebcc1d67b95be166662e..07129971460ee9546b2f07414fa601e932fa0a3f 100755 (executable)
@@ -38,7 +38,7 @@ REVISION 0.01
 #include <mach/board.h>\r
 \r
 \r
-#if 1\r
+#if 0\r
 #define DBG(x...)      printk(KERN_INFO x)\r
 #else\r
 #define DBG(x...)\r
@@ -132,7 +132,6 @@ static int pwm_set_rate(struct pwm_platform_data *pdata,int nHz,u32 rate)
 \r
 static int pwm_regulator_list_voltage(struct regulator_dev *dev,unsigned int index)\r
 {\r
-       DBG("Enter %s, index =%d\n",__FUNCTION__,index);\r
        if (index < sizeof(pwm_voltage_map)/sizeof(int))\r
                return pwm_voltage_map[index];\r
        else\r