aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-07-29 07:03:17 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 11:19:53 -0400
commit0e4a90993dceffa881ee6d42266eb3080b7fad04 (patch)
treeca411baccc9bcd651f1fbc1d4a98160b8282fe06 /drivers
parentc529e556f64951a9d50f39e39c4be04ae43f5499 (diff)
V4L/DVB (12617): gspca_pac207: enable higher framerates / lower exposure settings
Now that we've figured out the higher compression settings (supported in libv4l-0.6.0 and later, so after this patch the driver should be used with libv4l-0.6.0 or higher only!), we can enable higher framerates. Which means lower exposure times, which is important for the use of the pac207 in full daylight. This patch also tweakes the brightness default and the per color gain balances to use the values which are adviced by Pixart in the pac207 application note. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/pac207.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index f20d21b1c7d7..96659433d248 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -35,25 +35,17 @@ MODULE_LICENSE("GPL");
35 35
36#define PAC207_BRIGHTNESS_MIN 0 36#define PAC207_BRIGHTNESS_MIN 0
37#define PAC207_BRIGHTNESS_MAX 255 37#define PAC207_BRIGHTNESS_MAX 255
38#define PAC207_BRIGHTNESS_DEFAULT 4 /* power on default: 4 */ 38#define PAC207_BRIGHTNESS_DEFAULT 46
39 39
40/* An exposure value of 4 also works (3 does not) but then we need to lower 40#define PAC207_EXPOSURE_MIN 3
41 the compression balance setting when in 352x288 mode, otherwise the usb
42 bandwidth is not enough and packets get dropped resulting in corrupt
43 frames. The problem with this is that when the compression balance gets
44 lowered below 0x80, the pac207 starts using a different compression
45 algorithm for some lines, these lines get prefixed with a 0x2dd2 prefix
46 and currently we do not know how to decompress these lines, so for now
47 we use a minimum exposure value of 5 */
48#define PAC207_EXPOSURE_MIN 5
49#define PAC207_EXPOSURE_MAX 26 41#define PAC207_EXPOSURE_MAX 26
50#define PAC207_EXPOSURE_DEFAULT 5 /* power on default: 3 ?? */ 42#define PAC207_EXPOSURE_DEFAULT 5 /* power on default: 3 */
51#define PAC207_EXPOSURE_KNEE 11 /* 4 = 30 fps, 11 = 8, 15 = 6 */ 43#define PAC207_EXPOSURE_KNEE 8 /* 4 = 30 fps, 11 = 8, 15 = 6 */
52 44
53#define PAC207_GAIN_MIN 0 45#define PAC207_GAIN_MIN 0
54#define PAC207_GAIN_MAX 31 46#define PAC207_GAIN_MAX 31
55#define PAC207_GAIN_DEFAULT 9 /* power on default: 9 */ 47#define PAC207_GAIN_DEFAULT 9 /* power on default: 9 */
56#define PAC207_GAIN_KNEE 20 48#define PAC207_GAIN_KNEE 31
57 49
58#define PAC207_AUTOGAIN_DEADZONE 30 50#define PAC207_AUTOGAIN_DEADZONE 30
59 51
@@ -166,8 +158,8 @@ static const struct v4l2_pix_format sif_mode[] = {
166}; 158};
167 159
168static const __u8 pac207_sensor_init[][8] = { 160static const __u8 pac207_sensor_init[][8] = {
169 {0x10, 0x12, 0x0d, 0x12, 0x0c, 0x01, 0x29, 0xf0}, 161 {0x10, 0x12, 0x0d, 0x12, 0x0c, 0x01, 0x29, 0x84},
170 {0x00, 0x64, 0x64, 0x64, 0x04, 0x10, 0xf0, 0x30}, 162 {0x49, 0x64, 0x64, 0x64, 0x04, 0x10, 0xf0, 0x30},
171 {0x00, 0x00, 0x00, 0x70, 0xa0, 0xf8, 0x00, 0x00}, 163 {0x00, 0x00, 0x00, 0x70, 0xa0, 0xf8, 0x00, 0x00},
172 {0x32, 0x00, 0x96, 0x00, 0xA2, 0x02, 0xaf, 0x00}, 164 {0x32, 0x00, 0x96, 0x00, 0xA2, 0x02, 0xaf, 0x00},
173}; 165};
@@ -290,7 +282,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
290 if (gspca_dev->width == 176) 282 if (gspca_dev->width == 176)
291 pac207_write_reg(gspca_dev, 0x4a, 0xff); 283 pac207_write_reg(gspca_dev, 0x4a, 0xff);
292 else 284 else
293 pac207_write_reg(gspca_dev, 0x4a, 0x88); 285 pac207_write_reg(gspca_dev, 0x4a, 0x30);
294 pac207_write_reg(gspca_dev, 0x4b, 0x00); /* Sram test value */ 286 pac207_write_reg(gspca_dev, 0x4b, 0x00); /* Sram test value */
295 pac207_write_reg(gspca_dev, 0x08, sd->brightness); 287 pac207_write_reg(gspca_dev, 0x08, sd->brightness);
296 288
@@ -339,7 +331,7 @@ static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
339 if (sd->autogain_ignore_frames > 0) 331 if (sd->autogain_ignore_frames > 0)
340 sd->autogain_ignore_frames--; 332 sd->autogain_ignore_frames--;
341 else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum, 333 else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum,
342 100 + sd->brightness / 2, PAC207_AUTOGAIN_DEADZONE, 334 100, PAC207_AUTOGAIN_DEADZONE,
343 PAC207_GAIN_KNEE, PAC207_EXPOSURE_KNEE)) 335 PAC207_GAIN_KNEE, PAC207_EXPOSURE_KNEE))
344 sd->autogain_ignore_frames = PAC_AUTOGAIN_IGNORE_FRAMES; 336 sd->autogain_ignore_frames = PAC_AUTOGAIN_IGNORE_FRAMES;
345} 337}