Commit 7ef73598 authored by Jonghwan Choi's avatar Jonghwan Choi Committed by Samuel Ortiz

mfd: Use standard device wakeup for handling max8998 wakeup device

Use device_init_wakeup & device_may_wakeup to init wakeup
Signed-off-by: default avatarJonghwan Choi <jhbird.choi@samsung.com>
Acked-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent bdd6a67a
...@@ -176,6 +176,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c, ...@@ -176,6 +176,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
if (ret < 0) if (ret < 0)
goto err; goto err;
device_init_wakeup(max8998->dev, max8998->wakeup);
return ret; return ret;
err: err:
...@@ -210,7 +212,7 @@ static int max8998_suspend(struct device *dev) ...@@ -210,7 +212,7 @@ static int max8998_suspend(struct device *dev)
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
struct max8998_dev *max8998 = i2c_get_clientdata(i2c); struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
if (max8998->wakeup) if (device_may_wakeup(dev))
irq_set_irq_wake(max8998->irq, 1); irq_set_irq_wake(max8998->irq, 1);
return 0; return 0;
} }
...@@ -220,7 +222,7 @@ static int max8998_resume(struct device *dev) ...@@ -220,7 +222,7 @@ static int max8998_resume(struct device *dev)
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
struct max8998_dev *max8998 = i2c_get_clientdata(i2c); struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
if (max8998->wakeup) if (device_may_wakeup(dev))
irq_set_irq_wake(max8998->irq, 0); irq_set_irq_wake(max8998->irq, 0);
/* /*
* In LP3974, if IRQ registers are not "read & clear" * In LP3974, if IRQ registers are not "read & clear"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment