Commit 1432f306 authored by Jean-Francois Moine's avatar Jean-Francois Moine Committed by Mauro Carvalho Chehab

V4L/DVB (9708): gspca: Do the sn9c105 - ov7660 work again in sonixj.

The sn9c105 and sn9c120 bridges must be differently programmed for the ov7660.
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d0182306
...@@ -843,11 +843,14 @@ static int configure_gpio(struct gspca_dev *gspca_dev, ...@@ -843,11 +843,14 @@ static int configure_gpio(struct gspca_dev *gspca_dev,
break; break;
/*jfm: from win trace */ /*jfm: from win trace */
case SENSOR_OV7660: case SENSOR_OV7660:
reg_w1(gspca_dev, 0x01, 0x61); if (sd->bridge == BRIDGE_SN9C120) {
reg_w1(gspca_dev, 0x17, 0x20); reg_w1(gspca_dev, 0x01, 0x61);
reg_w1(gspca_dev, 0x01, 0x60); reg_w1(gspca_dev, 0x17, 0x20);
reg_w1(gspca_dev, 0x01, 0x40); reg_w1(gspca_dev, 0x01, 0x60);
break; reg_w1(gspca_dev, 0x01, 0x40);
break;
}
/* fall thru */
default: default:
reg_w1(gspca_dev, 0x01, 0x43); reg_w1(gspca_dev, 0x01, 0x43);
reg_w1(gspca_dev, 0x17, 0x61); reg_w1(gspca_dev, 0x17, 0x61);
...@@ -1265,13 +1268,17 @@ static int sd_start(struct gspca_dev *gspca_dev) ...@@ -1265,13 +1268,17 @@ static int sd_start(struct gspca_dev *gspca_dev)
break; break;
/*jfm: from win trace */ /*jfm: from win trace */
case SENSOR_OV7660: case SENSOR_OV7660:
reg17 = 0xa0; if (sd->bridge == BRIDGE_SN9C120) {
break; reg17 = 0xa0;
break;
}
/* fall thru */
default: default:
reg17 = 0x60; reg17 = 0x60;
break; break;
} }
reg_w1(gspca_dev, 0x17, reg17); reg_w1(gspca_dev, 0x17, reg17);
/* set reg1 was here */
reg_w1(gspca_dev, 0x05, sn9c1xx[5]); reg_w1(gspca_dev, 0x05, sn9c1xx[5]);
reg_w1(gspca_dev, 0x07, sn9c1xx[7]); reg_w1(gspca_dev, 0x07, sn9c1xx[7]);
reg_w1(gspca_dev, 0x06, sn9c1xx[6]); reg_w1(gspca_dev, 0x06, sn9c1xx[6]);
...@@ -1285,8 +1292,11 @@ static int sd_start(struct gspca_dev *gspca_dev) ...@@ -1285,8 +1292,11 @@ static int sd_start(struct gspca_dev *gspca_dev)
reg_w1(gspca_dev, 0x99, 0x60); reg_w1(gspca_dev, 0x99, 0x60);
break; break;
case SENSOR_OV7660: case SENSOR_OV7660:
reg_w1(gspca_dev, 0x9a, 0x05); if (sd->bridge == BRIDGE_SN9C120) {
break; reg_w1(gspca_dev, 0x9a, 0x05);
break;
}
/* fall thru */
default: default:
reg_w1(gspca_dev, 0x9a, 0x08); reg_w1(gspca_dev, 0x9a, 0x08);
reg_w1(gspca_dev, 0x99, 0x59); reg_w1(gspca_dev, 0x99, 0x59);
...@@ -1295,10 +1305,10 @@ static int sd_start(struct gspca_dev *gspca_dev) ...@@ -1295,10 +1305,10 @@ static int sd_start(struct gspca_dev *gspca_dev)
mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
if (mode) if (mode)
reg1 = 0x46; /* 320 clk 48Mhz */ reg1 = 0x46; /* 320x240: clk 48Mhz, video trf enable */
else else
reg1 = 0x06; /* 640 clk 24Mz */ reg1 = 0x06; /* 640x480: clk 24Mhz, video trf enable */
reg17 = 0x61; reg17 = 0x61; /* 0x:20: enable sensor clock */
switch (sd->sensor) { switch (sd->sensor) {
case SENSOR_HV7131R: case SENSOR_HV7131R:
hv7131R_InitSensor(gspca_dev); hv7131R_InitSensor(gspca_dev);
...@@ -1342,9 +1352,15 @@ static int sd_start(struct gspca_dev *gspca_dev) ...@@ -1342,9 +1352,15 @@ static int sd_start(struct gspca_dev *gspca_dev)
/* reg17 = 0x21; * 320 */ /* reg17 = 0x21; * 320 */
/* reg1 = 0x44; */ /* reg1 = 0x44; */
/* reg1 = 0x46; (done) */ /* reg1 = 0x46; (done) */
} else { } else { /* 640 */
reg17 = 0xa2; /* 640 */ if (sd->bridge == BRIDGE_SN9C120) {
reg1 = 0x44; reg17 = 0xa2;
reg1 = 0x44; /* 48 Mhz, video trf eneble */
} else {
reg17 = 0x22;
reg1 = 0x06; /* 24 Mhz, video trf eneble
* inverse power down */
}
} }
break; break;
} }
...@@ -1372,6 +1388,7 @@ static int sd_start(struct gspca_dev *gspca_dev) ...@@ -1372,6 +1388,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
reg_w1(gspca_dev, 0x18, reg18); reg_w1(gspca_dev, 0x18, reg18);
reg_w1(gspca_dev, 0x17, reg17); reg_w1(gspca_dev, 0x17, reg17);
reg_w1(gspca_dev, 0x01, reg1);
switch (sd->sensor) { switch (sd->sensor) {
case SENSOR_MI0360: case SENSOR_MI0360:
setinfrared(sd); setinfrared(sd);
...@@ -1390,7 +1407,6 @@ static int sd_start(struct gspca_dev *gspca_dev) ...@@ -1390,7 +1407,6 @@ static int sd_start(struct gspca_dev *gspca_dev)
break; break;
} }
setautogain(gspca_dev); setautogain(gspca_dev);
reg_w1(gspca_dev, 0x01, reg1);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment