Ricoh619 = ricoh619;
printk("%s,line=%d\n", __func__,__LINE__);
- uint8_t cont;
int ret;
ret = ricoh619_set_bits(ricoh619->dev,RICOH619_PWR_REP_CNT,(1 << 0)); //set restart when power off
/**********set dcdc mode when in sleep mode **************/
/*****************************************************/
+
+ /****************set Re-charging voltage*****************/
+ ret = ricoh619_set_bits(ricoh619->dev,BATSET2_REG,(3 << 0));
+ ret = ricoh619_clr_bits(ricoh619->dev,BATSET2_REG,(1 << 2)); //set vrchg 4v
+ /*****************************************************/
+
+ /****************set dcdc & ldo on or off when in sleep******/
+// ret = ricoh619_clr_bits(ricoh619->dev,RICOH_DC1_SLOT,(0xf << 0));
+// ret = ricoh619_clr_bits(ricoh619->dev,RICOH_LDO1_SLOT,(0xf << 0));
+ /*****************************************************/
return 0;
}
static int ricoh619_post_init(struct ricoh619 *ricoh619)
mutex_init(&ricoh619->io_lock);
ret = ricoh619_read(ricoh619->dev, 0x36, &control);
- if ((control < 0) || (control == 0xff)) {
+ if ((control < 0) || (control == 0x00)) {
printk(KERN_INFO "The device is not ricoh619\n");
return 0;
}
switch(mode)
{
case REGULATOR_MODE_FAST:
- return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xef) | 0x10));
+ return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xcf) | 0x10));
case REGULATOR_MODE_NORMAL:
return ricoh619_write(parent, ri->reg_en_reg, (control & 0xcf));
case REGULATOR_MODE_STANDBY:
- return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xdf) | 0x20));
+ return ricoh619_write(parent, ri->reg_en_reg, ((control & 0xcf) | 0x20));
default:
printk("error:pmu_619 only powersave pwm psm mode\n");
return -EINVAL;
#define RICOH619_FG_CTRL 0xE0
#define RICOH619_PSWR 0x07
+#define RICOH_DC1_SLOT 0x16
+#define RICOH_DC2_SLOT 0x17
+#define RICOH_DC3_SLOT 0x18
+#define RICOH_DC4_SLOT 0x19
+#define RICOH_DC5_SLOT 0x1a
+
+#define RICOH_LDO1_SLOT 0x1b
+#define RICOH_LDO2_SLOT 0x1c
+#define RICOH_LDO3_SLOT 0x1d
+#define RICOH_LDO4_SLOT 0x1e
+#define RICOH_LDO5_SLOT 0x1f
+#define RICOH_LDO6_SLOT 0x20
+#define RICOH_LDO7_SLOT 0x21
+#define RICOH_LDO8_SLOT 0x22
+#define RICOH_LDO9_SLOT 0x23
+#define RICOH_LDO10_SLOT 0x24
+
+
+
/* RICOH619 IRQ definitions */
enum {
RICOH619_IRQ_POWER_ON,