Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124255
b: refs/heads/master
c: 2f56c34
h: refs/heads/master
i:
  124253: 045a305
  124251: 0b0971c
  124247: 8e7c065
  124239: e670125
  124223: 7e782cc
v: v3
  • Loading branch information
Uri Shkolnik authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent 1a5a187 commit 372bb28
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b29e10d609035b5f93546ac6bcd1c5d810476a7
refs/heads/master: 2f56c34b2bc25a5a3419715f38f7d761fcd61b23
45 changes: 45 additions & 0 deletions trunk/drivers/media/dvb/siano/smsusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,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)
Expand Down

0 comments on commit 372bb28

Please sign in to comment.