diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-21 08:34:15 +0100 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-11-21 08:34:15 +0100 |
commit | ab89c89c05b4b66ddf9f7335cf33132473dd8479 (patch) | |
tree | bd4edf4ae68a3049ff77567e66741213d617810a /linux/drivers/media/video | |
parent | cd230a7b1b0e074e4dcf674043ffc64bee3bdab2 (diff) | |
download | mediapointer-dvb-s2-ab89c89c05b4b66ddf9f7335cf33132473dd8479.tar.gz mediapointer-dvb-s2-ab89c89c05b4b66ddf9f7335cf33132473dd8479.tar.bz2 |
gspca: Do the sn9c105 - ov7660 work again in sonixj.
From: Jean-Francois Moine <moinejf@free.fr>
The sn9c105 and sn9c120 bridges must be differently programmed for the ov7660.
Priority: normal
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/gspca/sonixj.c | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/linux/drivers/media/video/gspca/sonixj.c b/linux/drivers/media/video/gspca/sonixj.c index 93cc65b5f..d2892218f 100644 --- a/linux/drivers/media/video/gspca/sonixj.c +++ b/linux/drivers/media/video/gspca/sonixj.c @@ -850,11 +850,14 @@ static int configure_gpio(struct gspca_dev *gspca_dev, #if 1 /*jfm: from win trace */ case SENSOR_OV7660: - reg_w1(gspca_dev, 0x01, 0x61); - reg_w1(gspca_dev, 0x17, 0x20); - reg_w1(gspca_dev, 0x01, 0x60); - reg_w1(gspca_dev, 0x01, 0x40); - break; + if (sd->bridge == BRIDGE_SN9C120) { + reg_w1(gspca_dev, 0x01, 0x61); + reg_w1(gspca_dev, 0x17, 0x20); + reg_w1(gspca_dev, 0x01, 0x60); + reg_w1(gspca_dev, 0x01, 0x40); + break; + } + /* fall thru */ #endif default: reg_w1(gspca_dev, 0x01, 0x43); @@ -1285,14 +1288,18 @@ static int sd_start(struct gspca_dev *gspca_dev) #if 1 /*jfm: from win trace */ case SENSOR_OV7660: - reg17 = 0xa0; - break; + if (sd->bridge == BRIDGE_SN9C120) { + reg17 = 0xa0; + break; + } + /* fall thru */ #endif default: reg17 = 0x60; break; } reg_w1(gspca_dev, 0x17, reg17); +/* set reg1 was here */ reg_w1(gspca_dev, 0x05, sn9c1xx[5]); reg_w1(gspca_dev, 0x07, sn9c1xx[7]); reg_w1(gspca_dev, 0x06, sn9c1xx[6]); @@ -1306,8 +1313,11 @@ static int sd_start(struct gspca_dev *gspca_dev) reg_w1(gspca_dev, 0x99, 0x60); break; case SENSOR_OV7660: - reg_w1(gspca_dev, 0x9a, 0x05); - break; + if (sd->bridge == BRIDGE_SN9C120) { + reg_w1(gspca_dev, 0x9a, 0x05); + break; + } + /* fall thru */ default: reg_w1(gspca_dev, 0x9a, 0x08); reg_w1(gspca_dev, 0x99, 0x59); @@ -1316,10 +1326,10 @@ static int sd_start(struct gspca_dev *gspca_dev) mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; if (mode) - reg1 = 0x46; /* 320 clk 48Mhz */ + reg1 = 0x46; /* 320x240: clk 48Mhz, video trf enable */ else - reg1 = 0x06; /* 640 clk 24Mz */ - reg17 = 0x61; + reg1 = 0x06; /* 640x480: clk 24Mhz, video trf enable */ + reg17 = 0x61; /* 0x:20: enable sensor clock */ switch (sd->sensor) { case SENSOR_HV7131R: hv7131R_InitSensor(gspca_dev); @@ -1363,9 +1373,15 @@ static int sd_start(struct gspca_dev *gspca_dev) /* reg17 = 0x21; * 320 */ /* reg1 = 0x44; */ /* reg1 = 0x46; (done) */ - } else { - reg17 = 0xa2; /* 640 */ - reg1 = 0x44; + } else { /* 640 */ + if (sd->bridge == BRIDGE_SN9C120) { + reg17 = 0xa2; + reg1 = 0x44; /* 48 Mhz, video trf eneble */ + } else { + reg17 = 0x22; + reg1 = 0x06; /* 24 Mhz, video trf eneble + * inverse power down */ + } } break; } @@ -1393,6 +1409,7 @@ static int sd_start(struct gspca_dev *gspca_dev) reg_w1(gspca_dev, 0x18, reg18); reg_w1(gspca_dev, 0x17, reg17); + reg_w1(gspca_dev, 0x01, reg1); switch (sd->sensor) { case SENSOR_MI0360: setinfrared(sd); @@ -1411,7 +1428,6 @@ static int sd_start(struct gspca_dev *gspca_dev) break; } setautogain(gspca_dev); - reg_w1(gspca_dev, 0x01, reg1); return 0; } |