diff options
Diffstat (limited to 'drivers/media/video/usbvision/usbvision-video.c')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 6fc14557d623..22c2889d3b5c 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -76,6 +76,7 @@ | |||
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | #include "usbvision.h" | 78 | #include "usbvision.h" |
79 | #include "usbvision-cards.h" | ||
79 | 80 | ||
80 | #define DRIVER_AUTHOR "Joerg Heckenbach <joerg@heckenbach-aw.de>, Dwaine Garden <DwaineGarden@rogers.com>" | 81 | #define DRIVER_AUTHOR "Joerg Heckenbach <joerg@heckenbach-aw.de>, Dwaine Garden <DwaineGarden@rogers.com>" |
81 | #define DRIVER_NAME "usbvision" | 82 | #define DRIVER_NAME "usbvision" |
@@ -1775,7 +1776,8 @@ static void usbvision_configure_video(struct usb_usbvision *usbvision) | |||
1775 | * if it looks like USBVISION video device | 1776 | * if it looks like USBVISION video device |
1776 | * | 1777 | * |
1777 | */ | 1778 | */ |
1778 | static int __devinit usbvision_probe(struct usb_interface *intf, const struct usb_device_id *devid) | 1779 | static int __devinit usbvision_probe(struct usb_interface *intf, |
1780 | const struct usb_device_id *devid) | ||
1779 | { | 1781 | { |
1780 | struct usb_device *dev = usb_get_dev(interface_to_usbdev(intf)); | 1782 | struct usb_device *dev = usb_get_dev(interface_to_usbdev(intf)); |
1781 | struct usb_interface *uif; | 1783 | struct usb_interface *uif; |
@@ -1786,25 +1788,13 @@ static int __devinit usbvision_probe(struct usb_interface *intf, const struct us | |||
1786 | int model,i; | 1788 | int model,i; |
1787 | 1789 | ||
1788 | PDEBUG(DBG_PROBE, "VID=%#04x, PID=%#04x, ifnum=%u", | 1790 | PDEBUG(DBG_PROBE, "VID=%#04x, PID=%#04x, ifnum=%u", |
1789 | dev->descriptor.idVendor, dev->descriptor.idProduct, ifnum); | 1791 | dev->descriptor.idVendor, |
1792 | dev->descriptor.idProduct, ifnum); | ||
1790 | 1793 | ||
1791 | /* Is it an USBVISION video dev? */ | 1794 | model = devid->driver_info; |
1792 | model = 0; | 1795 | printk(KERN_INFO "%s: %s found\n", __FUNCTION__, |
1793 | for(model = 0; usbvision_device_data[model].idVendor; model++) { | 1796 | usbvision_device_data[model].ModelString); |
1794 | if (le16_to_cpu(dev->descriptor.idVendor) != usbvision_device_data[model].idVendor) { | ||
1795 | continue; | ||
1796 | } | ||
1797 | if (le16_to_cpu(dev->descriptor.idProduct) != usbvision_device_data[model].idProduct) { | ||
1798 | continue; | ||
1799 | } | ||
1800 | 1797 | ||
1801 | printk(KERN_INFO "%s: %s found\n", __FUNCTION__, usbvision_device_data[model].ModelString); | ||
1802 | break; | ||
1803 | } | ||
1804 | |||
1805 | if (usbvision_device_data[model].idVendor == 0) { | ||
1806 | return -ENODEV; //no matching device | ||
1807 | } | ||
1808 | if (usbvision_device_data[model].Interface >= 0) { | 1798 | if (usbvision_device_data[model].Interface >= 0) { |
1809 | interface = &dev->actconfig->interface[usbvision_device_data[model].Interface]->altsetting[0]; | 1799 | interface = &dev->actconfig->interface[usbvision_device_data[model].Interface]->altsetting[0]; |
1810 | } | 1800 | } |
@@ -1828,10 +1818,11 @@ static int __devinit usbvision_probe(struct usb_interface *intf, const struct us | |||
1828 | err("%s: couldn't allocate USBVision struct", __FUNCTION__); | 1818 | err("%s: couldn't allocate USBVision struct", __FUNCTION__); |
1829 | return -ENOMEM; | 1819 | return -ENOMEM; |
1830 | } | 1820 | } |
1821 | |||
1831 | if (dev->descriptor.bNumConfigurations > 1) { | 1822 | if (dev->descriptor.bNumConfigurations > 1) { |
1832 | usbvision->bridgeType = BRIDGE_NT1004; | 1823 | usbvision->bridgeType = BRIDGE_NT1004; |
1833 | } | 1824 | } |
1834 | else if (usbvision_device_data[model].ModelString == "Dazzle Fusion Model DVC-90 Rev 1 (SECAM)") { | 1825 | else if (model == DAZZLE_DVC_90_REV_1_SECAM) { |
1835 | usbvision->bridgeType = BRIDGE_NT1005; | 1826 | usbvision->bridgeType = BRIDGE_NT1005; |
1836 | } | 1827 | } |
1837 | else { | 1828 | else { |
@@ -1958,6 +1949,8 @@ static struct usb_driver usbvision_driver = { | |||
1958 | */ | 1949 | */ |
1959 | static void customdevice_process(void) | 1950 | static void customdevice_process(void) |
1960 | { | 1951 | { |
1952 | unsigned int id_vend,id_prod; | ||
1953 | |||
1961 | usbvision_device_data[0]=usbvision_device_data[1]; | 1954 | usbvision_device_data[0]=usbvision_device_data[1]; |
1962 | usbvision_table[0]=usbvision_table[1]; | 1955 | usbvision_table[0]=usbvision_table[1]; |
1963 | 1956 | ||
@@ -1965,7 +1958,7 @@ static void customdevice_process(void) | |||
1965 | { | 1958 | { |
1966 | char *parse=CustomDevice; | 1959 | char *parse=CustomDevice; |
1967 | 1960 | ||
1968 | PDEBUG(DBG_PROBE, "CustomDevide=%s", CustomDevice); | 1961 | PDEBUG(DBG_PROBE, "CustomDevice=%s", CustomDevice); |
1969 | 1962 | ||
1970 | /*format is CustomDevice="0x0573 0x4D31 0 7113 3 PAL 1 1 1 5 -1 -1 -1 -1 -1" | 1963 | /*format is CustomDevice="0x0573 0x4D31 0 7113 3 PAL 1 1 1 5 -1 -1 -1 -1 -1" |
1971 | usbvision_device_data[0].idVendor; | 1964 | usbvision_device_data[0].idVendor; |
@@ -1990,13 +1983,16 @@ static void customdevice_process(void) | |||
1990 | usbvision_device_data[0].ModelString="USBVISION Custom Device"; | 1983 | usbvision_device_data[0].ModelString="USBVISION Custom Device"; |
1991 | 1984 | ||
1992 | parse+=2; | 1985 | parse+=2; |
1993 | sscanf(parse,"%x",&usbvision_device_data[0].idVendor); | 1986 | sscanf(parse,"%u",&id_vend); |
1987 | usbvision_table[0].idVendor=id_vend; | ||
1988 | |||
1994 | goto2next(parse); | 1989 | goto2next(parse); |
1995 | PDEBUG(DBG_PROBE, "idVendor=0x%.4X", usbvision_device_data[0].idVendor); | 1990 | PDEBUG(DBG_PROBE, "idVendor=0x%.4X", usbvision_table[0].idVendor); |
1996 | parse+=2; | 1991 | parse+=2; |
1997 | sscanf(parse,"%x",&usbvision_device_data[0].idProduct); | 1992 | sscanf(parse,"%u",&id_prod); |
1993 | usbvision_table[0].idProduct=id_prod; | ||
1998 | goto2next(parse); | 1994 | goto2next(parse); |
1999 | PDEBUG(DBG_PROBE, "idProduct=0x%.4X", usbvision_device_data[0].idProduct); | 1995 | PDEBUG(DBG_PROBE, "idProduct=0x%.4X", usbvision_table[0].idProduct); |
2000 | sscanf(parse,"%d",&usbvision_device_data[0].Interface); | 1996 | sscanf(parse,"%d",&usbvision_device_data[0].Interface); |
2001 | goto2next(parse); | 1997 | goto2next(parse); |
2002 | PDEBUG(DBG_PROBE, "Interface=%d", usbvision_device_data[0].Interface); | 1998 | PDEBUG(DBG_PROBE, "Interface=%d", usbvision_device_data[0].Interface); |
@@ -2060,9 +2056,6 @@ static void customdevice_process(void) | |||
2060 | 2056 | ||
2061 | //add to usbvision_table also | 2057 | //add to usbvision_table also |
2062 | usbvision_table[0].match_flags=USB_DEVICE_ID_MATCH_DEVICE; | 2058 | usbvision_table[0].match_flags=USB_DEVICE_ID_MATCH_DEVICE; |
2063 | usbvision_table[0].idVendor=usbvision_device_data[0].idVendor; | ||
2064 | usbvision_table[0].idProduct=usbvision_device_data[0].idProduct; | ||
2065 | |||
2066 | } | 2059 | } |
2067 | } | 2060 | } |
2068 | 2061 | ||