From ef2575799244661f44da95e1fecce938e3afa857 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AE=8B=E7=A7=80=E6=9D=B0?= Date: Sat, 9 Oct 2010 06:02:03 -0700 Subject: [PATCH] pm.c reduce VCCIO and VCCSD is 2.8V. spi_fpga_init.c make key_led pin and cmmb pin disable --- arch/arm/mach-rk2818/pm.c | 36 +++++++++++++++++++++++++----------- drivers/fpga/spi_fpga_init.c | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-rk2818/pm.c b/arch/arm/mach-rk2818/pm.c index 266d43c39beb..894293bcdbc1 100755 --- a/arch/arm/mach-rk2818/pm.c +++ b/arch/arm/mach-rk2818/pm.c @@ -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(); diff --git a/drivers/fpga/spi_fpga_init.c b/drivers/fpga/spi_fpga_init.c index 1bad3d6c15b2..e26a131c111c 100755 --- a/drivers/fpga/spi_fpga_init.c +++ b/drivers/fpga/spi_fpga_init.c @@ -685,12 +685,42 @@ static int spi_fpga_wait_suspend(struct spi_fpga_port *port) } return -1; +} + +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); } static int spi_fpga_suspend(struct spi_device *spi, pm_message_t state) { - struct spi_fpga_port *port = dev_get_drvdata(&spi->dev); + struct spi_fpga_port *port = dev_get_drvdata(&spi->dev); + fpga_close_power_support( ); int ret; ret = spi_fpga_wait_suspend(port); if(!ret) @@ -717,7 +747,7 @@ static int spi_fpga_resume(struct spi_device *spi) spi_fpga_set_sysclk(GPIO_HIGH); udelay(1); spi_fpga_set_status(port, ICE_STATUS_WAKE); - + fpga_open_power_support( ); printk("%s\n",__FUNCTION__); return 0; -- 2.34.1