From 2687a2fb1ce2b764298fb40c96765b04eaddac95 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Sun, 1 Feb 2009 14:48:55 -0300 Subject: [PATCH] V4L/DVB (10430): gspca - sonixj: Adjust some exchanges with the sensor mt9v111. This patch also enables the autogain for the mt9v111. Signed-off-by: Jean-Francois Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/sonixj.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 4101a240e48..970c74f9fe8 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c @@ -234,7 +234,7 @@ static __u32 ctrl_dis[] = { /* SENSOR_MI0360 1 */ (1 << INFRARED_IDX) | (1 << VFLIP_IDX), /* SENSOR_MO4000 2 */ - (1 << AUTOGAIN_IDX), + 0, /* SENSOR_MT9V111 3 */ (1 << INFRARED_IDX) | (1 << VFLIP_IDX), /* SENSOR_OM6802 4 */ @@ -517,8 +517,18 @@ static const u8 mt9v111_sensor_init[][8] = { {0xb1, 0x5c, 0x01, 0x00, 0x01, 0x00, 0x00, 0x10}, /* IFP select */ {0xb1, 0x5c, 0x08, 0x04, 0x80, 0x00, 0x00, 0x10}, /* output fmt ctrl */ {0xb1, 0x5c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10}, /* op mode ctrl */ + {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10}, + {0xb1, 0x5c, 0x03, 0x01, 0xe1, 0x00, 0x00, 0x10}, + {0xb1, 0x5c, 0x04, 0x02, 0x81, 0x00, 0x00, 0x10}, + {0xb1, 0x5c, 0x05, 0x00, 0x04, 0x00, 0x00, 0x10}, {0xb1, 0x5c, 0x01, 0x00, 0x04, 0x00, 0x00, 0x10}, /* sensor select */ + {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10}, + {0xb1, 0x5c, 0x03, 0x01, 0xe6, 0x00, 0x00, 0x10}, + {0xb1, 0x5c, 0x04, 0x02, 0x86, 0x00, 0x00, 0x10}, + {0xb1, 0x5c, 0x05, 0x00, 0x04, 0x00, 0x00, 0x10}, + {0xb1, 0x5c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10}, {0xb1, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x00, 0x10}, /* row start */ + {0xb1, 0x5c, 0x0e, 0x00, 0x08, 0x00, 0x00, 0x10}, {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10}, /* col start */ {0xb1, 0x5c, 0x03, 0x01, 0xe7, 0x00, 0x00, 0x10}, /* window height */ {0xb1, 0x5c, 0x04, 0x02, 0x87, 0x00, 0x00, 0x10}, /* window width */ @@ -532,7 +542,7 @@ static const u8 mt9v111_sensor_init[][8] = { /*******/ {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, - {0xb1, 0x5c, 0x09, 0x00, 0x64, 0x00, 0x00, 0x10}, /* shutter width */ + {0xb1, 0x5c, 0x09, 0x01, 0x2c, 0x00, 0x00, 0x10}, {0xd1, 0x5c, 0x2b, 0x00, 0x33, 0x00, 0xa0, 0x10}, /* green1 gain */ {0xd1, 0x5c, 0x2d, 0x00, 0xa0, 0x00, 0x33, 0x10}, /* red gain */ /*******/ @@ -1688,7 +1698,7 @@ static int sd_start(struct gspca_dev *gspca_dev) reg1 = 0x04; /* 320 clk 48Mhz */ } else { /* reg1 = 0x06; * 640 clk 24Mz (done) */ - reg17 = 0xe2; + reg17 = 0xc2; } break; case SENSOR_OM6802: -- 2.20.1