]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/media/video/gspca/sonixj.c
[media] gspca_sonixj: Add one more commented out usb-id
[mv-sheeva.git] / drivers / media / video / gspca / sonixj.c
index e23de57e2c73de5d3c575eb4f52ae2a96be3259c..db35391d00e60d58282381d7cb9a1ce9e4edfd52 100644 (file)
@@ -1598,22 +1598,22 @@ static void i2c_w_seq(struct gspca_dev *gspca_dev,
        }
 }
 
+/* check the ID of the hv7131 sensor */
+/* this sequence is needed because it activates the sensor */
 static void hv7131r_probe(struct gspca_dev *gspca_dev)
 {
-       i2c_w1(gspca_dev, 0x02, 0);                     /* sensor wakeup */
+       i2c_w1(gspca_dev, 0x02, 0);             /* sensor wakeup */
        msleep(10);
-       reg_w1(gspca_dev, 0x02, 0x66);                  /* Gpio on */
+       reg_w1(gspca_dev, 0x02, 0x66);          /* Gpio on */
        msleep(10);
-       i2c_r(gspca_dev, 0, 5);                         /* read sensor id */
-       if (gspca_dev->usb_buf[0] == 0x02
+       i2c_r(gspca_dev, 0, 5);                 /* read sensor id */
+       if (gspca_dev->usb_buf[0] == 0x02       /* chip ID (02 is R) */
            && gspca_dev->usb_buf[1] == 0x09
-           && gspca_dev->usb_buf[2] == 0x01
-           && gspca_dev->usb_buf[3] == 0x00
-           && gspca_dev->usb_buf[4] == 0x00) {
-               PDEBUG(D_PROBE, "Sensor sn9c102P HV7131R found");
+           && gspca_dev->usb_buf[2] == 0x01) {
+               PDEBUG(D_PROBE, "Sensor HV7131R found");
                return;
        }
-       PDEBUG(D_PROBE, "Sensor 0x%02x 0x%02x 0x%02x - sn9c102P not found",
+       warn("Erroneous HV7131R ID 0x%02x 0x%02x 0x%02x",
                gspca_dev->usb_buf[0], gspca_dev->usb_buf[1],
                gspca_dev->usb_buf[2]);
 }
@@ -1822,44 +1822,46 @@ static int sd_init(struct gspca_dev *gspca_dev)
        PDEBUG(D_PROBE, "Sonix chip id: %02x", regF1);
        switch (sd->bridge) {
        case BRIDGE_SN9C102P:
+       case BRIDGE_SN9C105:
                if (regF1 != 0x11)
                        return -ENODEV;
+               break;
+       default:
+/*     case BRIDGE_SN9C110: */
+/*     case BRIDGE_SN9C120: */
+               if (regF1 != 0x12)
+                       return -ENODEV;
+       }
+
+       switch (sd->sensor) {
+       case SENSOR_MI0360:
+               mi0360_probe(gspca_dev);
+               break;
+       case SENSOR_OV7630:
+               ov7630_probe(gspca_dev);
+               break;
+       case SENSOR_OV7648:
+               ov7648_probe(gspca_dev);
+               break;
+       case SENSOR_PO2030N:
+               po2030n_probe(gspca_dev);
+               break;
+       }
+
+       switch (sd->bridge) {
+       case BRIDGE_SN9C102P:
                reg_w1(gspca_dev, 0x02, regGpio[1]);
                break;
        case BRIDGE_SN9C105:
-               if (regF1 != 0x11)
-                       return -ENODEV;
-               if (sd->sensor == SENSOR_MI0360)
-                       mi0360_probe(gspca_dev);
                reg_w(gspca_dev, 0x01, regGpio, 2);
                break;
+       case BRIDGE_SN9C110:
+               reg_w1(gspca_dev, 0x02, 0x62);
+               break;
        case BRIDGE_SN9C120:
-               if (regF1 != 0x12)
-                       return -ENODEV;
-               switch (sd->sensor) {
-               case SENSOR_MI0360:
-                       mi0360_probe(gspca_dev);
-                       break;
-               case SENSOR_OV7630:
-                       ov7630_probe(gspca_dev);
-                       break;
-               case SENSOR_OV7648:
-                       ov7648_probe(gspca_dev);
-                       break;
-               case SENSOR_PO2030N:
-                       po2030n_probe(gspca_dev);
-                       break;
-               }
                regGpio[1] = 0x70;              /* no audio */
                reg_w(gspca_dev, 0x01, regGpio, 2);
                break;
-       default:
-/*     case BRIDGE_SN9C110: */
-/*     case BRIDGE_SN9C325: */
-               if (regF1 != 0x12)
-                       return -ENODEV;
-               reg_w1(gspca_dev, 0x02, 0x62);
-               break;
        }
 
        if (sd->sensor == SENSOR_OM6802)
@@ -2533,7 +2535,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
                init = om6802_sensor_param1;
                if (!mode) {                    /* if 640x480 */
                        reg17 &= ~MCK_SIZE_MASK;
-                       reg17 |= 0x01;          /* clock / 4 */
+                       reg17 |= 0x04;          /* clock / 4 */
                }
                break;
        case SENSOR_OV7630:
@@ -2908,10 +2910,8 @@ static const struct sd_desc sd_desc = {
                        | (SENSOR_ ## sensor << 8) \
                        | (flags)
 static const __devinitdata struct usb_device_id device_table[] = {
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
        {USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)},
        {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)},
-#endif
        {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, PDN_INV)},
        {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, PDN_INV)},
        {USB_DEVICE(0x0471, 0x0327), BS(SN9C105, MI0360)},
@@ -2936,10 +2936,8 @@ static const __devinitdata struct usb_device_id device_table[] = {
 /*     {USB_DEVICE(0x0c45, 0x60fa), BS(SN9C105, OV7648)}, */
 /*     {USB_DEVICE(0x0c45, 0x60f2), BS(SN9C105, OV7660)}, */
        {USB_DEVICE(0x0c45, 0x60fb), BS(SN9C105, OV7660)},
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
        {USB_DEVICE(0x0c45, 0x60fc), BS(SN9C105, HV7131R)},
        {USB_DEVICE(0x0c45, 0x60fe), BS(SN9C105, OV7630)},
-#endif
        {USB_DEVICE(0x0c45, 0x6100), BS(SN9C120, MI0360)},      /*sn9c128*/
        {USB_DEVICE(0x0c45, 0x6102), BS(SN9C120, PO2030N)},     /* /GC0305*/
 /*     {USB_DEVICE(0x0c45, 0x6108), BS(SN9C120, OM6802)}, */
@@ -2962,9 +2960,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
 /*     {USB_DEVICE(0x0c45, 0x6132), BS(SN9C120, OV7670)}, */
        {USB_DEVICE(0x0c45, 0x6138), BS(SN9C120, MO4000)},
        {USB_DEVICE(0x0c45, 0x613a), BS(SN9C120, OV7648)},
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
        {USB_DEVICE(0x0c45, 0x613b), BS(SN9C120, OV7660)},
-#endif
        {USB_DEVICE(0x0c45, 0x613c), BS(SN9C120, HV7131R)},
        {USB_DEVICE(0x0c45, 0x613e), BS(SN9C120, OV7630)},
        {USB_DEVICE(0x0c45, 0x6142), BS(SN9C120, PO2030N)},     /*sn9c120b*/
@@ -2972,6 +2968,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0c45, 0x6143), BS(SN9C120, SP80708)},     /*sn9c120b*/
        {USB_DEVICE(0x0c45, 0x6148), BS(SN9C120, OM6802)},      /*sn9c120b*/
        {USB_DEVICE(0x0c45, 0x614a), BS(SN9C120, ADCM1700)},    /*sn9c120b*/
+/*     {USB_DEVICE(0x0c45, 0x614c), BS(SN9C120, GC0306)}, */   /*sn9c120b*/
        {}
 };
 MODULE_DEVICE_TABLE(usb, device_table);