Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272457
b: refs/heads/master
c: 52c2843
h: refs/heads/master
i:
  272455: 8b58675
v: v3
  • Loading branch information
Octavian Purdila authored and Ben Dooks committed Oct 29, 2011
1 parent 5ef23f0 commit 157a500
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 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: 18dbdda89f5cf0540e577280395f16079308e87d
refs/heads/master: 52c2843322362bfd847bdda1d3cebc751de68e5b
29 changes: 8 additions & 21 deletions trunk/drivers/i2c/busses/i2c-designware-pcidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ static struct i2c_algorithm i2c_dw_algo = {
.functionality = i2c_dw_func,
};

static int i2c_dw_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
static int i2c_dw_pci_suspend(struct device *dev)
{
struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
struct dw_i2c_dev *i2c = pci_get_drvdata(pdev);
int err;

Expand All @@ -161,15 +162,9 @@ static int i2c_dw_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
return 0;
}

static int i2c_dw_pci_runtime_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
dev_dbg(dev, "PCI suspend called\n");
return i2c_dw_pci_suspend(pdev, PMSG_SUSPEND);
}

static int i2c_dw_pci_resume(struct pci_dev *pdev)
static int i2c_dw_pci_resume(struct device *dev)
{
struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
struct dw_i2c_dev *i2c = pci_get_drvdata(pdev);
int err;
u32 enabled;
Expand All @@ -191,13 +186,6 @@ static int i2c_dw_pci_resume(struct pci_dev *pdev)
return 0;
}

static int i2c_dw_pci_runtime_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
dev_dbg(dev, "runtime_resume called\n");
return i2c_dw_pci_resume(pdev);
}

static int i2c_dw_pci_runtime_idle(struct device *dev)
{
int err = pm_schedule_suspend(dev, 500);
Expand All @@ -209,9 +197,10 @@ static int i2c_dw_pci_runtime_idle(struct device *dev)
}

static const struct dev_pm_ops i2c_dw_pm_ops = {
.runtime_suspend = i2c_dw_pci_runtime_suspend,
.runtime_resume = i2c_dw_pci_runtime_resume,
.runtime_idle = i2c_dw_pci_runtime_idle,
.resume = i2c_dw_pci_resume,
.suspend = i2c_dw_pci_suspend,
SET_RUNTIME_PM_OPS(i2c_dw_pci_suspend, i2c_dw_pci_resume,
i2c_dw_pci_runtime_idle)
};

static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
Expand Down Expand Up @@ -381,8 +370,6 @@ static struct pci_driver dw_i2c_driver = {
.id_table = i2_designware_pci_ids,
.probe = i2c_dw_pci_probe,
.remove = __devexit_p(i2c_dw_pci_remove),
.resume = i2c_dw_pci_resume,
.suspend = i2c_dw_pci_suspend,
.driver = {
.pm = &i2c_dw_pm_ops,
},
Expand Down

0 comments on commit 157a500

Please sign in to comment.