aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-22 16:36:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-22 16:36:52 -0400
commit7100e505b76b4e2efd88b2459d1a932214e29f8a (patch)
treea8eae8687dc1511c89463b1eb93c8349a7471ab3 /drivers/platform
parentcb47c1831fa406c964468b259f2082c16cc3f757 (diff)
parent75a4161a58dd157a2bd2dc8e9986e45b62ac46cf (diff)
Merge tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: - ACPI conversion to PM handling based on struct dev_pm_ops. - Conversion of a number of platform drivers to PM handling based on struct dev_pm_ops and removal of empty legacy PM callbacks from a couple of PCI drivers. - Suspend-to-both for in-kernel hibernation from Bojan Smojver. - cpuidle fixes and cleanups from ShuoX Liu, Daniel Lezcano and Preeti Murthy. - cpufreq bug fixes from Jonghwa Lee and Stephen Boyd. - Suspend and hibernate fixes from Srivatsa Bhat and Colin Cross. - Generic PM domains framework updates. - RTC CMOS wakeup signaling update from Paul Fox. - sparse warnings fixes from Sachin Kamat. - Build warnings fixes for the generic PM domains framework and PM sysfs code. - sysfs switch for printing device suspend times from Sameer Nanda. - Documentation fix from Oskar Schirmer. * tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (70 commits) cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch EXYNOS: bugfix on retrieving old_index from freqs.old PM / Sleep: call early resume handlers when suspend_noirq fails PM / QoS: Use NULL pointer instead of plain integer in qos.c PM / QoS: Use NULL pointer instead of plain integer in pm_qos.h PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock PM / Sleep: Add missing static storage class specifiers in main.c cpuilde / ACPI: remove time from acpi_processor_cx structure cpuidle / ACPI: remove usage from acpi_processor_cx structure cpuidle / ACPI : remove latency_ticks from acpi_processor_cx structure rtc-cmos: report wakeups from interrupt handler PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset olpc-xo15-sci: Use struct dev_pm_ops for power management PM / Domains: Replace plain integer with NULL pointer in domain.c file PM / Domains: Add missing static storage class specifier in domain.c file 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 ...
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/acer-wmi.c10
-rw-r--r--drivers/platform/x86/classmate-laptop.c13
-rw-r--r--drivers/platform/x86/fujitsu-tablet.c8
-rw-r--r--drivers/platform/x86/hdaps.c6
-rw-r--r--drivers/platform/x86/hp_accel.c15
-rw-r--r--drivers/platform/x86/intel_ips.c17
-rw-r--r--drivers/platform/x86/intel_mid_thermal.c16
-rw-r--r--drivers/platform/x86/msi-laptop.c7
-rw-r--r--drivers/platform/x86/panasonic-laptop.c16
-rw-r--r--drivers/platform/x86/sony-laptop.c20
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c23
-rw-r--r--drivers/platform/x86/toshiba_acpi.c15
-rw-r--r--drivers/platform/x86/toshiba_bluetooth.c10
-rw-r--r--drivers/platform/x86/xo15-ebook.c8
14 files changed, 97 insertions, 87 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
1880static int acer_platform_suspend(struct platform_device *dev, 1880static int acer_suspend(struct device *dev)
1881pm_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
1903static int acer_platform_resume(struct platform_device *device) 1902static 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
1918static SIMPLE_DEV_PM_OPS(acer_pm, acer_suspend, acer_resume);
1919
1919static void acer_platform_shutdown(struct platform_device *device) 1920static 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/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 94f93b621d7b..e2230a2b2f8e 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -362,15 +362,18 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type)
362 return cmpc_remove_acpi_notify_device(acpi); 362 return cmpc_remove_acpi_notify_device(acpi);
363} 363}
364 364
365static int cmpc_tablet_resume(struct acpi_device *acpi) 365static int cmpc_tablet_resume(struct device *dev)
366{ 366{
367 struct input_dev *inputdev = dev_get_drvdata(&acpi->dev); 367 struct input_dev *inputdev = dev_get_drvdata(dev);
368
368 unsigned long long val = 0; 369 unsigned long long val = 0;
369 if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) 370 if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val)))
370 input_report_switch(inputdev, SW_TABLET_MODE, !val); 371 input_report_switch(inputdev, SW_TABLET_MODE, !val);
371 return 0; 372 return 0;
372} 373}
373 374
375static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume);
376
374static const struct acpi_device_id cmpc_tablet_device_ids[] = { 377static const struct acpi_device_id cmpc_tablet_device_ids[] = {
375 {CMPC_TABLET_HID, 0}, 378 {CMPC_TABLET_HID, 0},
376 {"", 0} 379 {"", 0}
@@ -384,9 +387,9 @@ static struct acpi_driver cmpc_tablet_acpi_driver = {
384 .ops = { 387 .ops = {
385 .add = cmpc_tablet_add, 388 .add = cmpc_tablet_add,
386 .remove = cmpc_tablet_remove, 389 .remove = cmpc_tablet_remove,
387 .resume = cmpc_tablet_resume,
388 .notify = cmpc_tablet_handler, 390 .notify = cmpc_tablet_handler,
389 } 391 },
392 .drv.pm = &cmpc_tablet_pm,
390}; 393};
391 394
392 395
diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c
index da267eae8ba8..d2e41735a47b 100644
--- a/drivers/platform/x86/fujitsu-tablet.c
+++ b/drivers/platform/x86/fujitsu-tablet.c
@@ -440,12 +440,14 @@ static int __devexit acpi_fujitsu_remove(struct acpi_device *adev, int type)
440 return 0; 440 return 0;
441} 441}
442 442
443static int acpi_fujitsu_resume(struct acpi_device *adev) 443static int acpi_fujitsu_resume(struct device *dev)
444{ 444{
445 fujitsu_reset(); 445 fujitsu_reset();
446 return 0; 446 return 0;
447} 447}
448 448
449static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume);
450
449static struct acpi_driver acpi_fujitsu_driver = { 451static struct acpi_driver acpi_fujitsu_driver = {
450 .name = MODULENAME, 452 .name = MODULENAME,
451 .class = "hotkey", 453 .class = "hotkey",
@@ -453,8 +455,8 @@ static struct acpi_driver acpi_fujitsu_driver = {
453 .ops = { 455 .ops = {
454 .add = acpi_fujitsu_add, 456 .add = acpi_fujitsu_add,
455 .remove = acpi_fujitsu_remove, 457 .remove = acpi_fujitsu_remove,
456 .resume = acpi_fujitsu_resume, 458 },
457 } 459 .drv.pm = &acpi_fujitsu_pm,
458}; 460};
459 461
460static int __init fujitsu_module_init(void) 462static int __init fujitsu_module_init(void)
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
308static int hdaps_resume(struct platform_device *dev) 308static int hdaps_resume(struct device *dev)
309{ 309{
310 return hdaps_device_init(); 310 return hdaps_device_init();
311} 311}
312 312
313static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume);
314
313static struct platform_driver hdaps_driver = { 315static 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/hp_accel.c b/drivers/platform/x86/hp_accel.c
index 22b2dfa73148..f4d91154ad67 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -353,20 +353,22 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
353 353
354 354
355#ifdef CONFIG_PM 355#ifdef CONFIG_PM
356static int lis3lv02d_suspend(struct acpi_device *device, pm_message_t state) 356static int lis3lv02d_suspend(struct device *dev)
357{ 357{
358 /* make sure the device is off when we suspend */ 358 /* make sure the device is off when we suspend */
359 lis3lv02d_poweroff(&lis3_dev); 359 lis3lv02d_poweroff(&lis3_dev);
360 return 0; 360 return 0;
361} 361}
362 362
363static int lis3lv02d_resume(struct acpi_device *device) 363static int lis3lv02d_resume(struct device *dev)
364{ 364{
365 return lis3lv02d_poweron(&lis3_dev); 365 return lis3lv02d_poweron(&lis3_dev);
366} 366}
367
368static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume);
369#define HP_ACCEL_PM (&hp_accel_pm)
367#else 370#else
368#define lis3lv02d_suspend NULL 371#define HP_ACCEL_PM NULL
369#define lis3lv02d_resume NULL
370#endif 372#endif
371 373
372/* For the HP MDPS aka 3D Driveguard */ 374/* For the HP MDPS aka 3D Driveguard */
@@ -377,9 +379,8 @@ static struct acpi_driver lis3lv02d_driver = {
377 .ops = { 379 .ops = {
378 .add = lis3lv02d_add, 380 .add = lis3lv02d_add,
379 .remove = lis3lv02d_remove, 381 .remove = lis3lv02d_remove,
380 .suspend = lis3lv02d_suspend, 382 },
381 .resume = lis3lv02d_resume, 383 .drv.pm = HP_ACCEL_PM,
382 }
383}; 384};
384 385
385static int __init lis3lv02d_init_module(void) 386static int __init lis3lv02d_init_module(void)
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index 9af4257d4901..5051aa970e0a 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -1719,21 +1719,6 @@ static void ips_remove(struct pci_dev *dev)
1719 dev_dbg(&dev->dev, "IPS driver removed\n"); 1719 dev_dbg(&dev->dev, "IPS driver removed\n");
1720} 1720}
1721 1721
1722#ifdef CONFIG_PM
1723static int ips_suspend(struct pci_dev *dev, pm_message_t state)
1724{
1725 return 0;
1726}
1727
1728static int ips_resume(struct pci_dev *dev)
1729{
1730 return 0;
1731}
1732#else
1733#define ips_suspend NULL
1734#define ips_resume NULL
1735#endif /* CONFIG_PM */
1736
1737static void ips_shutdown(struct pci_dev *dev) 1722static void ips_shutdown(struct pci_dev *dev)
1738{ 1723{
1739} 1724}
@@ -1743,8 +1728,6 @@ static struct pci_driver ips_pci_driver = {
1743 .id_table = ips_id_table, 1728 .id_table = ips_id_table,
1744 .probe = ips_probe, 1729 .probe = ips_probe,
1745 .remove = ips_remove, 1730 .remove = ips_remove,
1746 .suspend = ips_suspend,
1747 .resume = ips_resume,
1748 .shutdown = ips_shutdown, 1731 .shutdown = ips_shutdown,
1749}; 1732};
1750 1733
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 */
425static int mid_thermal_resume(struct platform_device *pdev) 425static 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 */
437static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) 437static 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
447static 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
88static int msi_laptop_resume(struct platform_device *device); 88static int msi_laptop_resume(struct device *device);
89static 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
444static struct platform_device *msipf_device; 445static struct platform_device *msipf_device;
@@ -752,7 +753,7 @@ err_bluetooth:
752 return retval; 753 return retval;
753} 754}
754 755
755static int msi_laptop_resume(struct platform_device *device) 756static 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/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index ffff8b4b4949..24480074bcf0 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -177,7 +177,6 @@ enum SINF_BITS { SINF_NUM_BATTERIES = 0,
177 177
178static int acpi_pcc_hotkey_add(struct acpi_device *device); 178static int acpi_pcc_hotkey_add(struct acpi_device *device);
179static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type); 179static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type);
180static int acpi_pcc_hotkey_resume(struct acpi_device *device);
181static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event); 180static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event);
182 181
183static const struct acpi_device_id pcc_device_ids[] = { 182static const struct acpi_device_id pcc_device_ids[] = {
@@ -189,6 +188,9 @@ static const struct acpi_device_id pcc_device_ids[] = {
189}; 188};
190MODULE_DEVICE_TABLE(acpi, pcc_device_ids); 189MODULE_DEVICE_TABLE(acpi, pcc_device_ids);
191 190
191static int acpi_pcc_hotkey_resume(struct device *dev);
192static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume);
193
192static struct acpi_driver acpi_pcc_driver = { 194static struct acpi_driver acpi_pcc_driver = {
193 .name = ACPI_PCC_DRIVER_NAME, 195 .name = ACPI_PCC_DRIVER_NAME,
194 .class = ACPI_PCC_CLASS, 196 .class = ACPI_PCC_CLASS,
@@ -196,9 +198,9 @@ static struct acpi_driver acpi_pcc_driver = {
196 .ops = { 198 .ops = {
197 .add = acpi_pcc_hotkey_add, 199 .add = acpi_pcc_hotkey_add,
198 .remove = acpi_pcc_hotkey_remove, 200 .remove = acpi_pcc_hotkey_remove,
199 .resume = acpi_pcc_hotkey_resume,
200 .notify = acpi_pcc_hotkey_notify, 201 .notify = acpi_pcc_hotkey_notify,
201 }, 202 },
203 .drv.pm = &acpi_pcc_hotkey_pm,
202}; 204};
203 205
204static const struct key_entry panasonic_keymap[] = { 206static const struct key_entry panasonic_keymap[] = {
@@ -538,11 +540,15 @@ static void acpi_pcc_destroy_input(struct pcc_acpi *pcc)
538 540
539/* kernel module interface */ 541/* kernel module interface */
540 542
541static int acpi_pcc_hotkey_resume(struct acpi_device *device) 543static int acpi_pcc_hotkey_resume(struct device *dev)
542{ 544{
543 struct pcc_acpi *pcc = acpi_driver_data(device); 545 struct pcc_acpi *pcc;
546
547 if (!dev)
548 return -EINVAL;
544 549
545 if (device == NULL || pcc == NULL) 550 pcc = acpi_driver_data(to_acpi_device(dev));
551 if (!pcc)
546 return -EINVAL; 552 return -EINVAL;
547 553
548 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n", 554 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n",
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index d456ff0c73b7..9363969ad07a 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1477,7 +1477,7 @@ static void sony_nc_function_resume(void)
1477 &result); 1477 &result);
1478} 1478}
1479 1479
1480static int sony_nc_resume(struct acpi_device *device) 1480static int sony_nc_resume(struct device *dev)
1481{ 1481{
1482 struct sony_nc_value *item; 1482 struct sony_nc_value *item;
1483 acpi_handle handle; 1483 acpi_handle handle;
@@ -1509,6 +1509,8 @@ static int sony_nc_resume(struct acpi_device *device)
1509 return 0; 1509 return 0;
1510} 1510}
1511 1511
1512static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume);
1513
1512static void sony_nc_rfkill_cleanup(void) 1514static void sony_nc_rfkill_cleanup(void)
1513{ 1515{
1514 int i; 1516 int i;
@@ -2770,9 +2772,9 @@ static struct acpi_driver sony_nc_driver = {
2770 .ops = { 2772 .ops = {
2771 .add = sony_nc_add, 2773 .add = sony_nc_add,
2772 .remove = sony_nc_remove, 2774 .remove = sony_nc_remove,
2773 .resume = sony_nc_resume,
2774 .notify = sony_nc_notify, 2775 .notify = sony_nc_notify,
2775 }, 2776 },
2777 .drv.pm = &sony_nc_pm,
2776}; 2778};
2777 2779
2778/*********** SPIC (SNY6001) Device ***********/ 2780/*********** SPIC (SNY6001) Device ***********/
@@ -4285,19 +4287,22 @@ err_free_resources:
4285 return result; 4287 return result;
4286} 4288}
4287 4289
4288static int sony_pic_suspend(struct acpi_device *device, pm_message_t state) 4290static int sony_pic_suspend(struct device *dev)
4289{ 4291{
4290 if (sony_pic_disable(device)) 4292 if (sony_pic_disable(to_acpi_device(dev)))
4291 return -ENXIO; 4293 return -ENXIO;
4292 return 0; 4294 return 0;
4293} 4295}
4294 4296
4295static int sony_pic_resume(struct acpi_device *device) 4297static int sony_pic_resume(struct device *dev)
4296{ 4298{
4297 sony_pic_enable(device, spic_dev.cur_ioport, spic_dev.cur_irq); 4299 sony_pic_enable(to_acpi_device(dev),
4300 spic_dev.cur_ioport, spic_dev.cur_irq);
4298 return 0; 4301 return 0;
4299} 4302}
4300 4303
4304static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume);
4305
4301static const struct acpi_device_id sony_pic_device_ids[] = { 4306static const struct acpi_device_id sony_pic_device_ids[] = {
4302 {SONY_PIC_HID, 0}, 4307 {SONY_PIC_HID, 0},
4303 {"", 0}, 4308 {"", 0},
@@ -4311,9 +4316,8 @@ static struct acpi_driver sony_pic_driver = {
4311 .ops = { 4316 .ops = {
4312 .add = sony_pic_add, 4317 .add = sony_pic_add,
4313 .remove = sony_pic_remove, 4318 .remove = sony_pic_remove,
4314 .suspend = sony_pic_suspend,
4315 .resume = sony_pic_resume,
4316 }, 4319 },
4320 .drv.pm = &sony_pic_pm,
4317}; 4321};
4318 4322
4319static struct dmi_system_id __initdata sonypi_dmi_table[] = { 4323static struct dmi_system_id __initdata sonypi_dmi_table[] = {
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;
922static struct mutex tpacpi_inputdev_send_mutex; 922static struct mutex tpacpi_inputdev_send_mutex;
923static LIST_HEAD(tpacpi_all_drivers); 923static LIST_HEAD(tpacpi_all_drivers);
924 924
925static int tpacpi_suspend_handler(struct platform_device *pdev, 925static 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
940static int tpacpi_resume_handler(struct platform_device *pdev) 939static 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
953static SIMPLE_DEV_PM_OPS(tpacpi_pm,
954 tpacpi_suspend_handler, tpacpi_resume_handler);
955
954static void tpacpi_shutdown_handler(struct platform_device *pdev) 956static 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
3761static void hotkey_suspend(pm_message_t state) 3762static 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
6332static void brightness_suspend(pm_message_t state) 6333static 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
6751static void volume_suspend(pm_message_t state) 6752static 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
8110static void fan_suspend(pm_message_t state) 8111static void fan_suspend(void)
8111{ 8112{
8112 int rc; 8113 int rc;
8113 8114
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index dab10f6edcd4..c13ba5bac93f 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1296,10 +1296,9 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
1296 } 1296 }
1297} 1297}
1298 1298
1299static int toshiba_acpi_suspend(struct acpi_device *acpi_dev, 1299static int toshiba_acpi_suspend(struct device *device)
1300 pm_message_t state)
1301{ 1300{
1302 struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev); 1301 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
1303 u32 result; 1302 u32 result;
1304 1303
1305 if (dev->hotkey_dev) 1304 if (dev->hotkey_dev)
@@ -1308,9 +1307,9 @@ static int toshiba_acpi_suspend(struct acpi_device *acpi_dev,
1308 return 0; 1307 return 0;
1309} 1308}
1310 1309
1311static int toshiba_acpi_resume(struct acpi_device *acpi_dev) 1310static int toshiba_acpi_resume(struct device *device)
1312{ 1311{
1313 struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev); 1312 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
1314 u32 result; 1313 u32 result;
1315 1314
1316 if (dev->hotkey_dev) 1315 if (dev->hotkey_dev)
@@ -1319,6 +1318,9 @@ static int toshiba_acpi_resume(struct acpi_device *acpi_dev)
1319 return 0; 1318 return 0;
1320} 1319}
1321 1320
1321static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm,
1322 toshiba_acpi_suspend, toshiba_acpi_resume);
1323
1322static struct acpi_driver toshiba_acpi_driver = { 1324static struct acpi_driver toshiba_acpi_driver = {
1323 .name = "Toshiba ACPI driver", 1325 .name = "Toshiba ACPI driver",
1324 .owner = THIS_MODULE, 1326 .owner = THIS_MODULE,
@@ -1328,9 +1330,8 @@ static struct acpi_driver toshiba_acpi_driver = {
1328 .add = toshiba_acpi_add, 1330 .add = toshiba_acpi_add,
1329 .remove = toshiba_acpi_remove, 1331 .remove = toshiba_acpi_remove,
1330 .notify = toshiba_acpi_notify, 1332 .notify = toshiba_acpi_notify,
1331 .suspend = toshiba_acpi_suspend,
1332 .resume = toshiba_acpi_resume,
1333 }, 1333 },
1334 .drv.pm = &toshiba_acpi_pm,
1334}; 1335};
1335 1336
1336static int __init toshiba_acpi_init(void) 1337static int __init toshiba_acpi_init(void)
diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c
index 5fb7186694df..715a43cb5e3c 100644
--- a/drivers/platform/x86/toshiba_bluetooth.c
+++ b/drivers/platform/x86/toshiba_bluetooth.c
@@ -34,7 +34,6 @@ MODULE_LICENSE("GPL");
34static int toshiba_bt_rfkill_add(struct acpi_device *device); 34static int toshiba_bt_rfkill_add(struct acpi_device *device);
35static int toshiba_bt_rfkill_remove(struct acpi_device *device, int type); 35static int toshiba_bt_rfkill_remove(struct acpi_device *device, int type);
36static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event); 36static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event);
37static int toshiba_bt_resume(struct acpi_device *device);
38 37
39static const struct acpi_device_id bt_device_ids[] = { 38static const struct acpi_device_id bt_device_ids[] = {
40 { "TOS6205", 0}, 39 { "TOS6205", 0},
@@ -42,6 +41,9 @@ static const struct acpi_device_id bt_device_ids[] = {
42}; 41};
43MODULE_DEVICE_TABLE(acpi, bt_device_ids); 42MODULE_DEVICE_TABLE(acpi, bt_device_ids);
44 43
44static int toshiba_bt_resume(struct device *dev);
45static SIMPLE_DEV_PM_OPS(toshiba_bt_pm, NULL, toshiba_bt_resume);
46
45static struct acpi_driver toshiba_bt_rfkill_driver = { 47static struct acpi_driver toshiba_bt_rfkill_driver = {
46 .name = "Toshiba BT", 48 .name = "Toshiba BT",
47 .class = "Toshiba", 49 .class = "Toshiba",
@@ -50,9 +52,9 @@ static struct acpi_driver toshiba_bt_rfkill_driver = {
50 .add = toshiba_bt_rfkill_add, 52 .add = toshiba_bt_rfkill_add,
51 .remove = toshiba_bt_rfkill_remove, 53 .remove = toshiba_bt_rfkill_remove,
52 .notify = toshiba_bt_rfkill_notify, 54 .notify = toshiba_bt_rfkill_notify,
53 .resume = toshiba_bt_resume,
54 }, 55 },
55 .owner = THIS_MODULE, 56 .owner = THIS_MODULE,
57 .drv.pm = &toshiba_bt_pm,
56}; 58};
57 59
58 60
@@ -88,9 +90,9 @@ static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event)
88 toshiba_bluetooth_enable(device->handle); 90 toshiba_bluetooth_enable(device->handle);
89} 91}
90 92
91static int toshiba_bt_resume(struct acpi_device *device) 93static int toshiba_bt_resume(struct device *dev)
92{ 94{
93 return toshiba_bluetooth_enable(device->handle); 95 return toshiba_bluetooth_enable(to_acpi_device(dev)->handle);
94} 96}
95 97
96static int toshiba_bt_rfkill_add(struct acpi_device *device) 98static int toshiba_bt_rfkill_add(struct acpi_device *device)
diff --git a/drivers/platform/x86/xo15-ebook.c b/drivers/platform/x86/xo15-ebook.c
index fad153dc0355..849c07c13bf6 100644
--- a/drivers/platform/x86/xo15-ebook.c
+++ b/drivers/platform/x86/xo15-ebook.c
@@ -77,11 +77,13 @@ static void ebook_switch_notify(struct acpi_device *device, u32 event)
77 } 77 }
78} 78}
79 79
80static int ebook_switch_resume(struct acpi_device *device) 80static int ebook_switch_resume(struct device *dev)
81{ 81{
82 return ebook_send_state(device); 82 return ebook_send_state(to_acpi_device(dev));
83} 83}
84 84
85static SIMPLE_DEV_PM_OPS(ebook_switch_pm, NULL, ebook_switch_resume);
86
85static int ebook_switch_add(struct acpi_device *device) 87static int ebook_switch_add(struct acpi_device *device)
86{ 88{
87 struct ebook_switch *button; 89 struct ebook_switch *button;
@@ -161,10 +163,10 @@ static struct acpi_driver xo15_ebook_driver = {
161 .ids = ebook_device_ids, 163 .ids = ebook_device_ids,
162 .ops = { 164 .ops = {
163 .add = ebook_switch_add, 165 .add = ebook_switch_add,
164 .resume = ebook_switch_resume,
165 .remove = ebook_switch_remove, 166 .remove = ebook_switch_remove,
166 .notify = ebook_switch_notify, 167 .notify = ebook_switch_notify,
167 }, 168 },
169 .drv.pm = &ebook_switch_pm,
168}; 170};
169 171
170static int __init xo15_ebook_init(void) 172static int __init xo15_ebook_init(void)