aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/siano/smsusb.c
diff options
context:
space:
mode:
authorUri Shkolnik <uris@siano-ms.com>2008-11-22 12:08:46 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:41 -0500
commit2f56c34b2bc25a5a3419715f38f7d761fcd61b23 (patch)
tree71f464794be519d8ece5a865e5e5515a9577bc48 /drivers/media/dvb/siano/smsusb.c
parent7b29e10d609035b5f93546ac6bcd1c5d810476a7 (diff)
V4L/DVB (9740): sms1xxx: add USB suspend and hibernation support
This patch provides USB suspend and hibernation support for Siano's SMS chipset based USB device Signed-off-by: Uri Shkolnik <uris@siano-ms.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/siano/smsusb.c')
-rw-r--r--drivers/media/dvb/siano/smsusb.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index 87a3c24454b9..5d7ca3417719 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -432,11 +432,56 @@ static void smsusb_disconnect(struct usb_interface *intf)
432 smsusb_term_device(intf); 432 smsusb_term_device(intf);
433} 433}
434 434
435static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg)
436{
437 struct smsusb_device_t *dev =
438 (struct smsusb_device_t *)usb_get_intfdata(intf);
439 printk(KERN_INFO "%s Entering status %d.\n", __func__, msg.event);
440 smsusb_stop_streaming(dev);
441 return 0;
442}
443
444static int smsusb_resume(struct usb_interface *intf)
445{
446 int rc, i;
447 struct smsusb_device_t *dev =
448 (struct smsusb_device_t *)usb_get_intfdata(intf);
449 struct usb_device *udev = interface_to_usbdev(intf);
450
451 printk(KERN_INFO "%s Entering.\n", __func__);
452 usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x81));
453 usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x02));
454
455 for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++)
456 printk(KERN_INFO "endpoint %d %02x %02x %d\n", i,
457 intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
458 intf->cur_altsetting->endpoint[i].desc.bmAttributes,
459 intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
460
461 if (intf->num_altsetting > 0) {
462 rc = usb_set_interface(udev,
463 intf->cur_altsetting->desc.
464 bInterfaceNumber, 0);
465 if (rc < 0) {
466 printk(KERN_INFO
467 "%s usb_set_interface failed, rc %d\n",
468 __func__, rc);
469 return rc;
470 }
471 }
472
473 smsusb_start_streaming(dev);
474 return 0;
475}
476
435static struct usb_driver smsusb_driver = { 477static struct usb_driver smsusb_driver = {
436 .name = "sms1xxx", 478 .name = "sms1xxx",
437 .probe = smsusb_probe, 479 .probe = smsusb_probe,
438 .disconnect = smsusb_disconnect, 480 .disconnect = smsusb_disconnect,
439 .id_table = smsusb_id_table, 481 .id_table = smsusb_id_table,
482
483 .suspend = smsusb_suspend,
484 .resume = smsusb_resume,
440}; 485};
441 486
442int smsusb_register(void) 487int smsusb_register(void)