diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-05-03 09:25:35 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-05-03 09:25:35 -0400 |
commit | d6d53cbc6b10d28646fb6184d1069f336ec76dc4 (patch) | |
tree | 1c844b3ce8bd430becbbb74875898b08d9f89bb5 /drivers/hid/usbhid | |
parent | 0b5adf92ec793c665b0de63ac146d190a921c391 (diff) | |
parent | 6a740aa4f47b9f29bad5292cf51f008f3edad9b1 (diff) |
Merge branch 'hid-suspend' into picolcd
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 24 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-pidff.c | 1 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 3e7909b0f12..17eb3ec3fbb 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -1291,6 +1291,11 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message) | |||
1291 | { | 1291 | { |
1292 | set_bit(HID_REPORTED_IDLE, &usbhid->iofl); | 1292 | set_bit(HID_REPORTED_IDLE, &usbhid->iofl); |
1293 | spin_unlock_irq(&usbhid->lock); | 1293 | spin_unlock_irq(&usbhid->lock); |
1294 | if (hid->driver && hid->driver->suspend) { | ||
1295 | status = hid->driver->suspend(hid, message); | ||
1296 | if (status < 0) | ||
1297 | return status; | ||
1298 | } | ||
1294 | } else { | 1299 | } else { |
1295 | usbhid_mark_busy(usbhid); | 1300 | usbhid_mark_busy(usbhid); |
1296 | spin_unlock_irq(&usbhid->lock); | 1301 | spin_unlock_irq(&usbhid->lock); |
@@ -1298,6 +1303,11 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message) | |||
1298 | } | 1303 | } |
1299 | 1304 | ||
1300 | } else { | 1305 | } else { |
1306 | if (hid->driver && hid->driver->suspend) { | ||
1307 | status = hid->driver->suspend(hid, message); | ||
1308 | if (status < 0) | ||
1309 | return status; | ||
1310 | } | ||
1301 | spin_lock_irq(&usbhid->lock); | 1311 | spin_lock_irq(&usbhid->lock); |
1302 | set_bit(HID_REPORTED_IDLE, &usbhid->iofl); | 1312 | set_bit(HID_REPORTED_IDLE, &usbhid->iofl); |
1303 | spin_unlock_irq(&usbhid->lock); | 1313 | spin_unlock_irq(&usbhid->lock); |
@@ -1352,6 +1362,11 @@ static int hid_resume(struct usb_interface *intf) | |||
1352 | hid_io_error(hid); | 1362 | hid_io_error(hid); |
1353 | usbhid_restart_queues(usbhid); | 1363 | usbhid_restart_queues(usbhid); |
1354 | 1364 | ||
1365 | if (status >= 0 && hid->driver && hid->driver->resume) { | ||
1366 | int ret = hid->driver->resume(hid); | ||
1367 | if (ret < 0) | ||
1368 | status = ret; | ||
1369 | } | ||
1355 | dev_dbg(&intf->dev, "resume status %d\n", status); | 1370 | dev_dbg(&intf->dev, "resume status %d\n", status); |
1356 | return 0; | 1371 | return 0; |
1357 | } | 1372 | } |
@@ -1360,9 +1375,16 @@ static int hid_reset_resume(struct usb_interface *intf) | |||
1360 | { | 1375 | { |
1361 | struct hid_device *hid = usb_get_intfdata(intf); | 1376 | struct hid_device *hid = usb_get_intfdata(intf); |
1362 | struct usbhid_device *usbhid = hid->driver_data; | 1377 | struct usbhid_device *usbhid = hid->driver_data; |
1378 | int status; | ||
1363 | 1379 | ||
1364 | clear_bit(HID_REPORTED_IDLE, &usbhid->iofl); | 1380 | clear_bit(HID_REPORTED_IDLE, &usbhid->iofl); |
1365 | return hid_post_reset(intf); | 1381 | status = hid_post_reset(intf); |
1382 | if (status >= 0 && hid->driver && hid->driver->reset_resume) { | ||
1383 | int ret = hid->driver->reset_resume(hid); | ||
1384 | if (ret < 0) | ||
1385 | status = ret; | ||
1386 | } | ||
1387 | return status; | ||
1366 | } | 1388 | } |
1367 | 1389 | ||
1368 | #endif /* CONFIG_PM */ | 1390 | #endif /* CONFIG_PM */ |
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index e565dbe91d9..ef381d79cfa 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #define debug(format, arg...) pr_debug("hid-pidff: " format "\n" , ## arg) | 25 | #define debug(format, arg...) pr_debug("hid-pidff: " format "\n" , ## arg) |
26 | 26 | ||
27 | #include <linux/input.h> | 27 | #include <linux/input.h> |
28 | #include <linux/slab.h> | ||
28 | #include <linux/usb.h> | 29 | #include <linux/usb.h> |
29 | 30 | ||
30 | #include <linux/hid.h> | 31 | #include <linux/hid.h> |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 928943c7ce9..1152f9b5fd4 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/hid.h> | 18 | #include <linux/hid.h> |
19 | #include <linux/slab.h> | ||
19 | 20 | ||
20 | #include "../hid-ids.h" | 21 | #include "../hid-ids.h" |
21 | 22 | ||
@@ -60,6 +61,7 @@ static const struct hid_blacklist { | |||
60 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 61 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
61 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 62 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
62 | { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET }, | 63 | { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET }, |
64 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NOGET }, | ||
63 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, | 65 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, |
64 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, | 66 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, |
65 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT }, | 67 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT }, |