diff options
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 15d302b28b79..2f7bf263255c 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -114,7 +114,8 @@ static void fill_frame(struct gspca_dev *gspca_dev, | |||
114 | cam_pkt_op pkt_scan; | 114 | cam_pkt_op pkt_scan; |
115 | 115 | ||
116 | if (urb->status != 0) { | 116 | if (urb->status != 0) { |
117 | PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status); | 117 | if (!gspca_dev->frozen) |
118 | PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status); | ||
118 | return; /* disconnection ? */ | 119 | return; /* disconnection ? */ |
119 | } | 120 | } |
120 | pkt_scan = gspca_dev->sd_desc->pkt_scan; | 121 | pkt_scan = gspca_dev->sd_desc->pkt_scan; |
@@ -1808,6 +1809,33 @@ void gspca_disconnect(struct usb_interface *intf) | |||
1808 | } | 1809 | } |
1809 | EXPORT_SYMBOL(gspca_disconnect); | 1810 | EXPORT_SYMBOL(gspca_disconnect); |
1810 | 1811 | ||
1812 | #ifdef CONFIG_PM | ||
1813 | int gspca_suspend(struct usb_interface *intf, pm_message_t message) | ||
1814 | { | ||
1815 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); | ||
1816 | |||
1817 | if (!gspca_dev->streaming) | ||
1818 | return 0; | ||
1819 | gspca_dev->frozen = 1; /* avoid urb error messages */ | ||
1820 | gspca_dev->sd_desc->stopN(gspca_dev); | ||
1821 | destroy_urbs(gspca_dev); | ||
1822 | gspca_set_alt0(gspca_dev); | ||
1823 | gspca_dev->sd_desc->stop0(gspca_dev); | ||
1824 | return 0; | ||
1825 | } | ||
1826 | EXPORT_SYMBOL(gspca_suspend); | ||
1827 | |||
1828 | int gspca_resume(struct usb_interface *intf) | ||
1829 | { | ||
1830 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); | ||
1831 | |||
1832 | gspca_dev->frozen = 0; | ||
1833 | if (!gspca_dev->streaming) | ||
1834 | return 0; | ||
1835 | return gspca_init_transfer(gspca_dev); | ||
1836 | } | ||
1837 | EXPORT_SYMBOL(gspca_resume); | ||
1838 | #endif | ||
1811 | /* -- cam driver utility functions -- */ | 1839 | /* -- cam driver utility functions -- */ |
1812 | 1840 | ||
1813 | /* auto gain and exposure algorithm based on the knee algorithm described here: | 1841 | /* auto gain and exposure algorithm based on the knee algorithm described here: |