From a0ae9d7804e467c2bef96adc5538933c56cfabc9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Sat, 8 Jun 2013 14:25:54 +0800 Subject: [PATCH] ricoh619:ricoh619 pmu modify set mode and init reg --- arch/arm/mach-rk30/board-pmu-ricoh619.c | 11 ++++++++++- drivers/mfd/ricoh619.c | 2 +- drivers/regulator/ricoh619-regulator.c | 4 ++-- include/linux/mfd/ricoh619.h | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) mode change 100644 => 100755 drivers/mfd/ricoh619.c diff --git a/arch/arm/mach-rk30/board-pmu-ricoh619.c b/arch/arm/mach-rk30/board-pmu-ricoh619.c index 851c58a416fe..32e2ca4bbd64 100755 --- a/arch/arm/mach-rk30/board-pmu-ricoh619.c +++ b/arch/arm/mach-rk30/board-pmu-ricoh619.c @@ -17,7 +17,6 @@ static int ricoh619_pre_init(struct ricoh619 *ricoh619){ 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 @@ -25,7 +24,17 @@ static int ricoh619_pre_init(struct ricoh619 *ricoh619){ /**********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) diff --git a/drivers/mfd/ricoh619.c b/drivers/mfd/ricoh619.c old mode 100644 new mode 100755 index 59fc50244788..83dd730a096d --- a/drivers/mfd/ricoh619.c +++ b/drivers/mfd/ricoh619.c @@ -700,7 +700,7 @@ static int ricoh619_i2c_probe(struct i2c_client *client, 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; } diff --git a/drivers/regulator/ricoh619-regulator.c b/drivers/regulator/ricoh619-regulator.c index 3c5d433127b1..5502d87f1042 100644 --- a/drivers/regulator/ricoh619-regulator.c +++ b/drivers/regulator/ricoh619-regulator.c @@ -303,11 +303,11 @@ static int ricoh619_dcdc_set_mode(struct regulator_dev *rdev, unsigned int mode) 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; diff --git a/include/linux/mfd/ricoh619.h b/include/linux/mfd/ricoh619.h index 627a607c45a7..8d946414a42f 100644 --- a/include/linux/mfd/ricoh619.h +++ b/include/linux/mfd/ricoh619.h @@ -127,6 +127,25 @@ #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, -- 2.34.1