From a2f243949340ff2a1cdec7f0db3c50561e49a012 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Sun, 4 May 2014 11:19:40 +0800 Subject: [PATCH] rk3288:rk808:get dc0\1 voltage when power off --- drivers/mfd/rk808.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index 4a1551e7e428..7c195d84627e 100755 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -1115,12 +1115,20 @@ static struct rk808_board *rk808_parse_dt(struct i2c_client *i2c) static int rk808_device_shutdown(void) { - int ret; + int ret,i,val; int err = -1; + u16 reg = 0; struct rk808 *rk808 = g_rk808; printk("%s\n",__func__); - + /***************get dc0\dc1 voltage *********************/ + for(i=0;i<2;i++){ + reg = rk808_reg_read(rk808,rk808_BUCK_SET_VOL_REG(i)); + reg &= BUCK_VOL_MASK; + val = 700000 + reg * 12500; + printk("%s,line=%d dc[%d]= %d\n", __func__,__LINE__,i,val); + } + /*****************************************************/ ret = rk808_set_bits(rk808, RK808_INT_STS_MSK_REG1,(0x3<<5),(0x3<<5)); //close rtc int when power off ret = rk808_clear_bits(rk808, RK808_RTC_INT_REG,(0x3<<2)); //close rtc int when power off ret = rk808_reg_read(rk808,RK808_DEVCTRL_REG); -- 2.34.1