Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337069
b: refs/heads/master
c: 3e5e624
h: refs/heads/master
i:
  337067: db48fa5
v: v3
  • Loading branch information
Andres Salomon authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent 28befdf commit 2c75fb6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c98274cba3b68e6d87ddb3b0be2bec449106181
refs/heads/master: 3e5e624bfda39417cc76e716a350a318049dbd39
24 changes: 16 additions & 8 deletions trunk/drivers/staging/olpc_dcon/olpc_dcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,9 @@ static int dcon_remove(struct i2c_client *client)
}

#ifdef CONFIG_PM
static int dcon_suspend(struct i2c_client *client, pm_message_t state)
static int dcon_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct dcon_priv *dcon = i2c_get_clientdata(client);

if (!dcon->asleep) {
Expand All @@ -697,8 +698,9 @@ static int dcon_suspend(struct i2c_client *client, pm_message_t state)
return 0;
}

static int dcon_resume(struct i2c_client *client)
static int dcon_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct dcon_priv *dcon = i2c_get_clientdata(client);

if (!dcon->asleep) {
Expand All @@ -709,7 +711,12 @@ static int dcon_resume(struct i2c_client *client)
return 0;
}

#endif
#else

#define dcon_suspend NULL
#define dcon_resume NULL

#endif /* CONFIG_PM */


irqreturn_t dcon_interrupt(int irq, void *id)
Expand Down Expand Up @@ -753,27 +760,28 @@ irqreturn_t dcon_interrupt(int irq, void *id)
return IRQ_HANDLED;
}

static const struct dev_pm_ops dcon_pm_ops = {
.suspend = dcon_suspend,
.resume = dcon_resume,
};

static const struct i2c_device_id dcon_idtable[] = {
{ "olpc_dcon", 0 },
{ }
};

MODULE_DEVICE_TABLE(i2c, dcon_idtable);

struct i2c_driver dcon_driver = {
.driver = {
.name = "olpc_dcon",
.pm = &dcon_pm_ops,
},
.class = I2C_CLASS_DDC | I2C_CLASS_HWMON,
.id_table = dcon_idtable,
.probe = dcon_probe,
.remove = __devexit_p(dcon_remove),
.detect = dcon_detect,
.address_list = normal_i2c,
#ifdef CONFIG_PM
.suspend = dcon_suspend,
.resume = dcon_resume,
#endif
};

static int __init olpc_dcon_init(void)
Expand Down

0 comments on commit 2c75fb6

Please sign in to comment.