Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308451
b: refs/heads/master
c: 531183e
h: refs/heads/master
i:
  308449: d4cf27c
  308447: c776a6c
v: v3
  • Loading branch information
Zhao Chenhui authored and Wolfram Sang committed May 12, 2012
1 parent 4f4392d commit 529b8c1
Show file tree
Hide file tree
Showing 2 changed files with 31 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: ad33707417e4fa3dd4b12f9ed912e2349a984026
refs/heads/master: 531183e5d27312d68fab40352cd13426aa761473
30 changes: 30 additions & 0 deletions trunk/drivers/i2c/busses/i2c-mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ struct mpc_i2c {
struct i2c_adapter adap;
int irq;
u32 real_clk;
#ifdef CONFIG_PM
u8 fdr, dfsrr;
#endif
};

struct mpc_i2c_divider {
Expand Down Expand Up @@ -703,6 +706,30 @@ static int __devexit fsl_i2c_remove(struct platform_device *op)
return 0;
};

#ifdef CONFIG_PM
static int mpc_i2c_suspend(struct device *dev)
{
struct mpc_i2c *i2c = dev_get_drvdata(dev);

i2c->fdr = readb(i2c->base + MPC_I2C_FDR);
i2c->dfsrr = readb(i2c->base + MPC_I2C_DFSRR);

return 0;
}

static int mpc_i2c_resume(struct device *dev)
{
struct mpc_i2c *i2c = dev_get_drvdata(dev);

writeb(i2c->fdr, i2c->base + MPC_I2C_FDR);
writeb(i2c->dfsrr, i2c->base + MPC_I2C_DFSRR);

return 0;
}

SIMPLE_DEV_PM_OPS(mpc_i2c_pm_ops, mpc_i2c_suspend, mpc_i2c_resume);
#endif

static struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
.setup = mpc_i2c_setup_512x,
};
Expand Down Expand Up @@ -747,6 +774,9 @@ static struct platform_driver mpc_i2c_driver = {
.owner = THIS_MODULE,
.name = DRV_NAME,
.of_match_table = mpc_i2c_of_match,
#ifdef CONFIG_PM
.pm = &mpc_i2c_pm_ops,
#endif
},
};

Expand Down

0 comments on commit 529b8c1

Please sign in to comment.