summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/siano/smsusb.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2008-12-10 22:28:25 +0100
committerPatrick Boettcher <pb@linuxtv.org>2008-12-10 22:28:25 +0100
commita9efe23fbe1000bff6e24012a5b580f9a8b93a92 (patch)
tree0308e2214bcc86e348e5d731d6bf958f1d4bf54f /linux/drivers/media/dvb/siano/smsusb.c
parent12583b9f4af4d04cce76742c9859bff4068e6345 (diff)
parent97b478e31ccddc358a73628542bb2d32983abeac (diff)
downloadmediapointer-dvb-s2-a9efe23fbe1000bff6e24012a5b580f9a8b93a92.tar.gz
mediapointer-dvb-s2-a9efe23fbe1000bff6e24012a5b580f9a8b93a92.tar.bz2
sync from main
From: Patrick Boettcher <pb@linuxtv.org> sync from main Priority: normal Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/siano/smsusb.c')
-rw-r--r--linux/drivers/media/dvb/siano/smsusb.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/siano/smsusb.c b/linux/drivers/media/dvb/siano/smsusb.c
index a50ea8259..fd191b0ef 100644
--- a/linux/drivers/media/dvb/siano/smsusb.c
+++ b/linux/drivers/media/dvb/siano/smsusb.c
@@ -436,11 +436,56 @@ static void smsusb_disconnect(struct usb_interface *intf)
smsusb_term_device(intf);
}
+static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg)
+{
+ struct smsusb_device_t *dev =
+ (struct smsusb_device_t *)usb_get_intfdata(intf);
+ printk(KERN_INFO "%s Entering status %d.\n", __func__, msg.event);
+ smsusb_stop_streaming(dev);
+ return 0;
+}
+
+static int smsusb_resume(struct usb_interface *intf)
+{
+ int rc, i;
+ struct smsusb_device_t *dev =
+ (struct smsusb_device_t *)usb_get_intfdata(intf);
+ struct usb_device *udev = interface_to_usbdev(intf);
+
+ printk(KERN_INFO "%s Entering.\n", __func__);
+ usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x81));
+ usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x02));
+
+ for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++)
+ printk(KERN_INFO "endpoint %d %02x %02x %d\n", i,
+ intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
+ intf->cur_altsetting->endpoint[i].desc.bmAttributes,
+ intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
+
+ if (intf->num_altsetting > 0) {
+ rc = usb_set_interface(udev,
+ intf->cur_altsetting->desc.
+ bInterfaceNumber, 0);
+ if (rc < 0) {
+ printk(KERN_INFO
+ "%s usb_set_interface failed, rc %d\n",
+ __func__, rc);
+ return rc;
+ }
+ }
+
+ smsusb_start_streaming(dev);
+ return 0;
+}
+
static struct usb_driver smsusb_driver = {
.name = "sms1xxx",
.probe = smsusb_probe,
.disconnect = smsusb_disconnect,
.id_table = smsusb_id_table,
+
+ .suspend = smsusb_suspend,
+ .resume = smsusb_resume,
};
int smsusb_register(void)