diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:42 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:42 -0400 |
commit | bfaa07bc322085582bdc40babb9d0cce17b57380 (patch) | |
tree | 7e16d1fe32b68cb78d0a2fbe154345fbeb603648 /drivers/platform | |
parent | 6148d38b37ce9468cdf5a37ca49b4ac5c091e8fa (diff) | |
parent | b45bae36b805287c76366c908de58b5c2c0d46b0 (diff) |
Merge branch 'pm-drivers'
* pm-drivers:
rtc-cmos: report wakeups from interrupt handler
PM / crypto / ux500: Use struct dev_pm_ops for power management
PM / IPMI: Remove empty legacy PCI PM callbacks
tpm_nsc: Use struct dev_pm_ops for power management
tpm_tis: Use struct dev_pm_ops for power management
tpm_atmel: Use struct dev_pm_ops for power management
PM / TPM: Drop unused pm_message_t argument from tpm_pm_suspend()
omap-rng: Use struct dev_pm_ops for power management
mg_disk: Use struct dev_pm_ops for power management
msi-laptop: Use struct dev_pm_ops for power management
hdaps: Use struct dev_pm_ops for power management
sonypi: Use struct dev_pm_ops for power management
intel_mid_thermal: Use struct dev_pm_ops for power management
acer-wmi: Use struct dev_pm_ops for power management
intel_ips: Remove empty legacy PM callbacks
thinkpad_acpi: Use struct dev_pm_ops instead of legacy PM routines
thinkpad_acpi: Drop pm_message_t arguments from suspend routines
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 10 | ||||
-rw-r--r-- | drivers/platform/x86/hdaps.c | 6 | ||||
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 17 | ||||
-rw-r--r-- | drivers/platform/x86/intel_mid_thermal.c | 16 | ||||
-rw-r--r-- | drivers/platform/x86/msi-laptop.c | 7 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 23 |
6 files changed, 34 insertions, 45 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index ce875dc365e5..c8f40c9c0428 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -1877,8 +1877,7 @@ static int acer_platform_remove(struct platform_device *device) | |||
1877 | return 0; | 1877 | return 0; |
1878 | } | 1878 | } |
1879 | 1879 | ||
1880 | static int acer_platform_suspend(struct platform_device *dev, | 1880 | static int acer_suspend(struct device *dev) |
1881 | pm_message_t state) | ||
1882 | { | 1881 | { |
1883 | u32 value; | 1882 | u32 value; |
1884 | struct acer_data *data = &interface->data; | 1883 | struct acer_data *data = &interface->data; |
@@ -1900,7 +1899,7 @@ pm_message_t state) | |||
1900 | return 0; | 1899 | return 0; |
1901 | } | 1900 | } |
1902 | 1901 | ||
1903 | static int acer_platform_resume(struct platform_device *device) | 1902 | static int acer_resume(struct device *dev) |
1904 | { | 1903 | { |
1905 | struct acer_data *data = &interface->data; | 1904 | struct acer_data *data = &interface->data; |
1906 | 1905 | ||
@@ -1916,6 +1915,8 @@ static int acer_platform_resume(struct platform_device *device) | |||
1916 | return 0; | 1915 | return 0; |
1917 | } | 1916 | } |
1918 | 1917 | ||
1918 | static SIMPLE_DEV_PM_OPS(acer_pm, acer_suspend, acer_resume); | ||
1919 | |||
1919 | static void acer_platform_shutdown(struct platform_device *device) | 1920 | static void acer_platform_shutdown(struct platform_device *device) |
1920 | { | 1921 | { |
1921 | struct acer_data *data = &interface->data; | 1922 | struct acer_data *data = &interface->data; |
@@ -1931,11 +1932,10 @@ static struct platform_driver acer_platform_driver = { | |||
1931 | .driver = { | 1932 | .driver = { |
1932 | .name = "acer-wmi", | 1933 | .name = "acer-wmi", |
1933 | .owner = THIS_MODULE, | 1934 | .owner = THIS_MODULE, |
1935 | .pm = &acer_pm, | ||
1934 | }, | 1936 | }, |
1935 | .probe = acer_platform_probe, | 1937 | .probe = acer_platform_probe, |
1936 | .remove = acer_platform_remove, | 1938 | .remove = acer_platform_remove, |
1937 | .suspend = acer_platform_suspend, | ||
1938 | .resume = acer_platform_resume, | ||
1939 | .shutdown = acer_platform_shutdown, | 1939 | .shutdown = acer_platform_shutdown, |
1940 | }; | 1940 | }; |
1941 | 1941 | ||
diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c index 24a3ae065f1b..d9ab6f64dcec 100644 --- a/drivers/platform/x86/hdaps.c +++ b/drivers/platform/x86/hdaps.c | |||
@@ -305,17 +305,19 @@ static int hdaps_probe(struct platform_device *dev) | |||
305 | return 0; | 305 | return 0; |
306 | } | 306 | } |
307 | 307 | ||
308 | static int hdaps_resume(struct platform_device *dev) | 308 | static int hdaps_resume(struct device *dev) |
309 | { | 309 | { |
310 | return hdaps_device_init(); | 310 | return hdaps_device_init(); |
311 | } | 311 | } |
312 | 312 | ||
313 | static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume); | ||
314 | |||
313 | static struct platform_driver hdaps_driver = { | 315 | static struct platform_driver hdaps_driver = { |
314 | .probe = hdaps_probe, | 316 | .probe = hdaps_probe, |
315 | .resume = hdaps_resume, | ||
316 | .driver = { | 317 | .driver = { |
317 | .name = "hdaps", | 318 | .name = "hdaps", |
318 | .owner = THIS_MODULE, | 319 | .owner = THIS_MODULE, |
320 | .pm = &hdaps_pm, | ||
319 | }, | 321 | }, |
320 | }; | 322 | }; |
321 | 323 | ||
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 0ffdb3cde2bb..bd89f3c8e76e 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -1697,21 +1697,6 @@ static void ips_remove(struct pci_dev *dev) | |||
1697 | dev_dbg(&dev->dev, "IPS driver removed\n"); | 1697 | dev_dbg(&dev->dev, "IPS driver removed\n"); |
1698 | } | 1698 | } |
1699 | 1699 | ||
1700 | #ifdef CONFIG_PM | ||
1701 | static int ips_suspend(struct pci_dev *dev, pm_message_t state) | ||
1702 | { | ||
1703 | return 0; | ||
1704 | } | ||
1705 | |||
1706 | static int ips_resume(struct pci_dev *dev) | ||
1707 | { | ||
1708 | return 0; | ||
1709 | } | ||
1710 | #else | ||
1711 | #define ips_suspend NULL | ||
1712 | #define ips_resume NULL | ||
1713 | #endif /* CONFIG_PM */ | ||
1714 | |||
1715 | static void ips_shutdown(struct pci_dev *dev) | 1700 | static void ips_shutdown(struct pci_dev *dev) |
1716 | { | 1701 | { |
1717 | } | 1702 | } |
@@ -1721,8 +1706,6 @@ static struct pci_driver ips_pci_driver = { | |||
1721 | .id_table = ips_id_table, | 1706 | .id_table = ips_id_table, |
1722 | .probe = ips_probe, | 1707 | .probe = ips_probe, |
1723 | .remove = ips_remove, | 1708 | .remove = ips_remove, |
1724 | .suspend = ips_suspend, | ||
1725 | .resume = ips_resume, | ||
1726 | .shutdown = ips_shutdown, | 1709 | .shutdown = ips_shutdown, |
1727 | }; | 1710 | }; |
1728 | 1711 | ||
diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c index 5ae9cd9c7e6e..ea7422f6fa03 100644 --- a/drivers/platform/x86/intel_mid_thermal.c +++ b/drivers/platform/x86/intel_mid_thermal.c | |||
@@ -418,23 +418,23 @@ static struct thermal_device_info *initialize_sensor(int index) | |||
418 | 418 | ||
419 | /** | 419 | /** |
420 | * mid_thermal_resume - resume routine | 420 | * mid_thermal_resume - resume routine |
421 | * @pdev: platform device structure | 421 | * @dev: device structure |
422 | * | 422 | * |
423 | * mid thermal resume: re-initializes the adc. Can sleep. | 423 | * mid thermal resume: re-initializes the adc. Can sleep. |
424 | */ | 424 | */ |
425 | static int mid_thermal_resume(struct platform_device *pdev) | 425 | static int mid_thermal_resume(struct device *dev) |
426 | { | 426 | { |
427 | return mid_initialize_adc(&pdev->dev); | 427 | return mid_initialize_adc(dev); |
428 | } | 428 | } |
429 | 429 | ||
430 | /** | 430 | /** |
431 | * mid_thermal_suspend - suspend routine | 431 | * mid_thermal_suspend - suspend routine |
432 | * @pdev: platform device structure | 432 | * @dev: device structure |
433 | * | 433 | * |
434 | * mid thermal suspend implements the suspend functionality | 434 | * mid thermal suspend implements the suspend functionality |
435 | * by stopping the ADC. Can sleep. | 435 | * by stopping the ADC. Can sleep. |
436 | */ | 436 | */ |
437 | static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) | 437 | static int mid_thermal_suspend(struct device *dev) |
438 | { | 438 | { |
439 | /* | 439 | /* |
440 | * This just stops the ADC and does not disable it. | 440 | * This just stops the ADC and does not disable it. |
@@ -444,6 +444,9 @@ static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
444 | return configure_adc(0); | 444 | return configure_adc(0); |
445 | } | 445 | } |
446 | 446 | ||
447 | static SIMPLE_DEV_PM_OPS(mid_thermal_pm, | ||
448 | mid_thermal_suspend, mid_thermal_resume); | ||
449 | |||
447 | /** | 450 | /** |
448 | * read_curr_temp - reads the current temperature and stores in temp | 451 | * read_curr_temp - reads the current temperature and stores in temp |
449 | * @temp: holds the current temperature value after reading | 452 | * @temp: holds the current temperature value after reading |
@@ -557,10 +560,9 @@ static struct platform_driver mid_thermal_driver = { | |||
557 | .driver = { | 560 | .driver = { |
558 | .name = DRIVER_NAME, | 561 | .name = DRIVER_NAME, |
559 | .owner = THIS_MODULE, | 562 | .owner = THIS_MODULE, |
563 | .pm = &mid_thermal_pm, | ||
560 | }, | 564 | }, |
561 | .probe = mid_thermal_probe, | 565 | .probe = mid_thermal_probe, |
562 | .suspend = mid_thermal_suspend, | ||
563 | .resume = mid_thermal_resume, | ||
564 | .remove = __devexit_p(mid_thermal_remove), | 566 | .remove = __devexit_p(mid_thermal_remove), |
565 | .id_table = therm_id_table, | 567 | .id_table = therm_id_table, |
566 | }; | 568 | }; |
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c index bb5132128b33..f64441844317 100644 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c | |||
@@ -85,7 +85,8 @@ | |||
85 | #define MSI_STANDARD_EC_TOUCHPAD_ADDRESS 0xe4 | 85 | #define MSI_STANDARD_EC_TOUCHPAD_ADDRESS 0xe4 |
86 | #define MSI_STANDARD_EC_TOUCHPAD_MASK (1 << 4) | 86 | #define MSI_STANDARD_EC_TOUCHPAD_MASK (1 << 4) |
87 | 87 | ||
88 | static int msi_laptop_resume(struct platform_device *device); | 88 | static int msi_laptop_resume(struct device *device); |
89 | static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume); | ||
89 | 90 | ||
90 | #define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f | 91 | #define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f |
91 | 92 | ||
@@ -437,8 +438,8 @@ static struct platform_driver msipf_driver = { | |||
437 | .driver = { | 438 | .driver = { |
438 | .name = "msi-laptop-pf", | 439 | .name = "msi-laptop-pf", |
439 | .owner = THIS_MODULE, | 440 | .owner = THIS_MODULE, |
441 | .pm = &msi_laptop_pm, | ||
440 | }, | 442 | }, |
441 | .resume = msi_laptop_resume, | ||
442 | }; | 443 | }; |
443 | 444 | ||
444 | static struct platform_device *msipf_device; | 445 | static struct platform_device *msipf_device; |
@@ -752,7 +753,7 @@ err_bluetooth: | |||
752 | return retval; | 753 | return retval; |
753 | } | 754 | } |
754 | 755 | ||
755 | static int msi_laptop_resume(struct platform_device *device) | 756 | static int msi_laptop_resume(struct device *device) |
756 | { | 757 | { |
757 | u8 data; | 758 | u8 data; |
758 | int result; | 759 | int result; |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 8b5610d88418..d5fd4a1193f8 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -277,7 +277,7 @@ struct ibm_struct { | |||
277 | int (*write) (char *); | 277 | int (*write) (char *); |
278 | void (*exit) (void); | 278 | void (*exit) (void); |
279 | void (*resume) (void); | 279 | void (*resume) (void); |
280 | void (*suspend) (pm_message_t state); | 280 | void (*suspend) (void); |
281 | void (*shutdown) (void); | 281 | void (*shutdown) (void); |
282 | 282 | ||
283 | struct list_head all_drivers; | 283 | struct list_head all_drivers; |
@@ -922,8 +922,7 @@ static struct input_dev *tpacpi_inputdev; | |||
922 | static struct mutex tpacpi_inputdev_send_mutex; | 922 | static struct mutex tpacpi_inputdev_send_mutex; |
923 | static LIST_HEAD(tpacpi_all_drivers); | 923 | static LIST_HEAD(tpacpi_all_drivers); |
924 | 924 | ||
925 | static int tpacpi_suspend_handler(struct platform_device *pdev, | 925 | static int tpacpi_suspend_handler(struct device *dev) |
926 | pm_message_t state) | ||
927 | { | 926 | { |
928 | struct ibm_struct *ibm, *itmp; | 927 | struct ibm_struct *ibm, *itmp; |
929 | 928 | ||
@@ -931,13 +930,13 @@ static int tpacpi_suspend_handler(struct platform_device *pdev, | |||
931 | &tpacpi_all_drivers, | 930 | &tpacpi_all_drivers, |
932 | all_drivers) { | 931 | all_drivers) { |
933 | if (ibm->suspend) | 932 | if (ibm->suspend) |
934 | (ibm->suspend)(state); | 933 | (ibm->suspend)(); |
935 | } | 934 | } |
936 | 935 | ||
937 | return 0; | 936 | return 0; |
938 | } | 937 | } |
939 | 938 | ||
940 | static int tpacpi_resume_handler(struct platform_device *pdev) | 939 | static int tpacpi_resume_handler(struct device *dev) |
941 | { | 940 | { |
942 | struct ibm_struct *ibm, *itmp; | 941 | struct ibm_struct *ibm, *itmp; |
943 | 942 | ||
@@ -951,6 +950,9 @@ static int tpacpi_resume_handler(struct platform_device *pdev) | |||
951 | return 0; | 950 | return 0; |
952 | } | 951 | } |
953 | 952 | ||
953 | static SIMPLE_DEV_PM_OPS(tpacpi_pm, | ||
954 | tpacpi_suspend_handler, tpacpi_resume_handler); | ||
955 | |||
954 | static void tpacpi_shutdown_handler(struct platform_device *pdev) | 956 | static void tpacpi_shutdown_handler(struct platform_device *pdev) |
955 | { | 957 | { |
956 | struct ibm_struct *ibm, *itmp; | 958 | struct ibm_struct *ibm, *itmp; |
@@ -967,9 +969,8 @@ static struct platform_driver tpacpi_pdriver = { | |||
967 | .driver = { | 969 | .driver = { |
968 | .name = TPACPI_DRVR_NAME, | 970 | .name = TPACPI_DRVR_NAME, |
969 | .owner = THIS_MODULE, | 971 | .owner = THIS_MODULE, |
972 | .pm = &tpacpi_pm, | ||
970 | }, | 973 | }, |
971 | .suspend = tpacpi_suspend_handler, | ||
972 | .resume = tpacpi_resume_handler, | ||
973 | .shutdown = tpacpi_shutdown_handler, | 974 | .shutdown = tpacpi_shutdown_handler, |
974 | }; | 975 | }; |
975 | 976 | ||
@@ -3758,7 +3759,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
3758 | } | 3759 | } |
3759 | } | 3760 | } |
3760 | 3761 | ||
3761 | static void hotkey_suspend(pm_message_t state) | 3762 | static void hotkey_suspend(void) |
3762 | { | 3763 | { |
3763 | /* Do these on suspend, we get the events on early resume! */ | 3764 | /* Do these on suspend, we get the events on early resume! */ |
3764 | hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE; | 3765 | hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE; |
@@ -6329,7 +6330,7 @@ static int __init brightness_init(struct ibm_init_struct *iibm) | |||
6329 | return 0; | 6330 | return 0; |
6330 | } | 6331 | } |
6331 | 6332 | ||
6332 | static void brightness_suspend(pm_message_t state) | 6333 | static void brightness_suspend(void) |
6333 | { | 6334 | { |
6334 | tpacpi_brightness_checkpoint_nvram(); | 6335 | tpacpi_brightness_checkpoint_nvram(); |
6335 | } | 6336 | } |
@@ -6748,7 +6749,7 @@ static struct snd_kcontrol_new volume_alsa_control_mute __devinitdata = { | |||
6748 | .get = volume_alsa_mute_get, | 6749 | .get = volume_alsa_mute_get, |
6749 | }; | 6750 | }; |
6750 | 6751 | ||
6751 | static void volume_suspend(pm_message_t state) | 6752 | static void volume_suspend(void) |
6752 | { | 6753 | { |
6753 | tpacpi_volume_checkpoint_nvram(); | 6754 | tpacpi_volume_checkpoint_nvram(); |
6754 | } | 6755 | } |
@@ -8107,7 +8108,7 @@ static void fan_exit(void) | |||
8107 | flush_workqueue(tpacpi_wq); | 8108 | flush_workqueue(tpacpi_wq); |
8108 | } | 8109 | } |
8109 | 8110 | ||
8110 | static void fan_suspend(pm_message_t state) | 8111 | static void fan_suspend(void) |
8111 | { | 8112 | { |
8112 | int rc; | 8113 | int rc; |
8113 | 8114 | ||