|
29 | 29 | #include <linux/reset.h> |
30 | 30 | #include <linux/sched.h> |
31 | 31 | #include <linux/slab.h> |
32 | | -#include <linux/suspend.h> |
33 | 32 | #include <linux/units.h> |
34 | 33 |
|
35 | 34 | #include "i2c-designware-core.h" |
@@ -339,67 +338,6 @@ static void dw_i2c_plat_remove(struct platform_device *pdev) |
339 | 338 | reset_control_assert(dev->rst); |
340 | 339 | } |
341 | 340 |
|
342 | | -static int dw_i2c_plat_prepare(struct device *dev) |
343 | | -{ |
344 | | - /* |
345 | | - * If the ACPI companion device object is present for this device, it |
346 | | - * may be accessed during suspend and resume of other devices via I2C |
347 | | - * operation regions, so tell the PM core and middle layers to avoid |
348 | | - * skipping system suspend/resume callbacks for it in that case. |
349 | | - */ |
350 | | - return !has_acpi_companion(dev); |
351 | | -} |
352 | | - |
353 | | -static int dw_i2c_plat_runtime_suspend(struct device *dev) |
354 | | -{ |
355 | | - struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); |
356 | | - |
357 | | - if (i_dev->shared_with_punit) |
358 | | - return 0; |
359 | | - |
360 | | - i2c_dw_disable(i_dev); |
361 | | - i2c_dw_prepare_clk(i_dev, false); |
362 | | - |
363 | | - return 0; |
364 | | -} |
365 | | - |
366 | | -static int dw_i2c_plat_suspend(struct device *dev) |
367 | | -{ |
368 | | - struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); |
369 | | - |
370 | | - i2c_mark_adapter_suspended(&i_dev->adapter); |
371 | | - |
372 | | - return dw_i2c_plat_runtime_suspend(dev); |
373 | | -} |
374 | | - |
375 | | -static int dw_i2c_plat_runtime_resume(struct device *dev) |
376 | | -{ |
377 | | - struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); |
378 | | - |
379 | | - if (!i_dev->shared_with_punit) |
380 | | - i2c_dw_prepare_clk(i_dev, true); |
381 | | - |
382 | | - i_dev->init(i_dev); |
383 | | - |
384 | | - return 0; |
385 | | -} |
386 | | - |
387 | | -static int dw_i2c_plat_resume(struct device *dev) |
388 | | -{ |
389 | | - struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); |
390 | | - |
391 | | - dw_i2c_plat_runtime_resume(dev); |
392 | | - i2c_mark_adapter_resumed(&i_dev->adapter); |
393 | | - |
394 | | - return 0; |
395 | | -} |
396 | | - |
397 | | -static const struct dev_pm_ops dw_i2c_dev_pm_ops = { |
398 | | - .prepare = pm_sleep_ptr(dw_i2c_plat_prepare), |
399 | | - LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) |
400 | | - RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL) |
401 | | -}; |
402 | | - |
403 | 341 | static const struct of_device_id dw_i2c_of_match[] = { |
404 | 342 | { .compatible = "snps,designware-i2c", }, |
405 | 343 | { .compatible = "mscc,ocelot-i2c", .data = (void *)MODEL_MSCC_OCELOT }, |
@@ -442,7 +380,7 @@ static struct platform_driver dw_i2c_driver = { |
442 | 380 | .name = "i2c_designware", |
443 | 381 | .of_match_table = dw_i2c_of_match, |
444 | 382 | .acpi_match_table = dw_i2c_acpi_match, |
445 | | - .pm = pm_ptr(&dw_i2c_dev_pm_ops), |
| 383 | + .pm = pm_ptr(&i2c_dw_dev_pm_ops), |
446 | 384 | }, |
447 | 385 | .id_table = dw_i2c_platform_ids, |
448 | 386 | }; |
|
0 commit comments