Commit ed4299e1 authored by Oliver Neukum's avatar Oliver Neukum Committed by Dmitry Torokhov

Input: usbtouchscreen - implement basic suspend/resume

This implements basic support for suspend & resume.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Tested-by: default avatarPetr Štetiar <ynezz@true.cz>
Tested-by: default avatarOndrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 4cf51c38
...@@ -1296,6 +1296,29 @@ static void usbtouch_close(struct input_dev *input) ...@@ -1296,6 +1296,29 @@ static void usbtouch_close(struct input_dev *input)
usb_kill_urb(usbtouch->irq); usb_kill_urb(usbtouch->irq);
} }
static int usbtouch_suspend
(struct usb_interface *intf, pm_message_t message)
{
struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
usb_kill_urb(usbtouch->irq);
return 0;
}
static int usbtouch_resume(struct usb_interface *intf)
{
struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
struct input_dev *input = usbtouch->input;
int result = 0;
mutex_lock(&input->mutex);
if (input->users || usbtouch->type->irq_always)
result = usb_submit_urb(usbtouch->irq, GFP_NOIO);
mutex_unlock(&input->mutex);
return result;
}
static void usbtouch_free_buffers(struct usb_device *udev, static void usbtouch_free_buffers(struct usb_device *udev,
struct usbtouch_usb *usbtouch) struct usbtouch_usb *usbtouch)
...@@ -1486,6 +1509,8 @@ static struct usb_driver usbtouch_driver = { ...@@ -1486,6 +1509,8 @@ static struct usb_driver usbtouch_driver = {
.name = "usbtouchscreen", .name = "usbtouchscreen",
.probe = usbtouch_probe, .probe = usbtouch_probe,
.disconnect = usbtouch_disconnect, .disconnect = usbtouch_disconnect,
.suspend = usbtouch_suspend,
.resume = usbtouch_resume,
.id_table = usbtouch_devices, .id_table = usbtouch_devices,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment