aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/idmouse.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 12:25:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 12:25:16 -0400
commitbe90a49ca22a95f184d9f32d35b5247b44032849 (patch)
treed3c2edc18c003c384366f57901616ac29c80bc27 /drivers/usb/misc/idmouse.c
parent1f0918d03ff4b5c94540c71ce889672abdbc2f4a (diff)
parenta87371b477774b290c27bc5cb7f4ccc5379574a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (142 commits) USB: Fix sysfs paths in documentation USB: skeleton: fix coding style issues. USB: O_NONBLOCK in read path of skeleton USB: make usb-skeleton honor O_NONBLOCK in write path USB: skel_read really sucks royally USB: Add hub descriptor update hook for xHCI USB: xhci: Support USB hubs. USB: xhci: Set multi-TT field for LS/FS devices under hubs. USB: xhci: Set route string for all devices. USB: xhci: Fix command wait list handling. USB: xhci: Change how xHCI commands are handled. USB: xhci: Refactor input device context setup. USB: xhci: Endpoint representation refactoring. USB: gadget: ether needs to select CRC32 USB: fix USBTMC get_capabilities success handling USB: fix missing error check in probing USB: usbfs: add USBDEVFS_URB_BULK_CONTINUATION flag USB: support for autosuspend in sierra while online USB: ehci-dbgp,ehci: Allow dbpg to work with suspend/resume USB: ehci-dbgp,documentation: Documentation updates for ehci-dbgp ...
Diffstat (limited to 'drivers/usb/misc/idmouse.c')
-rw-r--r--drivers/usb/misc/idmouse.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index 6da8887538c7..1337a9ce80b9 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -96,6 +96,8 @@ static int idmouse_probe(struct usb_interface *interface,
96 const struct usb_device_id *id); 96 const struct usb_device_id *id);
97 97
98static void idmouse_disconnect(struct usb_interface *interface); 98static void idmouse_disconnect(struct usb_interface *interface);
99static int idmouse_suspend(struct usb_interface *intf, pm_message_t message);
100static int idmouse_resume(struct usb_interface *intf);
99 101
100/* file operation pointers */ 102/* file operation pointers */
101static const struct file_operations idmouse_fops = { 103static const struct file_operations idmouse_fops = {
@@ -117,7 +119,11 @@ static struct usb_driver idmouse_driver = {
117 .name = DRIVER_SHORT, 119 .name = DRIVER_SHORT,
118 .probe = idmouse_probe, 120 .probe = idmouse_probe,
119 .disconnect = idmouse_disconnect, 121 .disconnect = idmouse_disconnect,
122 .suspend = idmouse_suspend,
123 .resume = idmouse_resume,
124 .reset_resume = idmouse_resume,
120 .id_table = idmouse_table, 125 .id_table = idmouse_table,
126 .supports_autosuspend = 1,
121}; 127};
122 128
123static int idmouse_create_image(struct usb_idmouse *dev) 129static int idmouse_create_image(struct usb_idmouse *dev)
@@ -197,6 +203,17 @@ reset:
197 return result; 203 return result;
198} 204}
199 205
206/* PM operations are nops as this driver does IO only during open() */
207static int idmouse_suspend(struct usb_interface *intf, pm_message_t message)
208{
209 return 0;
210}
211
212static int idmouse_resume(struct usb_interface *intf)
213{
214 return 0;
215}
216
200static inline void idmouse_delete(struct usb_idmouse *dev) 217static inline void idmouse_delete(struct usb_idmouse *dev)
201{ 218{
202 kfree(dev->bulk_in_buffer); 219 kfree(dev->bulk_in_buffer);
@@ -235,9 +252,13 @@ static int idmouse_open(struct inode *inode, struct file *file)
235 } else { 252 } else {
236 253
237 /* create a new image and check for success */ 254 /* create a new image and check for success */
255 result = usb_autopm_get_interface(interface);
256 if (result)
257 goto error;
238 result = idmouse_create_image (dev); 258 result = idmouse_create_image (dev);
239 if (result) 259 if (result)
240 goto error; 260 goto error;
261 usb_autopm_put_interface(interface);
241 262
242 /* increment our usage count for the driver */ 263 /* increment our usage count for the driver */
243 ++dev->open; 264 ++dev->open;