Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109593
b: refs/heads/master
c: b77c004
h: refs/heads/master
i:
  109591: 87c4fe8
v: v3
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Sep 4, 2008
1 parent f8d4f1d commit aecb3e5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf2a2202f75cda679303f09d150f9549f9835953
refs/heads/master: b77c0046a63e7aa87152f9978cf7c46e7bead7fc
39 changes: 34 additions & 5 deletions trunk/drivers/media/video/gspca/spca561.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct sd {
#define AG_CNT_START 13
};

static struct v4l2_pix_format sif_mode[] = {
static struct v4l2_pix_format sif_012a_mode[] = {
{160, 120, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE,
.bytesperline = 160,
.sizeimage = 160 * 120,
Expand All @@ -96,6 +96,29 @@ static struct v4l2_pix_format sif_mode[] = {
.priv = 0},
};

static struct v4l2_pix_format sif_072a_mode[] = {
{160, 120, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE,
.bytesperline = 160,
.sizeimage = 160 * 120,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 3},
{176, 144, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE,
.bytesperline = 176,
.sizeimage = 176 * 144,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 2},
{320, 240, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE,
.bytesperline = 320,
.sizeimage = 320 * 240,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 1},
{352, 288, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE,
.bytesperline = 352,
.sizeimage = 352 * 288,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 0},
};

/*
* Initialization data
* I'm not very sure how to split initialization from open data
Expand Down Expand Up @@ -546,10 +569,15 @@ static int sd_config(struct gspca_dev *gspca_dev,
cam = &gspca_dev->cam;
cam->epaddr = 0x01;
gspca_dev->nbalt = 7 + 1; /* choose alternate 7 first */
cam->cam_mode = sif_mode;
cam->nmodes = ARRAY_SIZE(sif_mode);

sd->chip_revision = id->driver_info;
if (sd->chip_revision == Rev012A) {
cam->cam_mode = sif_012a_mode;
cam->nmodes = ARRAY_SIZE(sif_012a_mode);
} else {
cam->cam_mode = sif_072a_mode;
cam->nmodes = ARRAY_SIZE(sif_072a_mode);
}
sd->brightness = BRIGHTNESS_DEF;
sd->contrast = CONTRAST_DEF;
sd->white = WHITE_DEF;
Expand Down Expand Up @@ -833,8 +861,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
frame, data, len);
} else {
/* raw bayer (with a header, which we skip) */
data += 20;
len -= 20;
/*fixme: is this specific to the rev012a? */
data += 16;
len -= 16;
gspca_frame_add(gspca_dev, FIRST_PACKET,
frame, data, len);
}
Expand Down

0 comments on commit aecb3e5

Please sign in to comment.