diff options
author | Haixia Shi <hshi@chromium.org> | 2016-08-30 14:50:21 -0700 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2016-09-06 13:56:42 -0400 |
commit | 737ba10928061c899b7da45e8580ac5c20ff3593 (patch) | |
tree | 1df0a21cf3358900744bf8780b45b0fb82e67a18 /drivers/gpu/drm/udl/udl_drv.c | |
parent | ae0119f5f73b1e9cf7177fbbeea68d74c5751def (diff) | |
download | talos-obmc-linux-737ba10928061c899b7da45e8580ac5c20ff3593.tar.gz talos-obmc-linux-737ba10928061c899b7da45e8580ac5c20ff3593.zip |
drm/udl: implement usb_driver suspend/resume.
The usb_driver suspend and resume function pointers must be populated
to prevent forced unbinding of USB interface driver. See usb/core/driver.c:
unbind_no_pm_drivers_interfaces().
Restore mode and damage the entire frame buffer upon resume.
TEST=suspend and resume with the same UDL device connected
TEST=suspend with UDL, unplug UDL and resume
TEST=suspend with UDL, unplug and connect another UDL device then resume
Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
[seanpaul fixed checkpatch warnings and gave marcheu his é back]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1472593821-38429-2-git-send-email-hshi@chromium.org
Diffstat (limited to 'drivers/gpu/drm/udl/udl_drv.c')
-rw-r--r-- | drivers/gpu/drm/udl/udl_drv.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c index 17d34e0edbdd..f0851db6ba6c 100644 --- a/drivers/gpu/drm/udl/udl_drv.c +++ b/drivers/gpu/drm/udl/udl_drv.c @@ -16,6 +16,20 @@ static int udl_driver_set_busid(struct drm_device *d, struct drm_master *m) return 0; } +static int udl_usb_suspend(struct usb_interface *interface, + pm_message_t message) +{ + return 0; +} + +static int udl_usb_resume(struct usb_interface *interface) +{ + struct drm_device *dev = usb_get_intfdata(interface); + + udl_modeset_restore(dev); + return 0; +} + static const struct vm_operations_struct udl_gem_vm_ops = { .fault = udl_gem_fault, .open = drm_gem_vm_open, @@ -122,6 +136,8 @@ static struct usb_driver udl_driver = { .name = "udl", .probe = udl_usb_probe, .disconnect = udl_usb_disconnect, + .suspend = udl_usb_suspend, + .resume = udl_usb_resume, .id_table = id_table, }; module_usb_driver(udl_driver); |