Skip to content

Commit

Permalink
mfd: Use standard device wakeup for handling max8998 wakeup device
Browse files Browse the repository at this point in the history
Use device_init_wakeup & device_may_wakeup to init wakeup

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Jonghwan Choi authored and Samuel Ortiz committed Jan 8, 2012
1 parent bdd6a67 commit 7ef7359
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mfd/max8998.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
if (ret < 0)
goto err;

device_init_wakeup(max8998->dev, max8998->wakeup);

return ret;

err:
Expand Down Expand Up @@ -210,7 +212,7 @@ static int max8998_suspend(struct device *dev)
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
struct max8998_dev *max8998 = i2c_get_clientdata(i2c);

if (max8998->wakeup)
if (device_may_wakeup(dev))
irq_set_irq_wake(max8998->irq, 1);
return 0;
}
Expand All @@ -220,7 +222,7 @@ static int max8998_resume(struct device *dev)
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
struct max8998_dev *max8998 = i2c_get_clientdata(i2c);

if (max8998->wakeup)
if (device_may_wakeup(dev))
irq_set_irq_wake(max8998->irq, 0);
/*
* In LP3974, if IRQ registers are not "read & clear"
Expand Down

0 comments on commit 7ef7359

Please sign in to comment.