aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2010-07-15 12:16:39 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-15 12:30:43 -0400
commited4299e1b173f111ac0c40d6617e47fbff02b52f (patch)
tree58af5375a47c5ef324fe090eea8c60165a581525 /drivers/input/touchscreen
parent4cf51c383d7a8d472a6090a0d19c371d40e823c9 (diff)
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>
Diffstat (limited to 'drivers/input/touchscreen')
-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)
1296 usb_kill_urb(usbtouch->irq); 1296 usb_kill_urb(usbtouch->irq);
1297} 1297}
1298 1298
1299static int usbtouch_suspend
1300(struct usb_interface *intf, pm_message_t message)
1301{
1302 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
1303
1304 usb_kill_urb(usbtouch->irq);
1305
1306 return 0;
1307}
1308
1309static int usbtouch_resume(struct usb_interface *intf)
1310{
1311 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
1312 struct input_dev *input = usbtouch->input;
1313 int result = 0;
1314
1315 mutex_lock(&input->mutex);
1316 if (input->users || usbtouch->type->irq_always)
1317 result = usb_submit_urb(usbtouch->irq, GFP_NOIO);
1318 mutex_unlock(&input->mutex);
1319
1320 return result;
1321}
1299 1322
1300static void usbtouch_free_buffers(struct usb_device *udev, 1323static void usbtouch_free_buffers(struct usb_device *udev,
1301 struct usbtouch_usb *usbtouch) 1324 struct usbtouch_usb *usbtouch)
@@ -1486,6 +1509,8 @@ static struct usb_driver usbtouch_driver = {
1486 .name = "usbtouchscreen", 1509 .name = "usbtouchscreen",
1487 .probe = usbtouch_probe, 1510 .probe = usbtouch_probe,
1488 .disconnect = usbtouch_disconnect, 1511 .disconnect = usbtouch_disconnect,
1512 .suspend = usbtouch_suspend,
1513 .resume = usbtouch_resume,
1489 .id_table = usbtouch_devices, 1514 .id_table = usbtouch_devices,
1490}; 1515};
1491 1516