diff options
Diffstat (limited to 'linux/drivers/media/video/au0828/au0828-core.c')
-rw-r--r-- | linux/drivers/media/video/au0828/au0828-core.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/linux/drivers/media/video/au0828/au0828-core.c b/linux/drivers/media/video/au0828/au0828-core.c index 05e38f41c..0ed270d22 100644 --- a/linux/drivers/media/video/au0828/au0828-core.c +++ b/linux/drivers/media/video/au0828/au0828-core.c @@ -147,6 +147,8 @@ static void au0828_usb_disconnect(struct usb_interface *interface) /* Digital TV */ au0828_dvb_unregister(dev); + au0828_analog_unregister(dev); + /* I2C */ au0828_i2c_unregister(dev); @@ -163,9 +165,11 @@ static void au0828_usb_disconnect(struct usb_interface *interface) static int au0828_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) { - int ifnum; + int ifnum, i; struct au0828_dev *dev; struct usb_device *usbdev = interface_to_usbdev(interface); + struct usb_host_interface *iface_desc; + struct usb_endpoint_descriptor *endpoint; ifnum = interface->altsetting->desc.bInterfaceNumber; @@ -190,6 +194,30 @@ static int au0828_usb_probe(struct usb_interface *interface, usb_set_intfdata(interface, dev); + /* set au0828 usb interface0 to as5 */ + usb_set_interface(usbdev, + interface->cur_altsetting->desc.bInterfaceNumber, 5); + + /* Figure out which endpoint has the isoc interface */ + iface_desc = interface->cur_altsetting; + for(i = 0; i < iface_desc->desc.bNumEndpoints; i++){ + endpoint = &iface_desc->endpoint[i].desc; + if(((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) && + ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_ISOC)){ + + /* we find our isoc in endpoint */ + u16 tmp = le16_to_cpu(endpoint->wMaxPacketSize); + dev->max_pkt_size = (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); + dev->isoc_in_endpointaddr = endpoint->bEndpointAddress; + } + } + if(!(dev->isoc_in_endpointaddr)) { + printk("Could not locate isoc endpoint\n"); + kfree(dev); + return -ENODEV; + } + + /* Power Up the bridge */ au0828_write(dev, REG_600, 1 << 4); @@ -202,6 +230,9 @@ static int au0828_usb_probe(struct usb_interface *interface, /* Setup */ au0828_card_setup(dev); + /* Analog TV */ + au0828_analog_register(dev); + /* Digital TV */ au0828_dvb_register(dev); |