Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181586
b: refs/heads/master
c: 9919fe8
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent d0a2213 commit b85841b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 7 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: 6aeb0905620f2ba3adecfaabc7000ae0481a263b
refs/heads/master: 9919fe891da1bd61fad78a0e1e3c0f21cd127eca
52 changes: 46 additions & 6 deletions trunk/drivers/media/video/gspca/zc3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,19 @@ static const struct v4l2_pix_format vga_mode[] = {
.priv = 0},
};

static const struct v4l2_pix_format broken_vga_mode[] = {
{320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 320,
.sizeimage = 320 * 232 * 4 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 1},
{640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 640,
.sizeimage = 640 * 472 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 0},
};

static const struct v4l2_pix_format sif_mode[] = {
{176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 176,
Expand Down Expand Up @@ -6573,7 +6586,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
struct sd *sd = (struct sd *) gspca_dev;
struct cam *cam;
int sensor;
int vga = 1; /* 1: vga, 0: sif */
static const u8 gamma[SENSOR_MAX] = {
4, /* SENSOR_ADCM2700 0 */
4, /* SENSOR_CS2102 1 */
Expand All @@ -6595,6 +6607,27 @@ static int sd_config(struct gspca_dev *gspca_dev,
3, /* SENSOR_TAS5130CXX 17 */
3, /* SENSOR_TAS5130C_VF0250 18 */
};
static const u8 mode_tb[SENSOR_MAX] = {
2, /* SENSOR_ADCM2700 0 */
1, /* SENSOR_CS2102 1 */
1, /* SENSOR_CS2102K 2 */
1, /* SENSOR_GC0305 3 */
1, /* SENSOR_HDCS2020b 4 */
1, /* SENSOR_HV7131B 5 */
1, /* SENSOR_HV7131C 6 */
1, /* SENSOR_ICM105A 7 */
2, /* SENSOR_MC501CB 8 */
1, /* SENSOR_MI0360SOC 9 */
2, /* SENSOR_OV7620 10 */
1, /* SENSOR_OV7630C 11 */
0, /* SENSOR_PAS106 12 */
1, /* SENSOR_PAS202B 13 */
1, /* SENSOR_PB0330 14 */
1, /* SENSOR_PO2030 15 */
1, /* SENSOR_TAS5130CK 16 */
1, /* SENSOR_TAS5130CXX 17 */
1, /* SENSOR_TAS5130C_VF0250 18 */
};

/* define some sensors from the vendor/product */
sd->sharpness = SHARPNESS_DEF;
Expand Down Expand Up @@ -6668,7 +6701,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
case 0x0f:
PDEBUG(D_PROBE, "Find Sensor PAS106");
sd->sensor = SENSOR_PAS106;
vga = 0; /* SIF */
break;
case 0x10:
case 0x12:
Expand Down Expand Up @@ -6740,12 +6772,20 @@ static int sd_config(struct gspca_dev *gspca_dev,
cam = &gspca_dev->cam;
/*fixme:test*/
gspca_dev->nbalt--;
if (vga) {
cam->cam_mode = vga_mode;
cam->nmodes = ARRAY_SIZE(vga_mode);
} else {
switch (mode_tb[sd->sensor]) {
case 0:
cam->cam_mode = sif_mode;
cam->nmodes = ARRAY_SIZE(sif_mode);
break;
case 1:
cam->cam_mode = vga_mode;
cam->nmodes = ARRAY_SIZE(vga_mode);
break;
default:
/* case 2: */
cam->cam_mode = broken_vga_mode;
cam->nmodes = ARRAY_SIZE(broken_vga_mode);
break;
}
sd->brightness = BRIGHTNESS_DEF;
sd->contrast = CONTRAST_DEF;
Expand Down

0 comments on commit b85841b

Please sign in to comment.