//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);
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;
{
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);
}