From: 张晴 Date: Wed, 18 Apr 2012 07:51:15 +0000 (+0800) Subject: rk30:sdk:Reduce the delay of the 8326 reset,modify the wakeup order of wm8326 i2c X-Git-Tag: firefly_0821_release~9388 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=99fc87322e4b115602255f1baa49bb71100472a1;p=firefly-linux-kernel-4.4.55.git rk30:sdk:Reduce the delay of the 8326 reset,modify the wakeup order of wm8326 i2c --- diff --git a/arch/arm/mach-rk30/board-rk30-sdk-wm8326.c b/arch/arm/mach-rk30/board-rk30-sdk-wm8326.c index 08ccad2faa49..dd184ced8301 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk-wm8326.c +++ b/arch/arm/mach-rk30/board-rk30-sdk-wm8326.c @@ -104,7 +104,7 @@ static int wm831x_pre_init(struct wm831x *parm) //BATT_FET_ENA = 1 wm831x_reg_write(parm, WM831X_SECURITY_KEY, 0x9716); // unlock security key - wm831x_set_bits(parm, WM831X_RESET_CONTROL, 0x1000, 0x1000); + wm831x_set_bits(parm, WM831X_RESET_CONTROL, 0x1003, 0x1001); ret = wm831x_reg_read(parm, WM831X_RESET_CONTROL) & 0xffff & UNLOCK_SECURITY_KEY; // enternal reset active in sleep // printk("%s:WM831X_RESET_CONTROL=0x%x\n", __func__, ret); wm831x_reg_write(parm, WM831X_RESET_CONTROL, ret); diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c index 294d9bddb490..717f629336f3 100755 --- a/drivers/mfd/wm831x-i2c.c +++ b/drivers/mfd/wm831x-i2c.c @@ -54,7 +54,7 @@ static int wm831x_i2c_read_device(struct wm831x *wm831x, unsigned short reg, ret = i2c_transfer(adap, msgs, 2); - return (ret == 2)? count : ret; + return (ret == 2)? 0 : ret; #else struct i2c_client *i2c = wm831x->control_data; int ret; @@ -177,6 +177,10 @@ static int wm831x_i2c_suspend(struct device *dev) { struct wm831x *wm831x = dev_get_drvdata(dev); + spin_lock(&wm831x->flag_lock); + wm831x->flag_suspend = 1; + spin_unlock(&wm831x->flag_lock); + return wm831x_device_suspend(wm831x); }