A22: add working power management function
author宋秀杰 <sxj@rock-chips.com>
Tue, 5 Jul 2011 07:07:38 +0000 (00:07 -0700)
committer宋秀杰 <sxj@rock-chips.com>
Tue, 5 Jul 2011 07:07:38 +0000 (00:07 -0700)
arch/arm/configs/rk29_a22_defconfig [changed mode: 0644->0755]
arch/arm/mach-rk29/Kconfig
arch/arm/mach-rk29/board-rk29-a22.c
arch/arm/mach-rk29/spi_sram.c

old mode 100644 (file)
new mode 100755 (executable)
index 46579c7..e50c6ad
@@ -244,6 +244,7 @@ CONFIG_RK29_LAST_LOG=y
 #
 # support for RK29 power manage 
 #
+CONFIG_RK29_WORKING_POWER_MANAGEMENT=y
 CONFIG_RK29_CLK_SWITCH_TO_32K=y
 CONFIG_RK29_GPIO_SUSPEND=y
 CONFIG_RK29_SPI_INSRAM=y
index 37efd90fb2c148da2e4766252004a96f5a32667b..43551408017bbba024b06701f4e0ee5d56423fe1 100755 (executable)
@@ -205,6 +205,12 @@ config RK29_LAST_LOG
          It is only intended for debugging.
 
 menu "support for RK29 power manage "
+config RK29_WORKING_POWER_MANAGEMENT
+       bool "Support power saving in working"
+       default n
+       help 
+         a series of measures to reduce working power
+
 config RK29_CLK_SWITCH_TO_32K
        bool "Support clock switch to 32.768k"
        default n
index 4951b1c68cfe78f03fcc3d4770ebaebd95525315..455836f61f870a8c774530b1d8114af76e5d8eca 100755 (executable)
@@ -2592,8 +2592,14 @@ static void __init rk29_board_iomux_init(void)
                return -1;
        }
        //phy power down
+
+       #if defined (CONFIG_RK29_WORKING_POWER_MANAGEMENT)
        gpio_direction_output(RK29_PIN4_PC0, GPIO_HIGH);
        gpio_set_value(RK29_PIN4_PC0, GPIO_HIGH);
+       #else
+       gpio_direction_output(RK29_PIN4_PC0, GPIO_LOW);
+       gpio_set_value(RK29_PIN4_PC0, GPIO_LOW);
+       #endif
 
        rk29_mux_api_set(GPIO4C5_RMIICSRDVALID_MIIRXDVALID_NAME,GPIO4H_GPIO4C5);
 
index c9a55429d084e74352f763df31269d9f0a31e607..55df65f26d1e360d2b6953ce97cc481407ee9c2e 100755 (executable)
@@ -549,7 +549,9 @@ void __sramfunc pm_clk_switch_32k(void)
        int vol;
        sram_printch('7');
 
-       #ifndef CONFIG_MACH_RK29_A22
+       #if defined (CONFIG_RK29_WORKING_POWER_MANAGEMENT)
+       //not code in here
+       #else
        pm_gpio_out_high(RK29_PIN4_PC0);
        #endif
        sram_delay_loop(30);
@@ -569,7 +571,9 @@ void __sramfunc pm_clk_switch_32k(void)
        sram_udelay(1000,24);
        cru_writel(crumode, CRU_MODE_CON); //externel clk 24M
 
-       #ifndef CONFIG_MACH_RK29_A22
+       #if defined (CONFIG_RK29_WORKING_POWER_MANAGEMENT)
+       //not code in here
+       #else
        pm_gpio_out_low(RK29_PIN4_PC0); //enable 27M
        #endif
        sram_udelay(1000,27);