From: 张晴 Date: Sun, 4 May 2014 06:24:30 +0000 (+0800) Subject: rk3288:rk808:get dc1\2 voltage when power off and reboot X-Git-Tag: firefly_0821_release~5388 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=95495c4c3cf0f3bfff5b8f3ea0ed671ed6f323ae;p=firefly-linux-kernel-4.4.55.git rk3288:rk808:get dc1\2 voltage when power off and reboot --- diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index 7c195d84627e..93c9e85a0270 100755 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -1111,24 +1111,34 @@ static struct rk808_board *rk808_parse_dt(struct i2c_client *i2c) return NULL; } #endif - - -static int rk808_device_shutdown(void) +static int rk808_shutdown(void) { int ret,i,val; - int err = -1; u16 reg = 0; struct rk808 *rk808 = g_rk808; printk("%s\n",__func__); - /***************get dc0\dc1 voltage *********************/ + /***************get dc1\dc2 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); + printk("%s,line=%d dc[%d]= %d\n", __func__,__LINE__,(i+1),val); } /*****************************************************/ + return 0; +} +EXPORT_SYMBOL_GPL(rk808_shutdown); + +static int rk808_device_shutdown(void) +{ + int ret,i,val; + int err = -1; + u16 reg = 0; + struct rk808 *rk808 = g_rk808; + + printk("%s\n",__func__); + 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); @@ -1503,6 +1513,7 @@ static struct i2c_driver rk808_i2c_driver = { .probe = rk808_i2c_probe, .remove = rk808_i2c_remove, .id_table = rk808_i2c_id, + .shutdown = rk808_shutdown, #ifdef CONFIG_PM .suspend = rk808_suspend, .resume = rk808_resume,