From 99fc87322e4b115602255f1baa49bb71100472a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Wed, 18 Apr 2012 15:51:15 +0800 Subject: [PATCH] rk30:sdk:Reduce the delay of the 8326 reset,modify the wakeup order of wm8326 i2c --- arch/arm/mach-rk30/board-rk30-sdk-wm8326.c | 2 +- drivers/mfd/wm831x-i2c.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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); } -- 2.34.1