summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2010-07-15 18:16:39 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-15 18:30:43 +0200
commited4299e1b173f111ac0c40d6617e47fbff02b52f (patch)
tree58af5375a47c5ef324fe090eea8c60165a581525
parentInput: Add ATMEL QT602240 touchscreen driver (diff)
downloadlinux-ed4299e1b173f111ac0c40d6617e47fbff02b52f.tar.xz
linux-ed4299e1b173f111ac0c40d6617e47fbff02b52f.zip
Input: usbtouchscreen - implement basic suspend/resume
This implements basic support for suspend & resume. Signed-off-by: Oliver Neukum <oneukum@suse.de> Tested-by: Petr Štetiar <ynezz@true.cz> Tested-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index b9cee2738adb..9cda660ee7bb 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1296,6 +1296,29 @@ static void usbtouch_close(struct input_dev *input)
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,
struct usbtouch_usb *usbtouch)
@@ -1486,6 +1509,8 @@ static struct usb_driver usbtouch_driver = {
.name = "usbtouchscreen",
.probe = usbtouch_probe,
.disconnect = usbtouch_disconnect,
+ .suspend = usbtouch_suspend,
+ .resume = usbtouch_resume,
.id_table = usbtouch_devices,
};