diff options
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/apple-gmux.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index f74bfcbb7bad..8eea2efbbb6d 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c | |||
@@ -393,17 +393,21 @@ static void gmux_notify_handler(acpi_handle device, u32 value, void *context) | |||
393 | complete(&gmux_data->powerchange_done); | 393 | complete(&gmux_data->powerchange_done); |
394 | } | 394 | } |
395 | 395 | ||
396 | static int gmux_suspend(struct pnp_dev *pnp, pm_message_t state) | 396 | static int gmux_suspend(struct device *dev) |
397 | { | 397 | { |
398 | struct pnp_dev *pnp = to_pnp_dev(dev); | ||
398 | struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp); | 399 | struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp); |
400 | |||
399 | gmux_data->resume_client_id = gmux_active_client(gmux_data); | 401 | gmux_data->resume_client_id = gmux_active_client(gmux_data); |
400 | gmux_disable_interrupts(gmux_data); | 402 | gmux_disable_interrupts(gmux_data); |
401 | return 0; | 403 | return 0; |
402 | } | 404 | } |
403 | 405 | ||
404 | static int gmux_resume(struct pnp_dev *pnp) | 406 | static int gmux_resume(struct device *dev) |
405 | { | 407 | { |
408 | struct pnp_dev *pnp = to_pnp_dev(dev); | ||
406 | struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp); | 409 | struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp); |
410 | |||
407 | gmux_enable_interrupts(gmux_data); | 411 | gmux_enable_interrupts(gmux_data); |
408 | gmux_switchto(gmux_data->resume_client_id); | 412 | gmux_switchto(gmux_data->resume_client_id); |
409 | if (gmux_data->power_state == VGA_SWITCHEROO_OFF) | 413 | if (gmux_data->power_state == VGA_SWITCHEROO_OFF) |
@@ -605,13 +609,19 @@ static const struct pnp_device_id gmux_device_ids[] = { | |||
605 | {"", 0} | 609 | {"", 0} |
606 | }; | 610 | }; |
607 | 611 | ||
612 | static const struct dev_pm_ops gmux_dev_pm_ops = { | ||
613 | .suspend = gmux_suspend, | ||
614 | .resume = gmux_resume, | ||
615 | }; | ||
616 | |||
608 | static struct pnp_driver gmux_pnp_driver = { | 617 | static struct pnp_driver gmux_pnp_driver = { |
609 | .name = "apple-gmux", | 618 | .name = "apple-gmux", |
610 | .probe = gmux_probe, | 619 | .probe = gmux_probe, |
611 | .remove = gmux_remove, | 620 | .remove = gmux_remove, |
612 | .id_table = gmux_device_ids, | 621 | .id_table = gmux_device_ids, |
613 | .suspend = gmux_suspend, | 622 | .driver = { |
614 | .resume = gmux_resume | 623 | .pm = &gmux_dev_pm_ops, |
624 | }, | ||
615 | }; | 625 | }; |
616 | 626 | ||
617 | static int __init apple_gmux_init(void) | 627 | static int __init apple_gmux_init(void) |