Skip to content

Commit

Permalink
V4L/DVB (8825): gspca: More controls for pac73xx and new webcam 093a:…
Browse files Browse the repository at this point in the history
…2624.

-Add usb id for 093a:2624 (pac7302)
-Report some controls to userspace with 7302 only, as they are 7302 only
-Add gain and exposure controls
-Add autogain
-Fix 7302 imaged being mirrored by default

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Sep 3, 2008
1 parent a1e8288 commit 8a5b2e9
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 95 deletions.
1 change: 1 addition & 0 deletions Documentation/video4linux/gspca.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ pac7311 093a:2608 Trust WB-3300p
pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
pac7311 093a:260f SnakeCam
pac7311 093a:2621 PAC731x
pac7311 093a:2624 PAC7302
zc3xx 0ac8:0302 Z-star Vimicro zc0302
vc032x 0ac8:0321 Vimicro generic vc0321
vc032x 0ac8:0323 Vimicro Vc0323
Expand Down
16 changes: 5 additions & 11 deletions drivers/media/video/gspca/pac207.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ MODULE_LICENSE("GPL");
#define PAC207_GAIN_KNEE 20

#define PAC207_AUTOGAIN_DEADZONE 30
/* We calculating the autogain at the end of the transfer of a frame, at this
moment a frame with the old settings is being transmitted, and a frame is
being captured with the old settings. So if we adjust the autogain we must
ignore atleast the 2 next frames for the new settings to come into effect
before doing any other adjustments */
#define PAC207_AUTOGAIN_IGNORE_FRAMES 3

/* specific webcam descriptor */
struct sd {
Expand Down Expand Up @@ -338,6 +332,9 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */
}

/* Include pac common sof detection functions */
#include "pac_common.h"

static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
Expand All @@ -351,12 +348,9 @@ static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum,
100 + sd->brightness / 2, PAC207_AUTOGAIN_DEADZONE,
PAC207_GAIN_KNEE, PAC207_EXPOSURE_KNEE))
sd->autogain_ignore_frames = PAC207_AUTOGAIN_IGNORE_FRAMES;
sd->autogain_ignore_frames = PAC_AUTOGAIN_IGNORE_FRAMES;
}

/* Include pac common sof detection functions */
#include "pac_common.h"

static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
__u8 *data,
Expand Down Expand Up @@ -500,7 +494,7 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
sd->gain = PAC207_GAIN_DEFAULT;
if (gspca_dev->streaming) {
sd->autogain_ignore_frames =
PAC207_AUTOGAIN_IGNORE_FRAMES;
PAC_AUTOGAIN_IGNORE_FRAMES;
setexposure(gspca_dev);
setgain(gspca_dev);
}
Expand Down
Loading

0 comments on commit 8a5b2e9

Please sign in to comment.