sram_i2c_disenable();
return data;
}
-
+extern int __sramdata g_pmic_type ;
+#define PMIC_TYPE_TPS65910 2
+#define PMIC_TYPE_ACT8931 3
void __sramfunc rk30_suspend_voltage_set(unsigned int vol)
{
uint8 slaveaddr;
uint16 slavereg;
uint8 data,ret = 0;
uint8 rtc_status_reg = 0x11;
- slaveaddr = I2C_SADDR; //slave device addr
- slavereg = 0x22; // reg addr
- data = 0x23; //set arm 1.0v
-
- sram_i2c_init(); //init i2c device
- ret = sram_i2c_read(slaveaddr, rtc_status_reg);
+ sram_i2c_init(); //init i2c device
+ #if defined(CONFIG_MFD_TPS65910)
+ if(g_pmic_type == PMIC_TYPE_TPS65910)
+ {
+ slaveaddr = 0x2d; //slave device addr
+ slavereg = 0x22; // reg addr
+ data = 0x23; //set arm 1.0v
+
+ ret = sram_i2c_read(slaveaddr, rtc_status_reg);
sram_i2c_write(slaveaddr, rtc_status_reg, ret);
- arm_voltage = sram_i2c_read(slaveaddr, slavereg);
-// sram_printhex(ret);
- sram_i2c_write(slaveaddr, slavereg, data);//
- sram_i2c_deinit(); //deinit i2c device
+ arm_voltage = sram_i2c_read(slaveaddr, slavereg);
+ //sram_printhex(ret);
+ sram_i2c_write(slaveaddr, slavereg, data);//
+ }
+ #endif
+
+ #if defined(CONFIG_REGULATOR_ACT8931)
+ if(g_pmic_type == PMIC_TYPE_ACT8931)
+ {
+ slaveaddr = 0x5b; //slave device addr
+ slavereg = 0x40; // reg addr
+ data = 0x10; //set arm 1.0v
+
+ arm_voltage = sram_i2c_read(slaveaddr, slavereg);
+ //sram_printhex(ret);
+ sram_i2c_write(slaveaddr, slavereg, data);//
+ sram_i2c_write(slaveaddr,( slavereg+0x1), data);//
+ }
+ #endif
+ sram_i2c_deinit(); //deinit i2c device
}
uint8 slaveaddr;
uint16 slavereg;
uint8 data,ret = 0;
- slaveaddr = I2C_SADDR; //slave device addr
- slavereg = 0x22; // reg addr
- sram_i2c_init(); //init i2c device
- if (arm_voltage >= 0x3b ){ // set arm <= 1.3v
- data = 0x3b;
+ data = arm_voltage;
+ sram_i2c_init(); //init i2c device
+ #if defined(CONFIG_MFD_TPS65910)
+ if(g_pmic_type == PMIC_TYPE_TPS65910)
+ {
+ slaveaddr = 0x2d; //slave device addr
+ slavereg = 0x22; // reg add
+ sram_i2c_write(slaveaddr, slavereg, data);
+ sram_udelay(20000);
}
- else if(arm_voltage <= 0x1f){
- data = 0x1f; // set arm >= 0.95v
+ #endif
+ #if defined(CONFIG_REGULATOR_ACT8931)
+ if(g_pmic_type == PMIC_TYPE_ACT8931)
+ {
+ slaveaddr = 0x5b; //slave device addr
+ slavereg = 0x40; // reg addr
+ sram_i2c_write(slaveaddr, slavereg, data);
+ sram_i2c_write(slaveaddr, (slavereg+0x1), data);
+ sram_udelay(20000);
}
- else
- data = arm_voltage;
- sram_i2c_write(slaveaddr, slavereg, data);
+ #endif
sram_i2c_deinit(); //deinit i2c device
}