diff options
| -rw-r--r-- | drivers/base/platform.c | 115 | ||||
| -rw-r--r-- | include/linux/platform_device.h | 30 |
2 files changed, 1 insertions, 144 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 7a24895543e7..7d912d5675d8 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -700,25 +700,6 @@ static int platform_legacy_resume(struct device *dev) | |||
| 700 | return ret; | 700 | return ret; |
| 701 | } | 701 | } |
| 702 | 702 | ||
| 703 | int platform_pm_prepare(struct device *dev) | ||
| 704 | { | ||
| 705 | struct device_driver *drv = dev->driver; | ||
| 706 | int ret = 0; | ||
| 707 | |||
| 708 | if (drv && drv->pm && drv->pm->prepare) | ||
| 709 | ret = drv->pm->prepare(dev); | ||
| 710 | |||
| 711 | return ret; | ||
| 712 | } | ||
| 713 | |||
| 714 | void platform_pm_complete(struct device *dev) | ||
| 715 | { | ||
| 716 | struct device_driver *drv = dev->driver; | ||
| 717 | |||
| 718 | if (drv && drv->pm && drv->pm->complete) | ||
| 719 | drv->pm->complete(dev); | ||
| 720 | } | ||
| 721 | |||
| 722 | #endif /* CONFIG_PM_SLEEP */ | 703 | #endif /* CONFIG_PM_SLEEP */ |
| 723 | 704 | ||
| 724 | #ifdef CONFIG_SUSPEND | 705 | #ifdef CONFIG_SUSPEND |
| @@ -741,22 +722,6 @@ int platform_pm_suspend(struct device *dev) | |||
| 741 | return ret; | 722 | return ret; |
| 742 | } | 723 | } |
| 743 | 724 | ||
| 744 | int platform_pm_suspend_noirq(struct device *dev) | ||
| 745 | { | ||
| 746 | struct device_driver *drv = dev->driver; | ||
| 747 | int ret = 0; | ||
| 748 | |||
| 749 | if (!drv) | ||
| 750 | return 0; | ||
| 751 | |||
| 752 | if (drv->pm) { | ||
| 753 | if (drv->pm->suspend_noirq) | ||
| 754 | ret = drv->pm->suspend_noirq(dev); | ||
| 755 | } | ||
| 756 | |||
| 757 | return ret; | ||
| 758 | } | ||
| 759 | |||
| 760 | int platform_pm_resume(struct device *dev) | 725 | int platform_pm_resume(struct device *dev) |
| 761 | { | 726 | { |
| 762 | struct device_driver *drv = dev->driver; | 727 | struct device_driver *drv = dev->driver; |
| @@ -775,22 +740,6 @@ int platform_pm_resume(struct device *dev) | |||
| 775 | return ret; | 740 | return ret; |
| 776 | } | 741 | } |
| 777 | 742 | ||
| 778 | int platform_pm_resume_noirq(struct device *dev) | ||
| 779 | { | ||
| 780 | struct device_driver *drv = dev->driver; | ||
| 781 | int ret = 0; | ||
| 782 | |||
| 783 | if (!drv) | ||
| 784 | return 0; | ||
| 785 | |||
| 786 | if (drv->pm) { | ||
| 787 | if (drv->pm->resume_noirq) | ||
| 788 | ret = drv->pm->resume_noirq(dev); | ||
| 789 | } | ||
| 790 | |||
| 791 | return ret; | ||
| 792 | } | ||
| 793 | |||
| 794 | #endif /* CONFIG_SUSPEND */ | 743 | #endif /* CONFIG_SUSPEND */ |
| 795 | 744 | ||
| 796 | #ifdef CONFIG_HIBERNATE_CALLBACKS | 745 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| @@ -813,22 +762,6 @@ int platform_pm_freeze(struct device *dev) | |||
| 813 | return ret; | 762 | return ret; |
| 814 | } | 763 | } |
| 815 | 764 | ||
| 816 | int platform_pm_freeze_noirq(struct device *dev) | ||
| 817 | { | ||
| 818 | struct device_driver *drv = dev->driver; | ||
| 819 | int ret = 0; | ||
| 820 | |||
| 821 | if (!drv) | ||
| 822 | return 0; | ||
| 823 | |||
| 824 | if (drv->pm) { | ||
| 825 | if (drv->pm->freeze_noirq) | ||
| 826 | ret = drv->pm->freeze_noirq(dev); | ||
| 827 | } | ||
| 828 | |||
| 829 | return ret; | ||
| 830 | } | ||
| 831 | |||
| 832 | int platform_pm_thaw(struct device *dev) | 765 | int platform_pm_thaw(struct device *dev) |
| 833 | { | 766 | { |
| 834 | struct device_driver *drv = dev->driver; | 767 | struct device_driver *drv = dev->driver; |
| @@ -847,22 +780,6 @@ int platform_pm_thaw(struct device *dev) | |||
| 847 | return ret; | 780 | return ret; |
| 848 | } | 781 | } |
| 849 | 782 | ||
| 850 | int platform_pm_thaw_noirq(struct device *dev) | ||
| 851 | { | ||
| 852 | struct device_driver *drv = dev->driver; | ||
| 853 | int ret = 0; | ||
| 854 | |||
| 855 | if (!drv) | ||
| 856 | return 0; | ||
| 857 | |||
| 858 | if (drv->pm) { | ||
| 859 | if (drv->pm->thaw_noirq) | ||
| 860 | ret = drv->pm->thaw_noirq(dev); | ||
| 861 | } | ||
| 862 | |||
| 863 | return ret; | ||
| 864 | } | ||
| 865 | |||
| 866 | int platform_pm_poweroff(struct device *dev) | 783 | int platform_pm_poweroff(struct device *dev) |
| 867 | { | 784 | { |
| 868 | struct device_driver *drv = dev->driver; | 785 | struct device_driver *drv = dev->driver; |
| @@ -881,22 +798,6 @@ int platform_pm_poweroff(struct device *dev) | |||
| 881 | return ret; | 798 | return ret; |
| 882 | } | 799 | } |
| 883 | 800 | ||
| 884 | int platform_pm_poweroff_noirq(struct device *dev) | ||
| 885 | { | ||
| 886 | struct device_driver *drv = dev->driver; | ||
| 887 | int ret = 0; | ||
| 888 | |||
| 889 | if (!drv) | ||
| 890 | return 0; | ||
| 891 | |||
| 892 | if (drv->pm) { | ||
| 893 | if (drv->pm->poweroff_noirq) | ||
| 894 | ret = drv->pm->poweroff_noirq(dev); | ||
| 895 | } | ||
| 896 | |||
| 897 | return ret; | ||
| 898 | } | ||
| 899 | |||
| 900 | int platform_pm_restore(struct device *dev) | 801 | int platform_pm_restore(struct device *dev) |
| 901 | { | 802 | { |
| 902 | struct device_driver *drv = dev->driver; | 803 | struct device_driver *drv = dev->driver; |
| @@ -915,22 +816,6 @@ int platform_pm_restore(struct device *dev) | |||
| 915 | return ret; | 816 | return ret; |
| 916 | } | 817 | } |
| 917 | 818 | ||
| 918 | int platform_pm_restore_noirq(struct device *dev) | ||
| 919 | { | ||
| 920 | struct device_driver *drv = dev->driver; | ||
| 921 | int ret = 0; | ||
| 922 | |||
| 923 | if (!drv) | ||
| 924 | return 0; | ||
| 925 | |||
| 926 | if (drv->pm) { | ||
| 927 | if (drv->pm->restore_noirq) | ||
| 928 | ret = drv->pm->restore_noirq(dev); | ||
| 929 | } | ||
| 930 | |||
| 931 | return ret; | ||
| 932 | } | ||
| 933 | |||
| 934 | #endif /* CONFIG_HIBERNATE_CALLBACKS */ | 819 | #endif /* CONFIG_HIBERNATE_CALLBACKS */ |
| 935 | 820 | ||
| 936 | static const struct dev_pm_ops platform_dev_pm_ops = { | 821 | static const struct dev_pm_ops platform_dev_pm_ops = { |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 2a23f7d1a825..b5267c951161 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -264,62 +264,34 @@ static inline char *early_platform_driver_setup_func(void) \ | |||
| 264 | } | 264 | } |
| 265 | #endif /* MODULE */ | 265 | #endif /* MODULE */ |
| 266 | 266 | ||
| 267 | #ifdef CONFIG_PM_SLEEP | ||
| 268 | extern int platform_pm_prepare(struct device *dev); | ||
| 269 | extern void platform_pm_complete(struct device *dev); | ||
| 270 | #else | ||
| 271 | #define platform_pm_prepare NULL | ||
| 272 | #define platform_pm_complete NULL | ||
| 273 | #endif | ||
| 274 | |||
| 275 | #ifdef CONFIG_SUSPEND | 267 | #ifdef CONFIG_SUSPEND |
| 276 | extern int platform_pm_suspend(struct device *dev); | 268 | extern int platform_pm_suspend(struct device *dev); |
| 277 | extern int platform_pm_suspend_noirq(struct device *dev); | ||
| 278 | extern int platform_pm_resume(struct device *dev); | 269 | extern int platform_pm_resume(struct device *dev); |
| 279 | extern int platform_pm_resume_noirq(struct device *dev); | ||
| 280 | #else | 270 | #else |
| 281 | #define platform_pm_suspend NULL | 271 | #define platform_pm_suspend NULL |
| 282 | #define platform_pm_resume NULL | 272 | #define platform_pm_resume NULL |
| 283 | #define platform_pm_suspend_noirq NULL | ||
| 284 | #define platform_pm_resume_noirq NULL | ||
| 285 | #endif | 273 | #endif |
| 286 | 274 | ||
| 287 | #ifdef CONFIG_HIBERNATE_CALLBACKS | 275 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
| 288 | extern int platform_pm_freeze(struct device *dev); | 276 | extern int platform_pm_freeze(struct device *dev); |
| 289 | extern int platform_pm_freeze_noirq(struct device *dev); | ||
| 290 | extern int platform_pm_thaw(struct device *dev); | 277 | extern int platform_pm_thaw(struct device *dev); |
| 291 | extern int platform_pm_thaw_noirq(struct device *dev); | ||
| 292 | extern int platform_pm_poweroff(struct device *dev); | 278 | extern int platform_pm_poweroff(struct device *dev); |
| 293 | extern int platform_pm_poweroff_noirq(struct device *dev); | ||
| 294 | extern int platform_pm_restore(struct device *dev); | 279 | extern int platform_pm_restore(struct device *dev); |
| 295 | extern int platform_pm_restore_noirq(struct device *dev); | ||
| 296 | #else | 280 | #else |
| 297 | #define platform_pm_freeze NULL | 281 | #define platform_pm_freeze NULL |
| 298 | #define platform_pm_thaw NULL | 282 | #define platform_pm_thaw NULL |
| 299 | #define platform_pm_poweroff NULL | 283 | #define platform_pm_poweroff NULL |
| 300 | #define platform_pm_restore NULL | 284 | #define platform_pm_restore NULL |
| 301 | #define platform_pm_freeze_noirq NULL | ||
| 302 | #define platform_pm_thaw_noirq NULL | ||
| 303 | #define platform_pm_poweroff_noirq NULL | ||
| 304 | #define platform_pm_restore_noirq NULL | ||
| 305 | #endif | 285 | #endif |
| 306 | 286 | ||
| 307 | #ifdef CONFIG_PM_SLEEP | 287 | #ifdef CONFIG_PM_SLEEP |
| 308 | #define USE_PLATFORM_PM_SLEEP_OPS \ | 288 | #define USE_PLATFORM_PM_SLEEP_OPS \ |
| 309 | .prepare = platform_pm_prepare, \ | ||
| 310 | .complete = platform_pm_complete, \ | ||
| 311 | .suspend = platform_pm_suspend, \ | 289 | .suspend = platform_pm_suspend, \ |
| 312 | .resume = platform_pm_resume, \ | 290 | .resume = platform_pm_resume, \ |
| 313 | .freeze = platform_pm_freeze, \ | 291 | .freeze = platform_pm_freeze, \ |
| 314 | .thaw = platform_pm_thaw, \ | 292 | .thaw = platform_pm_thaw, \ |
| 315 | .poweroff = platform_pm_poweroff, \ | 293 | .poweroff = platform_pm_poweroff, \ |
| 316 | .restore = platform_pm_restore, \ | 294 | .restore = platform_pm_restore, |
| 317 | .suspend_noirq = platform_pm_suspend_noirq, \ | ||
| 318 | .resume_noirq = platform_pm_resume_noirq, \ | ||
| 319 | .freeze_noirq = platform_pm_freeze_noirq, \ | ||
| 320 | .thaw_noirq = platform_pm_thaw_noirq, \ | ||
| 321 | .poweroff_noirq = platform_pm_poweroff_noirq, \ | ||
| 322 | .restore_noirq = platform_pm_restore_noirq, | ||
| 323 | #else | 295 | #else |
| 324 | #define USE_PLATFORM_PM_SLEEP_OPS | 296 | #define USE_PLATFORM_PM_SLEEP_OPS |
| 325 | #endif | 297 | #endif |
