aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/au0828/au0828-core.c
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@linuxtv.org>2009-03-11 02:00:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:25 -0400
commit8b2f079523450fa2d65cbb3f8453820bf1e17533 (patch)
tree8cb0df3d17674cbe1cc012010b3d322e1235a53f /drivers/media/video/au0828/au0828-core.c
parent968cf78285ef03672ae514e9ad7a60919eb97551 (diff)
V4L/DVB (11066): au0828: add support for analog functionality in bridge
Add support for the analog functionality found in the au0828 bridge Thanks to Michael Krufky <mkrufky@linuxtv.org> and Steven Toth <stoth@linuxtv.org> for providing sample hardware, engineering level support, and testing. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> [mchehab@redhat.com: fix compilation by adding linux/version.h] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/au0828/au0828-core.c')
-rw-r--r--drivers/media/video/au0828/au0828-core.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c
index 5765e8656376..680e88f61397 100644
--- a/drivers/media/video/au0828/au0828-core.c
+++ b/drivers/media/video/au0828/au0828-core.c
@@ -146,6 +146,8 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
146 /* Digital TV */ 146 /* Digital TV */
147 au0828_dvb_unregister(dev); 147 au0828_dvb_unregister(dev);
148 148
149 au0828_analog_unregister(dev);
150
149 /* I2C */ 151 /* I2C */
150 au0828_i2c_unregister(dev); 152 au0828_i2c_unregister(dev);
151 153
@@ -162,9 +164,11 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
162static int au0828_usb_probe(struct usb_interface *interface, 164static int au0828_usb_probe(struct usb_interface *interface,
163 const struct usb_device_id *id) 165 const struct usb_device_id *id)
164{ 166{
165 int ifnum; 167 int ifnum, i;
166 struct au0828_dev *dev; 168 struct au0828_dev *dev;
167 struct usb_device *usbdev = interface_to_usbdev(interface); 169 struct usb_device *usbdev = interface_to_usbdev(interface);
170 struct usb_host_interface *iface_desc;
171 struct usb_endpoint_descriptor *endpoint;
168 172
169 ifnum = interface->altsetting->desc.bInterfaceNumber; 173 ifnum = interface->altsetting->desc.bInterfaceNumber;
170 174
@@ -189,6 +193,30 @@ static int au0828_usb_probe(struct usb_interface *interface,
189 193
190 usb_set_intfdata(interface, dev); 194 usb_set_intfdata(interface, dev);
191 195
196 /* set au0828 usb interface0 to as5 */
197 usb_set_interface(usbdev,
198 interface->cur_altsetting->desc.bInterfaceNumber, 5);
199
200 /* Figure out which endpoint has the isoc interface */
201 iface_desc = interface->cur_altsetting;
202 for(i = 0; i < iface_desc->desc.bNumEndpoints; i++){
203 endpoint = &iface_desc->endpoint[i].desc;
204 if(((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) &&
205 ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_ISOC)){
206
207 /* we find our isoc in endpoint */
208 u16 tmp = le16_to_cpu(endpoint->wMaxPacketSize);
209 dev->max_pkt_size = (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
210 dev->isoc_in_endpointaddr = endpoint->bEndpointAddress;
211 }
212 }
213 if(!(dev->isoc_in_endpointaddr)) {
214 printk("Could not locate isoc endpoint\n");
215 kfree(dev);
216 return -ENODEV;
217 }
218
219
192 /* Power Up the bridge */ 220 /* Power Up the bridge */
193 au0828_write(dev, REG_600, 1 << 4); 221 au0828_write(dev, REG_600, 1 << 4);
194 222
@@ -201,6 +229,9 @@ static int au0828_usb_probe(struct usb_interface *interface,
201 /* Setup */ 229 /* Setup */
202 au0828_card_setup(dev); 230 au0828_card_setup(dev);
203 231
232 /* Analog TV */
233 au0828_analog_register(dev);
234
204 /* Digital TV */ 235 /* Digital TV */
205 au0828_dvb_register(dev); 236 au0828_dvb_register(dev);
206 237