pm.c reduce VCCIO and VCCSD is 2.8V. spi_fpga_init.c make key_led pin and cmmb pin...
author宋秀杰 <sxj@rock-chips.com>
Sat, 9 Oct 2010 13:02:03 +0000 (06:02 -0700)
committer宋秀杰 <sxj@rock-chips.com>
Sat, 9 Oct 2010 13:02:03 +0000 (06:02 -0700)
arch/arm/mach-rk2818/pm.c
drivers/fpga/spi_fpga_init.c

index 266d43c39beb68530a4d5e587f1e9d22205e9a16..894293bcdbc11c03edb0a6a3998db454c9c8320c 100755 (executable)
@@ -544,10 +544,10 @@ static void rk2818_pm_reg_print(unsigned int *pm_save_reg,unsigned int *pm_ch_re
 
 static void pmu_suspend(void)
 {
-       struct regulator *ldo1,*ldo2,*ldo4,*ldo5;
-       struct regulator *lilo2;
+       //struct regulator *ldo1,*ldo2,*ldo4,*ldo5;
+       struct regulator *lilo1,*lilo2;
        
-       ldo1 = regulator_get(NULL, "ldo1");
+       /*ldo1 = regulator_get(NULL, "ldo1");
        regulator_disable(ldo1);
        ldo2 = regulator_get(NULL, "ldo2");
        regulator_disable(ldo2);
@@ -556,16 +556,21 @@ static void pmu_suspend(void)
        ldo5 = regulator_get(NULL, "ldo5");
        regulator_disable(ldo5);
        lilo2 = regulator_get(NULL, "lilo2");
-       regulator_disable(lilo2);
+       regulator_disable(lilo2);*/
+       
+       lilo1 = regulator_get(NULL, "lilo1");
+       regulator_set_voltage(lilo1,2800000,2800000);
+       lilo2 = regulator_get(NULL, "lilo2");
+       regulator_set_voltage(lilo2,2800000,2800000);
 }
 
 static void pmu_resume(void)
 {
-       struct regulator *ldo1,*ldo2,*ldo4,*ldo5;
-       struct regulator *lilo2;
-       int tmp = 0;
+       //struct regulator *ldo1,*ldo2,*ldo4,*ldo5;
+       struct regulator *lilo1,*lilo2;
+       //int tmp = 0;
 
-       ldo1 = regulator_get(NULL, "ldo1");
+       /*ldo1 = regulator_get(NULL, "ldo1");
        regulator_enable(ldo1);
        tmp = regulator_get_voltage(ldo1);
 
@@ -583,7 +588,12 @@ static void pmu_resume(void)
 
        lilo2 = regulator_get(NULL, "lilo2");
        regulator_enable(lilo2);
-       tmp = regulator_get_voltage(lilo2);
+       tmp = regulator_get_voltage(lilo2);*/
+       
+       lilo1 = regulator_get(NULL, "lilo1");
+       regulator_set_voltage(lilo1,3000000,3000000);
+       lilo2 = regulator_get(NULL, "lilo2");
+       regulator_set_voltage(lilo2,3000000,3000000);
 }
 
 static int __tcmfunc rk2818_tcm_idle(void)
@@ -697,7 +707,9 @@ static int rk2818_pm_enter(suspend_state_t state)
 
        printk(KERN_DEBUG "before core halt\n");
 
-       //pmu_suspend( );
+       #if defined(CONFIG_MACH_RAHO)||defined(CONFIG_MACH_RAHO_0928)
+       pmu_suspend( );
+       #endif
        clk_set_rate(arm_clk, 24000000);
        dump_register();
 
@@ -721,7 +733,9 @@ static int rk2818_pm_enter(suspend_state_t state)
 
        rockchip_timer_clocksource_suspend_resume(0);
 #endif
-       //pmu_resume( );
+       #if defined(CONFIG_MACH_RAHO)||defined(CONFIG_MACH_RAHO_0928)
+       pmu_resume( );
+       #endif
        dump_register();
        clk_set_rate(arm_clk, arm_rate);
        //rk2818_socpm_print();
index 1bad3d6c15b27086d4695301887225f70ba87c54..e26a131c111c03a1004602141028ca9b290f4497 100755 (executable)
@@ -685,12 +685,42 @@ static int spi_fpga_wait_suspend(struct spi_fpga_port *port)
        }\r
        \r
        return -1;\r
+}
+
+static void fpga_close_power_support(void)
+{
+       //cmmb power down
+       gpio_request(FPGA_PIO4_03, NULL); 
+       gpio_direction_output(FPGA_PIO4_03,GPIO_LOW); 
+       gpio_free(FPGA_PIO4_03);
+       gpio_request(FPGA_PIO2_09, NULL); 
+       gpio_direction_output(FPGA_PIO2_09,GPIO_LOW); 
+       gpio_free(FPGA_PIO2_09);
+       gpio_request(FPGA_PIO2_06, NULL); 
+       gpio_direction_output(FPGA_PIO2_06,GPIO_LOW);
+       gpio_free(FPGA_PIO2_06);
+
+       //KEY LED control
+       gpio_request(FPGA_PIO1_13, NULL);       
+       gpio_direction_output(FPGA_PIO1_13,GPIO_LOW); 
+       gpio_free(FPGA_PIO1_13);
+}
+
+static void fpga_open_power_support(void)
+{
+       //cmmb do not control here
+
+       //KEY LED resume
+       gpio_request(FPGA_PIO1_13, NULL);       
+       gpio_direction_output(FPGA_PIO1_13,GPIO_HIGH); 
+       gpio_free(FPGA_PIO1_13);                
 }\r
 \r
 static int spi_fpga_suspend(struct spi_device *spi, pm_message_t state)\r
 {\r
 \r
-       struct spi_fpga_port *port = dev_get_drvdata(&spi->dev);\r
+       struct spi_fpga_port *port = dev_get_drvdata(&spi->dev);
+       fpga_close_power_support( );\r
        int ret;\r
        ret = spi_fpga_wait_suspend(port);\r
        if(!ret)\r
@@ -717,7 +747,7 @@ static int spi_fpga_resume(struct spi_device *spi)
        spi_fpga_set_sysclk(GPIO_HIGH);\r
        udelay(1);\r
        spi_fpga_set_status(port, ICE_STATUS_WAKE);\r
-\r
+       fpga_open_power_support( );\r
        printk("%s\n",__FUNCTION__);\r
 \r
        return 0;\r