aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-designware-pcidrv.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index d2223b5f922b..9e89e7313d62 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -138,8 +138,9 @@ static struct i2c_algorithm i2c_dw_algo = {
138 .functionality = i2c_dw_func, 138 .functionality = i2c_dw_func,
139}; 139};
140 140
141static int i2c_dw_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) 141static int i2c_dw_pci_suspend(struct device *dev)
142{ 142{
143 struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
143 struct dw_i2c_dev *i2c = pci_get_drvdata(pdev); 144 struct dw_i2c_dev *i2c = pci_get_drvdata(pdev);
144 int err; 145 int err;
145 146
@@ -161,15 +162,9 @@ static int i2c_dw_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
161 return 0; 162 return 0;
162} 163}
163 164
164static int i2c_dw_pci_runtime_suspend(struct device *dev) 165static int i2c_dw_pci_resume(struct device *dev)
165{
166 struct pci_dev *pdev = to_pci_dev(dev);
167 dev_dbg(dev, "PCI suspend called\n");
168 return i2c_dw_pci_suspend(pdev, PMSG_SUSPEND);
169}
170
171static int i2c_dw_pci_resume(struct pci_dev *pdev)
172{ 166{
167 struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
173 struct dw_i2c_dev *i2c = pci_get_drvdata(pdev); 168 struct dw_i2c_dev *i2c = pci_get_drvdata(pdev);
174 int err; 169 int err;
175 u32 enabled; 170 u32 enabled;
@@ -191,13 +186,6 @@ static int i2c_dw_pci_resume(struct pci_dev *pdev)
191 return 0; 186 return 0;
192} 187}
193 188
194static int i2c_dw_pci_runtime_resume(struct device *dev)
195{
196 struct pci_dev *pdev = to_pci_dev(dev);
197 dev_dbg(dev, "runtime_resume called\n");
198 return i2c_dw_pci_resume(pdev);
199}
200
201static int i2c_dw_pci_runtime_idle(struct device *dev) 189static int i2c_dw_pci_runtime_idle(struct device *dev)
202{ 190{
203 int err = pm_schedule_suspend(dev, 500); 191 int err = pm_schedule_suspend(dev, 500);
@@ -209,9 +197,10 @@ static int i2c_dw_pci_runtime_idle(struct device *dev)
209} 197}
210 198
211static const struct dev_pm_ops i2c_dw_pm_ops = { 199static const struct dev_pm_ops i2c_dw_pm_ops = {
212 .runtime_suspend = i2c_dw_pci_runtime_suspend, 200 .resume = i2c_dw_pci_resume,
213 .runtime_resume = i2c_dw_pci_runtime_resume, 201 .suspend = i2c_dw_pci_suspend,
214 .runtime_idle = i2c_dw_pci_runtime_idle, 202 SET_RUNTIME_PM_OPS(i2c_dw_pci_suspend, i2c_dw_pci_resume,
203 i2c_dw_pci_runtime_idle)
215}; 204};
216 205
217static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev) 206static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
@@ -381,8 +370,6 @@ static struct pci_driver dw_i2c_driver = {
381 .id_table = i2_designware_pci_ids, 370 .id_table = i2_designware_pci_ids,
382 .probe = i2c_dw_pci_probe, 371 .probe = i2c_dw_pci_probe,
383 .remove = __devexit_p(i2c_dw_pci_remove), 372 .remove = __devexit_p(i2c_dw_pci_remove),
384 .resume = i2c_dw_pci_resume,
385 .suspend = i2c_dw_pci_suspend,
386 .driver = { 373 .driver = {
387 .pm = &i2c_dw_pm_ops, 374 .pm = &i2c_dw_pm_ops,
388 }, 375 },