Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284594
b: refs/heads/master
c: ba74e80
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Liu authored and Samuel Ortiz committed Jan 9, 2012
1 parent cd9282e commit a53957e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5214e5659a9760cd01aa14171c8fdf38d3deec3a
refs/heads/master: ba74e80ebaf8209cb553eb2195b26302270cfa42
27 changes: 27 additions & 0 deletions trunk/drivers/mfd/max8925-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ static int __devinit max8925_probe(struct i2c_client *client,
chip->adc = i2c_new_dummy(chip->i2c->adapter, ADC_I2C_ADDR);
i2c_set_clientdata(chip->adc, chip);

device_init_wakeup(&client->dev, 1);

max8925_device_init(chip, pdata);

return 0;
Expand All @@ -177,10 +179,35 @@ static int __devexit max8925_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int max8925_suspend(struct device *dev)
{
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
struct max8925_chip *chip = i2c_get_clientdata(client);

if (device_may_wakeup(dev) && chip->wakeup_flag)
enable_irq_wake(chip->core_irq);
return 0;
}

static int max8925_resume(struct device *dev)
{
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
struct max8925_chip *chip = i2c_get_clientdata(client);

if (device_may_wakeup(dev) && chip->wakeup_flag)
disable_irq_wake(chip->core_irq);
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(max8925_pm_ops, max8925_suspend, max8925_resume);

static struct i2c_driver max8925_driver = {
.driver = {
.name = "max8925",
.owner = THIS_MODULE,
.pm = &max8925_pm_ops,
},
.probe = max8925_probe,
.remove = __devexit_p(max8925_remove),
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/mfd/max8925.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ struct max8925_chip {
int irq_base;
int core_irq;
int tsc_irq;

unsigned int wakeup_flag;
};

struct max8925_backlight_pdata {
Expand Down

0 comments on commit a53957e

Please sign in to comment.