X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=arch%2Farm%2Fmach-rk30%2Fboard-pmu-tps65910.c;h=f63239d165e414379512966cf7a7a903bef81049;hb=c1d207e7a48e0c2edbaf9572ada14dc49e5a34f3;hp=ca3762bac09b365d51a804b78c179c37d8dd6446;hpb=b77e0e84630332abb34237b5d874f5fd159c2afc;p=firefly-linux-kernel-4.4.55.git diff --git a/arch/arm/mach-rk30/board-pmu-tps65910.c b/arch/arm/mach-rk30/board-pmu-tps65910.c index ca3762bac09b..f63239d165e4 100755 --- a/arch/arm/mach-rk30/board-pmu-tps65910.c +++ b/arch/arm/mach-rk30/board-pmu-tps65910.c @@ -14,7 +14,6 @@ extern int platform_device_register(struct platform_device *pdev); int tps65910_pre_init(struct tps65910 *tps65910){ int val = 0; - int i = 0; int err = -1; printk("%s,line=%d\n", __func__,__LINE__); @@ -38,7 +37,7 @@ int tps65910_pre_init(struct tps65910 *tps65910){ gpio_direction_output(PMU_POWER_SLEEP, GPIO_LOW); #endif - +#if 0 /*************set vdd11 (pll) voltage 1.0v********************/ val = tps65910_reg_read(tps65910, TPS65910_VDIG2); if (val<0) { @@ -52,7 +51,7 @@ int tps65910_pre_init(struct tps65910 *tps65910){ return err; } /****************************************/ - +#endif val = tps65910_reg_read(tps65910, TPS65910_DEVCTRL2); if (val<0) { printk(KERN_ERR "Unable to read TPS65910_DEVCTRL2 reg\n"); @@ -92,7 +91,8 @@ int tps65910_pre_init(struct tps65910 *tps65910){ } val |= (1<<5); //when 1: 1.5 A - val |= (0x07<<2); //TSTEP[2:0] = 111 : 2.5 mV/¦Ìs(sampling 3 Mhz/5) + val &= (~(0x3 <<2)); + val |= (0x01<<2); //TSTEP[3:2] = 01 : 12.5 mV/us(sampling 3 Mhz) err = tps65910_reg_write(tps65910, TPS65910_VDD1, val); if (err) { printk(KERN_ERR "Unable to write TPS65910_VDD1 reg\n"); @@ -107,6 +107,8 @@ int tps65910_pre_init(struct tps65910 *tps65910){ } val |= (1<<5); //when 1: 1.5 A + val &= (~(0x3 <<2)); + val |= (0x01<<2); //TSTEP[3:2] = 01 : 12.5 mV/us(sampling 3 Mhz) err = tps65910_reg_write(tps65910, TPS65910_VDD2, val); if (err) { printk(KERN_ERR "Unable to write TPS65910_VDD2 reg\n"); @@ -243,14 +245,14 @@ int tps65910_pre_init(struct tps65910 *tps65910){ #endif #endif - /**********************set arm in pwm ****************/ + /*****************set arm and logic (dc1&dc2)in pwm ****************/ val = tps65910_reg_read(tps65910, TPS65910_DCDCCTRL); if (val<0) { printk(KERN_ERR "Unable to read TPS65910_DCDCCTRL reg\n"); return val; } - val &= ~(1<<4); + val &= ~(3<<4); err = tps65910_reg_write(tps65910, TPS65910_DCDCCTRL, val); if (err) { printk(KERN_ERR "Unable to read TPS65910 Reg at offset 0x%x= \ @@ -305,15 +307,31 @@ static struct regulator_consumer_supply tps65910_smps1_supply[] = { { .supply = "vdd1", }, + #if defined(CONFIG_SOC_RK3168) || defined(CONFIG_ARCH_RK3188) || defined(CONFIG_SOC_RK3028) ||defined(CONFIG_MACH_RK3028A_86V) + + { + .supply = "vdd_core", + }, + #else { .supply = "vdd_cpu", }, + #endif }; static struct regulator_consumer_supply tps65910_smps2_supply[] = { { .supply = "vdd2", }, - + #if defined(CONFIG_MACH_RK3168_86V) || defined(CONFIG_SOC_RK3028)||defined(CONFIG_MACH_RK_FAC) ||defined(CONFIG_MACH_RK3028A_86V) + + { + .supply = "vdd_cpu", + }, + #else if defined(CONFIG_MACH_RK3026_86V) + { + .supply = "vdd_core", + }, + #endif }; static struct regulator_consumer_supply tps65910_smps3_supply[] = { { @@ -547,7 +565,7 @@ static struct regulator_init_data tps65910_ldo8 = { .min_uV = 1000000, .max_uV = 2500000, .apply_uV = 1, - .always_on = 1, +// .always_on = 1, .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE, .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL, @@ -566,7 +584,7 @@ void __sramfunc board_pmu_tps65910_resume(void) { #ifdef CONFIG_CLK_SWITCH_TO_32K sram_gpio_set_value(pmic_sleep, GPIO_LOW); - sram_udelay(2000); + sram_32k_udelay(10000); #endif } static struct tps65910_board tps65910_data = {