aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-01-06 13:23:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-01-19 08:45:10 -0500
commite530a5e3cfe5f2dca35552d2d968f0a3fc115968 (patch)
treee8615252bd7281784b9399ce6d9bf437e2558572 /drivers/media/video
parent4944e27d85ed8e5ccd591687546d56d111c5cc98 (diff)
[media] gspca_sonixj: Probe sensor type independent of bridge type
Looking at the windows inf file, for usb ids with a sensor type where probing is needed to determine the type (for example ov7630 or soi768), this is needed for all bridge variants with a usb id indicating this sensor type. So do the probing to determine the actual sensor type for types where the usb-id info is not 100% deterministic, independent of the bridge type. If you look through the list of currently active usb ids in sonixj, this effectively only changes the code path for 0c45:60fe (sn9c105 + ov7630) and 0c45:612e (sn9c110 + ov7630), which according to the inf file can have a soi768 instead of a ov7630 just like the sn9c120 + ov7630 models where we already probe for a soi7630. The main reason for this code change is to keep the code paths as bridge variant independent as possible, so that we don't need a lot of special per bridge cases, as we enable more usb-ids in the future. This change makes the 0c45:60fe code path identical to the successfully tested 0c45:613e, so also make sonixj the default driver for 0c45:60fe. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/sonixj.c58
-rw-r--r--drivers/media/video/sn9c102/sn9c102_devtable.h2
2 files changed, 29 insertions, 31 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 85716f864cfb..efe3fc7b6b74 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -1822,44 +1822,46 @@ static int sd_init(struct gspca_dev *gspca_dev)
1822 PDEBUG(D_PROBE, "Sonix chip id: %02x", regF1); 1822 PDEBUG(D_PROBE, "Sonix chip id: %02x", regF1);
1823 switch (sd->bridge) { 1823 switch (sd->bridge) {
1824 case BRIDGE_SN9C102P: 1824 case BRIDGE_SN9C102P:
1825 case BRIDGE_SN9C105:
1825 if (regF1 != 0x11) 1826 if (regF1 != 0x11)
1826 return -ENODEV; 1827 return -ENODEV;
1828 break;
1829 default:
1830/* case BRIDGE_SN9C110: */
1831/* case BRIDGE_SN9C120: */
1832 if (regF1 != 0x12)
1833 return -ENODEV;
1834 }
1835
1836 switch (sd->sensor) {
1837 case SENSOR_MI0360:
1838 mi0360_probe(gspca_dev);
1839 break;
1840 case SENSOR_OV7630:
1841 ov7630_probe(gspca_dev);
1842 break;
1843 case SENSOR_OV7648:
1844 ov7648_probe(gspca_dev);
1845 break;
1846 case SENSOR_PO2030N:
1847 po2030n_probe(gspca_dev);
1848 break;
1849 }
1850
1851 switch (sd->bridge) {
1852 case BRIDGE_SN9C102P:
1827 reg_w1(gspca_dev, 0x02, regGpio[1]); 1853 reg_w1(gspca_dev, 0x02, regGpio[1]);
1828 break; 1854 break;
1829 case BRIDGE_SN9C105: 1855 case BRIDGE_SN9C105:
1830 if (regF1 != 0x11)
1831 return -ENODEV;
1832 if (sd->sensor == SENSOR_MI0360)
1833 mi0360_probe(gspca_dev);
1834 reg_w(gspca_dev, 0x01, regGpio, 2); 1856 reg_w(gspca_dev, 0x01, regGpio, 2);
1835 break; 1857 break;
1858 case BRIDGE_SN9C110:
1859 reg_w1(gspca_dev, 0x02, 0x62);
1860 break;
1836 case BRIDGE_SN9C120: 1861 case BRIDGE_SN9C120:
1837 if (regF1 != 0x12)
1838 return -ENODEV;
1839 switch (sd->sensor) {
1840 case SENSOR_MI0360:
1841 mi0360_probe(gspca_dev);
1842 break;
1843 case SENSOR_OV7630:
1844 ov7630_probe(gspca_dev);
1845 break;
1846 case SENSOR_OV7648:
1847 ov7648_probe(gspca_dev);
1848 break;
1849 case SENSOR_PO2030N:
1850 po2030n_probe(gspca_dev);
1851 break;
1852 }
1853 regGpio[1] = 0x70; /* no audio */ 1862 regGpio[1] = 0x70; /* no audio */
1854 reg_w(gspca_dev, 0x01, regGpio, 2); 1863 reg_w(gspca_dev, 0x01, regGpio, 2);
1855 break; 1864 break;
1856 default:
1857/* case BRIDGE_SN9C110: */
1858/* case BRIDGE_SN9C325: */
1859 if (regF1 != 0x12)
1860 return -ENODEV;
1861 reg_w1(gspca_dev, 0x02, 0x62);
1862 break;
1863 } 1865 }
1864 1866
1865 if (sd->sensor == SENSOR_OM6802) 1867 if (sd->sensor == SENSOR_OM6802)
@@ -2935,9 +2937,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
2935/* {USB_DEVICE(0x0c45, 0x60f2), BS(SN9C105, OV7660)}, */ 2937/* {USB_DEVICE(0x0c45, 0x60f2), BS(SN9C105, OV7660)}, */
2936 {USB_DEVICE(0x0c45, 0x60fb), BS(SN9C105, OV7660)}, 2938 {USB_DEVICE(0x0c45, 0x60fb), BS(SN9C105, OV7660)},
2937 {USB_DEVICE(0x0c45, 0x60fc), BS(SN9C105, HV7131R)}, 2939 {USB_DEVICE(0x0c45, 0x60fc), BS(SN9C105, HV7131R)},
2938#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
2939 {USB_DEVICE(0x0c45, 0x60fe), BS(SN9C105, OV7630)}, 2940 {USB_DEVICE(0x0c45, 0x60fe), BS(SN9C105, OV7630)},
2940#endif
2941 {USB_DEVICE(0x0c45, 0x6100), BS(SN9C120, MI0360)}, /*sn9c128*/ 2941 {USB_DEVICE(0x0c45, 0x6100), BS(SN9C120, MI0360)}, /*sn9c128*/
2942 {USB_DEVICE(0x0c45, 0x6102), BS(SN9C120, PO2030N)}, /* /GC0305*/ 2942 {USB_DEVICE(0x0c45, 0x6102), BS(SN9C120, PO2030N)}, /* /GC0305*/
2943/* {USB_DEVICE(0x0c45, 0x6108), BS(SN9C120, OM6802)}, */ 2943/* {USB_DEVICE(0x0c45, 0x6108), BS(SN9C120, OM6802)}, */
diff --git a/drivers/media/video/sn9c102/sn9c102_devtable.h b/drivers/media/video/sn9c102/sn9c102_devtable.h
index 97e123672d65..b3d2cc729657 100644
--- a/drivers/media/video/sn9c102/sn9c102_devtable.h
+++ b/drivers/media/video/sn9c102/sn9c102_devtable.h
@@ -108,10 +108,8 @@ static const struct usb_device_id sn9c102_id_table[] = {
108/* { SN9C102_USB_DEVICE(0x0c45, 0x60fa, BRIDGE_SN9C105), }, OV7648 */ 108/* { SN9C102_USB_DEVICE(0x0c45, 0x60fa, BRIDGE_SN9C105), }, OV7648 */
109 { SN9C102_USB_DEVICE(0x0c45, 0x60fb, BRIDGE_SN9C105), }, 109 { SN9C102_USB_DEVICE(0x0c45, 0x60fb, BRIDGE_SN9C105), },
110 { SN9C102_USB_DEVICE(0x0c45, 0x60fc, BRIDGE_SN9C105), }, 110 { SN9C102_USB_DEVICE(0x0c45, 0x60fc, BRIDGE_SN9C105), },
111#endif
112 { SN9C102_USB_DEVICE(0x0c45, 0x60fe, BRIDGE_SN9C105), }, 111 { SN9C102_USB_DEVICE(0x0c45, 0x60fe, BRIDGE_SN9C105), },
113 /* SN9C120 */ 112 /* SN9C120 */
114#if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE
115 { SN9C102_USB_DEVICE(0x0458, 0x7025, BRIDGE_SN9C120), }, 113 { SN9C102_USB_DEVICE(0x0458, 0x7025, BRIDGE_SN9C120), },
116/* { SN9C102_USB_DEVICE(0x0c45, 0x6102, BRIDGE_SN9C120), }, po2030 */ 114/* { SN9C102_USB_DEVICE(0x0c45, 0x6102, BRIDGE_SN9C120), }, po2030 */
117/* { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), }, om6801 */ 115/* { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), }, om6801 */