aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac207.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/pac207.c')
-rw-r--r--drivers/media/video/gspca/pac207.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index a15bccad947b..83b5f740c947 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -56,12 +56,6 @@ MODULE_LICENSE("GPL");
56#define PAC207_GAIN_KNEE 20 56#define PAC207_GAIN_KNEE 20
57 57
58#define PAC207_AUTOGAIN_DEADZONE 30 58#define PAC207_AUTOGAIN_DEADZONE 30
59/* We calculating the autogain at the end of the transfer of a frame, at this
60 moment a frame with the old settings is being transmitted, and a frame is
61 being captured with the old settings. So if we adjust the autogain we must
62 ignore atleast the 2 next frames for the new settings to come into effect
63 before doing any other adjustments */
64#define PAC207_AUTOGAIN_IGNORE_FRAMES 3
65 59
66/* specific webcam descriptor */ 60/* specific webcam descriptor */
67struct sd { 61struct sd {
@@ -338,6 +332,9 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
338 pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */ 332 pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */
339} 333}
340 334
335/* Include pac common sof detection functions */
336#include "pac_common.h"
337
341static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) 338static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
342{ 339{
343 struct sd *sd = (struct sd *) gspca_dev; 340 struct sd *sd = (struct sd *) gspca_dev;
@@ -351,12 +348,9 @@ static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
351 else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum, 348 else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum,
352 100 + sd->brightness / 2, PAC207_AUTOGAIN_DEADZONE, 349 100 + sd->brightness / 2, PAC207_AUTOGAIN_DEADZONE,
353 PAC207_GAIN_KNEE, PAC207_EXPOSURE_KNEE)) 350 PAC207_GAIN_KNEE, PAC207_EXPOSURE_KNEE))
354 sd->autogain_ignore_frames = PAC207_AUTOGAIN_IGNORE_FRAMES; 351 sd->autogain_ignore_frames = PAC_AUTOGAIN_IGNORE_FRAMES;
355} 352}
356 353
357/* Include pac common sof detection functions */
358#include "pac_common.h"
359
360static void sd_pkt_scan(struct gspca_dev *gspca_dev, 354static void sd_pkt_scan(struct gspca_dev *gspca_dev,
361 struct gspca_frame *frame, 355 struct gspca_frame *frame,
362 __u8 *data, 356 __u8 *data,
@@ -500,7 +494,7 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
500 sd->gain = PAC207_GAIN_DEFAULT; 494 sd->gain = PAC207_GAIN_DEFAULT;
501 if (gspca_dev->streaming) { 495 if (gspca_dev->streaming) {
502 sd->autogain_ignore_frames = 496 sd->autogain_ignore_frames =
503 PAC207_AUTOGAIN_IGNORE_FRAMES; 497 PAC_AUTOGAIN_IGNORE_FRAMES;
504 setexposure(gspca_dev); 498 setexposure(gspca_dev);
505 setgain(gspca_dev); 499 setgain(gspca_dev);
506 } 500 }