Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103923
b: refs/heads/master
c: c2446b3
h: refs/heads/master
i:
  103921: 81cfaa1
  103919: 17e6464
v: v3
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Jul 20, 2008
1 parent 076ae80 commit a1389e1
Show file tree
Hide file tree
Showing 23 changed files with 520 additions and 321 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: efab8211db79d20032fa7d09b8a3671e68a9c5b9
refs/heads/master: c2446b3eba97243acbe2ad0939a28b5edb97eae7
54 changes: 35 additions & 19 deletions trunk/drivers/media/video/gspca/conex.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#define CONEX_CAM 1 /* special JPEG header */
#include "jpeg.h"

#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4)
static const char version[] = "2.1.4";
#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5)
static const char version[] = "2.1.5";

MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
MODULE_DESCRIPTION("GSPCA USB Conexant Camera Driver");
Expand All @@ -52,7 +52,6 @@ static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val);
static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val);

static struct ctrl sd_ctrls[] = {
#define SD_BRIGHTNESS 0
{
{
.id = V4L2_CID_BRIGHTNESS,
Expand All @@ -61,12 +60,12 @@ static struct ctrl sd_ctrls[] = {
.minimum = 0,
.maximum = 255,
.step = 1,
.default_value = 0xd4,
#define BRIGHTNESS_DEF 0xd4
.default_value = BRIGHTNESS_DEF,
},
.set = sd_setbrightness,
.get = sd_getbrightness,
},
#define SD_CONTRAST 1
{
{
.id = V4L2_CID_CONTRAST,
Expand All @@ -75,12 +74,12 @@ static struct ctrl sd_ctrls[] = {
.minimum = 0x0a,
.maximum = 0x1f,
.step = 1,
.default_value = 0x0c,
#define CONTRAST_DEF 0x0c
.default_value = CONTRAST_DEF,
},
.set = sd_setcontrast,
.get = sd_getcontrast,
},
#define SD_COLOR 2
{
{
.id = V4L2_CID_SATURATION,
Expand All @@ -89,18 +88,35 @@ static struct ctrl sd_ctrls[] = {
.minimum = 0,
.maximum = 7,
.step = 1,
.default_value = 3,
#define COLOR_DEF 3
.default_value = COLOR_DEF,
},
.set = sd_setcolors,
.get = sd_getcolors,
},
};

static struct cam_mode vga_mode[] = {
{V4L2_PIX_FMT_JPEG, 176, 144, 3},
{V4L2_PIX_FMT_JPEG, 320, 240, 2},
{V4L2_PIX_FMT_JPEG, 352, 288, 1},
{V4L2_PIX_FMT_JPEG, 640, 480, 0},
static struct v4l2_pix_format vga_mode[] = {
{176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 176,
.sizeimage = 176 * 144 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 3},
{320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 320,
.sizeimage = 320 * 240 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 2},
{352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 352,
.sizeimage = 352 * 288 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 1},
{640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 640,
.sizeimage = 640 * 480 * 3 / 8 + 590,
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 0},
};

static void reg_r(struct usb_device *dev,
Expand Down Expand Up @@ -269,7 +285,7 @@ static void cx_sensor(struct gspca_dev*gspca_dev)
val = 0x03;
reg_w(gspca_dev->dev, 0x0092, &val, 1);

switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) {
switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
case 0:
reg_w(gspca_dev->dev, 0x0071, reg71a, 4);
break;
Expand Down Expand Up @@ -350,7 +366,7 @@ static int cx11646_initsize(struct gspca_dev *gspca_dev)
static const __u8 reg17[] =
{ 0x0a, 0x00, 0xf2, 0x01, 0x0f, 0x00, 0x97, 0x02 };

switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) {
switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
case 0:
cxinit = cx_inits_640;
break;
Expand Down Expand Up @@ -668,7 +684,7 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev)
reg_w(gspca_dev->dev, 0x00c0, &val, 1);
reg_r(gspca_dev->dev, 0x0001, &val, 1);
length = 8;
switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) {
switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
case 0:
for (i = 0; i < 27; i++) {
if (i == 26)
Expand Down Expand Up @@ -832,9 +848,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
cam->nmodes = sizeof vga_mode / sizeof vga_mode[0];

sd->qindex = 0; /* set the quantization */
sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value;
sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value;
sd->brightness = BRIGHTNESS_DEF;
sd->contrast = CONTRAST_DEF;
sd->colors = COLOR_DEF;
return 0;
}

Expand Down
42 changes: 29 additions & 13 deletions trunk/drivers/media/video/gspca/etoms.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

#include "gspca.h"

#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4)
static const char version[] = "2.1.4";
#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5)
static const char version[] = "2.1.5";

MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
MODULE_DESCRIPTION("Etoms USB Camera Driver");
Expand Down Expand Up @@ -114,14 +114,30 @@ static struct ctrl sd_ctrls[] = {
},
};

static struct cam_mode vga_mode[] = {
{V4L2_PIX_FMT_SBGGR8, 320, 240, 1},
/* {V4L2_PIX_FMT_SBGGR8, 640, 480, 0}, */
static struct v4l2_pix_format vga_mode[] = {
{320, 240, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
.bytesperline = 320,
.sizeimage = 320 * 240,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 1},
/* {640, 480, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
.bytesperline = 640,
.sizeimage = 640 * 480,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 0}, */
};

static struct cam_mode sif_mode[] = {
{V4L2_PIX_FMT_SBGGR8, 176, 144, 1},
{V4L2_PIX_FMT_SBGGR8, 352, 288, 0},
static struct v4l2_pix_format sif_mode[] = {
{176, 144, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
.bytesperline = 176,
.sizeimage = 176 * 144,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 1},
{352, 288, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
.bytesperline = 352,
.sizeimage = 352 * 288,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 0},
};

#define ETOMS_ALT_SIZE_1000 12
Expand Down Expand Up @@ -334,7 +350,7 @@ static void Et_init2(struct gspca_dev *gspca_dev)
reg_w_val(dev, ET_CTRL, 0x1b);

/* compression et subsampling */
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode)
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv)
value = ET_COMP_VAL1; /* 320 */
else
value = ET_COMP_VAL0; /* 640 */
Expand Down Expand Up @@ -410,7 +426,7 @@ static void Et_init2(struct gspca_dev *gspca_dev)
/* reg_r(dev, ET_I2C_BASE, &received, 1);
always 0x40 as the pas106 ??? */
/* set the sensor */
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode)
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv)
value = 0x04; /* 320 */
else /* 640 */
value = 0x1e; /* 0x17 * setting PixelClock
Expand Down Expand Up @@ -487,12 +503,12 @@ static void Et_init1(struct gspca_dev *gspca_dev)
reg_w_val(dev, ET_ClCK, 0x10);
reg_w_val(dev, ET_CTRL, 0x19);
/* compression et subsampling */
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode)
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv)
value = ET_COMP_VAL1;
else
value = ET_COMP_VAL0;
PDEBUG(D_STREAM, "Open mode %d Compression %d",
gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode,
gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv,
value);
reg_w_val(dev, ET_COMP, value);
reg_w_val(dev, ET_MAXQt, 0x1d);
Expand Down Expand Up @@ -533,7 +549,7 @@ static void Et_init1(struct gspca_dev *gspca_dev)
reg_w_val(dev, ET_I2C_CLK, 0x04);
reg_w_val(dev, ET_PXL_CLK, 0x01);
/* set the sensor */
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) {
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
I2c0[0] = 0x06;
Et_i2cwrite(dev, PAS106_REG2, I2c0, sizeof I2c0, 1);
Et_i2cwrite(dev, PAS106_REG9, I2c2, sizeof I2c2, 1);
Expand Down
Loading

0 comments on commit a1389e1

Please sign in to comment.