main: Parameter comp_fac removed.
main, pac207:
get_buff_size op removed.
(all) v4l2_pix_format in each subdriver.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
#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");
static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val);
static struct ctrl sd_ctrls[] = {
-#define SD_BRIGHTNESS 0
{
{
.id = V4L2_CID_BRIGHTNESS,
.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,
.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,
.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,
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;
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;
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)
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;
}
#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");
},
};
-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
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 */
/* 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
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);
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);
MODULE_DESCRIPTION("GSPCA USB Camera Driver");
MODULE_LICENSE("GPL");
-#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";
static int video_nr = -1;
-static int comp_fac = 30; /* Buffer size ratio when compressed in % */
-
#ifdef CONFIG_VIDEO_ADV_DEBUG
int gspca_debug = D_ERR | D_PROBE;
EXPORT_SYMBOL(gspca_debug);
vfree(mem);
}
-static __u32 get_v4l2_depth(__u32 pixfmt)
-{
- switch (pixfmt) {
-/* case V4L2_PIX_FMT_BGR32:
- case V4L2_PIX_FMT_RGB32:
- return 32; */
- case V4L2_PIX_FMT_RGB24: /* 'RGB3' */
- case V4L2_PIX_FMT_BGR24:
- return 24;
-/* case V4L2_PIX_FMT_RGB565: * 'RGBP' */
- case V4L2_PIX_FMT_YUYV: /* 'YUYV' packed 4.2.2 */
- case V4L2_PIX_FMT_YYUV: /* 'YYUV' */
- return 16;
- case V4L2_PIX_FMT_YUV420: /* 'YU12' planar 4.2.0 */
- case V4L2_PIX_FMT_SPCA501: /* 'S501' YUYV per line */
- return 12;
- case V4L2_PIX_FMT_MJPEG:
- case V4L2_PIX_FMT_JPEG:
- case V4L2_PIX_FMT_SBGGR8: /* 'BA81' Bayer */
- case V4L2_PIX_FMT_SN9C10X: /* 'S910' SN9C10x compression */
- case V4L2_PIX_FMT_SPCA561: /* 'S561' compressed GBRG bayer */
- case V4L2_PIX_FMT_PAC207: /* 'P207' compressed BGGR bayer */
- return 8;
- }
- PDEBUG(D_ERR|D_CONF, "Unknown pixel format %c%c%c%c",
- pixfmt & 0xff,
- (pixfmt >> 8) & 0xff,
- (pixfmt >> 16) & 0xff,
- pixfmt >> 24);
- return 24;
-}
-
-static int gspca_get_buff_size(struct gspca_dev *gspca_dev, int mode)
-{
- unsigned int size;
-
- if (gspca_dev->sd_desc->get_buff_size)
- return gspca_dev->sd_desc->get_buff_size(gspca_dev, mode);
-
- size = gspca_dev->cam.cam_mode[mode].width *
- gspca_dev->cam.cam_mode[mode].height *
- get_v4l2_depth(gspca_dev->cam.cam_mode[mode].pixfmt) / 8;
- if (!size)
- return -ENOMEM;
-
- /* if compressed (JPEG), reduce the buffer size */
- if (gspca_is_compressed(gspca_dev->cam.cam_mode[mode].pixfmt))
- size = (size * comp_fac) / 100 + 600; /* (+ JPEG header sz) */
-
- return size;
-}
-
static int frame_alloc(struct gspca_dev *gspca_dev,
unsigned int count)
{
unsigned int frsz;
int i;
- frsz = gspca_get_buff_size(gspca_dev, gspca_dev->curr_mode);
- if (frsz < 0)
- return frsz;
+ i = gspca_dev->curr_mode;
+ frsz = gspca_dev->cam.cam_mode[i].sizeimage;
PDEBUG(D_STREAM, "frame alloc frsz: %d", frsz);
- if (count > GSPCA_MAX_FRAMES)
- count = GSPCA_MAX_FRAMES;
frsz = PAGE_ALIGN(frsz);
PDEBUG(D_STREAM, "new fr_sz: %d", frsz);
gspca_dev->frsz = frsz;
+ if (count > GSPCA_MAX_FRAMES)
+ count = GSPCA_MAX_FRAMES;
if (gspca_dev->memory == V4L2_MEMORY_MMAP) {
gspca_dev->frbuf = rvmalloc(frsz * count);
if (!gspca_dev->frbuf) {
gspca_dev->curr_mode = i;
gspca_dev->width = gspca_dev->cam.cam_mode[i].width;
gspca_dev->height = gspca_dev->cam.cam_mode[i].height;
- gspca_dev->pixfmt = gspca_dev->cam.cam_mode[i].pixfmt;
+ gspca_dev->pixfmt = gspca_dev->cam.cam_mode[i].pixelformat;
}
static int wxh_to_mode(struct gspca_dev *gspca_dev,
modeU = modeD = mode;
while ((modeU < gspca_dev->cam.nmodes) || modeD >= 0) {
if (--modeD >= 0) {
- if (gspca_dev->cam.cam_mode[modeD].pixfmt == pixfmt)
+ if (gspca_dev->cam.cam_mode[modeD].pixelformat
+ == pixfmt)
return modeD;
}
if (++modeU < gspca_dev->cam.nmodes) {
- if (gspca_dev->cam.cam_mode[modeU].pixfmt == pixfmt)
+ if (gspca_dev->cam.cam_mode[modeU].pixelformat
+ == pixfmt)
return modeU;
}
}
index = 0;
j = 0;
for (i = gspca_dev->cam.nmodes; --i >= 0; ) {
- fmt_tb[index] = gspca_dev->cam.cam_mode[i].pixfmt;
+ fmt_tb[index] = gspca_dev->cam.cam_mode[i].pixelformat;
j = 0;
for (;;) {
if (fmt_tb[j] == fmt_tb[index])
struct v4l2_format *fmt)
{
struct gspca_dev *gspca_dev = priv;
+ int mode;
if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
- fmt->fmt.pix.width = gspca_dev->width;
- fmt->fmt.pix.height = gspca_dev->height;
- fmt->fmt.pix.pixelformat = gspca_dev->pixfmt;
- fmt->fmt.pix.field = V4L2_FIELD_NONE;
- fmt->fmt.pix.bytesperline = get_v4l2_depth(fmt->fmt.pix.pixelformat)
- * fmt->fmt.pix.width / 8;
- fmt->fmt.pix.sizeimage = gspca_get_buff_size(gspca_dev,
- gspca_dev->curr_mode);
-/* (should be in the subdriver) */
- fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB;
- fmt->fmt.pix.priv = 0;
+ mode = gspca_dev->curr_mode;
+ memcpy(&fmt->fmt.pix, &gspca_dev->cam.cam_mode[mode],
+ sizeof fmt->fmt.pix);
return 0;
}
mode = wxh_to_mode(gspca_dev, w, h);
/* OK if right palette */
- if (gspca_dev->cam.cam_mode[mode].pixfmt != fmt->fmt.pix.pixelformat) {
+ if (gspca_dev->cam.cam_mode[mode].pixelformat
+ != fmt->fmt.pix.pixelformat) {
/* else, search the closest mode with the same pixel format */
mode2 = gspca_get_mode(gspca_dev, mode,
fmt->fmt.pix.pixelformat);
- if (mode2 >= 0) {
+ if (mode2 >= 0)
mode = mode2;
- } else {
-
- /* no chance, return this mode */
- fmt->fmt.pix.pixelformat =
- gspca_dev->cam.cam_mode[mode].pixfmt;
-#ifdef CONFIG_VIDEO_ADV_DEBUG
- if (gspca_debug & D_CONF) {
- PDEBUG_MODE("new format",
- fmt->fmt.pix.pixelformat,
- gspca_dev->cam.cam_mode[mode].width,
- gspca_dev->cam.cam_mode[mode].height);
- }
-#endif
- }
+/* else
+ ; * no chance, return this mode */
}
- fmt->fmt.pix.width = gspca_dev->cam.cam_mode[mode].width;
- fmt->fmt.pix.height = gspca_dev->cam.cam_mode[mode].height;
- fmt->fmt.pix.field = V4L2_FIELD_NONE;
- fmt->fmt.pix.bytesperline = get_v4l2_depth(fmt->fmt.pix.pixelformat)
- * fmt->fmt.pix.width / 8;
- fmt->fmt.pix.sizeimage = gspca_get_buff_size(gspca_dev, mode);
+ memcpy(&fmt->fmt.pix, &gspca_dev->cam.cam_mode[mode],
+ sizeof fmt->fmt.pix);
return mode; /* used when s_fmt */
}
struct gspca_dev *gspca_dev = priv;
int ret;
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
- /* if v4l1 got JPEG */
- if (fmt->fmt.pix.pixelformat == 0
- && gspca_dev->streaming) {
- fmt->fmt.pix.width = gspca_dev->width;
- fmt->fmt.pix.height = gspca_dev->height;
- fmt->fmt.pix.pixelformat = gspca_dev->pixfmt;
- return 0;
- }
-#endif
if (mutex_lock_interruptible(&gspca_dev->queue_lock))
return -ERESTARTSYS;
" 0x08:stream 0x10:frame 0x20:packet 0x40:USBin 0x80:USBout"
" 0x0100: v4l2");
#endif
-module_param(comp_fac, int, 0644);
-MODULE_PARM_DESC(comp_fac,
- "Buffer size ratio when compressed in percent");
#define ISO_MAX_SIZE 0x8000 /* max size of one URB buffer (32 Kb) */
/* device information - set at probe time */
-struct cam_mode {
- __u32 pixfmt;
- short width;
- short height;
- short mode; /* subdriver value */
-};
struct cam {
char *dev_name;
- struct cam_mode *cam_mode; /* size nmodes */
+ struct v4l2_pix_format *cam_mode; /* size nmodes */
char nmodes;
__u8 epaddr;
};
struct gspca_frame *frame,
__u8 *data,
int len);
-typedef int (*cam_get_buff_size_op) (struct gspca_dev *gspca_dev, int mode);
struct ctrl {
struct v4l2_queryctrl qctrl;
cam_v_op stopN; /* called on stream off - main alt */
cam_v_op stop0; /* called on stream off - alt 0 */
cam_v_op close; /* called on close */
- cam_v_op dq_callback; /* called when a frame has been dequeued */
cam_pkt_op pkt_scan;
+/* optional operations */
+ cam_v_op dq_callback; /* called when a frame has been dequeued */
cam_jpg_op get_jcomp;
cam_jpg_op set_jcomp;
cam_qmnu_op querymenu;
- cam_get_buff_size_op get_buff_size; /* optional */
};
/* packet types when moving from iso buf to frame buf */
#include "gspca.h"
#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/Mars USB Camera Driver");
static struct ctrl sd_ctrls[] = {
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240, 2},
- {V4L2_PIX_FMT_JPEG, 640, 480, 1},
+static struct v4l2_pix_format vga_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 3 / 8 + 589,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 2},
+ {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 640,
+ .sizeimage = 640 * 480 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
};
/* MI Register table //elvis */
#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("Jean-Francois Moine <http://moinejf.free.fr>");
MODULE_DESCRIPTION("OV519 USB Camera Driver");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240},
- {V4L2_PIX_FMT_JPEG, 640, 480},
+static struct v4l2_pix_format vga_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 3 / 8 + 589,
+ .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 struct cam_mode sif_mode[] = {
- {V4L2_PIX_FMT_JPEG, 176, 144},
- {V4L2_PIX_FMT_JPEG, 352, 288},
+static struct v4l2_pix_format sif_mode[] = {
+ {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 176,
+ .sizeimage = 176 * 144 * 3 / 8 + 589,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
+ {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 352,
+ .sizeimage = 352 * 288 * 3 / 8 + 589,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 0},
};
/* OV519 Camera interface register numbers */
#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("Hans de Goede <j.w.r.degoede@hhs.nl>");
MODULE_DESCRIPTION("Pixart PAC207");
},
};
-static struct cam_mode sif_mode[] = {
- {V4L2_PIX_FMT_PAC207, 176, 144, 1},
- {V4L2_PIX_FMT_PAC207, 352, 288, 0},
+static struct v4l2_pix_format sif_mode[] = {
+ {176, 144, V4L2_PIX_FMT_PAC207, V4L2_FIELD_NONE,
+ .bytesperline = 176,
+ .sizeimage = (176 + 2) * 144,
+ /* uncompressed, add 2 bytes / line for line header */
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {352, 288, V4L2_PIX_FMT_PAC207, V4L2_FIELD_NONE,
+ .bytesperline = 352,
+ .sizeimage = 352 * 288 / 2, /* compressed */
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
static const __u8 pac207_sensor_init[][8] = {
{
}
-static int sd_get_buff_size_op(struct gspca_dev *gspca_dev, int mode)
-{
- switch (gspca_dev->cam.cam_mode[mode].width) {
- case 176: /* 176x144 */
- /* uncompressed, add 2 bytes / line for line header */
- return (176 + 2) * 144;
- case 352: /* 352x288 */
- /* compressed */
- return 352 * 288 / 2;
- }
- return -EIO; /* should never happen */
-}
-
/* auto gain and exposure algorithm based on the knee algorithm described here:
* <http://ytse.tricolour.net/docs/LowLightOptimization.html> */
static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
.close = sd_close,
.dq_callback = pac207_do_auto_gain,
.pkt_scan = sd_pkt_scan,
- .get_buff_size = sd_get_buff_size_op,
};
/* -- module initialisation -- */
#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("Thomas Kaiser thomas@kaiser-linux.li");
MODULE_DESCRIPTION("Pixart PAC7311");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 160, 120, 2},
- {V4L2_PIX_FMT_JPEG, 320, 240, 1},
- {V4L2_PIX_FMT_JPEG, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 160,
+ .sizeimage = 160 * 120 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 2},
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 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},
};
#define PAC7311_JPEG_HEADER_SIZE (sizeof pac7311_jpeg_header) /* (594) */
setcolors(gspca_dev);
/* set correct resolution */
- 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 2: /* 160x120 */
pac7311_reg_write(dev, 0xff, 0x04);
pac7311_reg_write(dev, 0x02, 0x03);
#include "gspca.h"
-#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3)
-static const char version[] = "2.1.3";
+#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/SN9C102 USB Camera Driver");
},
};
-/* fixme: should have V4L2_PIX_FMT_SN9C10X */
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_SN9C10X, 160, 120, 2},
- {V4L2_PIX_FMT_SN9C10X, 320, 240, 1},
- {V4L2_PIX_FMT_SN9C10X, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {160, 120, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE,
+ .bytesperline = 160,
+ .sizeimage = 160 * 120,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 2},
+ {320, 240, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {640, 480, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE,
+ .bytesperline = 640,
+ .sizeimage = 640 * 480,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
-static struct cam_mode sif_mode[] = {
- {V4L2_PIX_FMT_SN9C10X, 176, 144, 1},
- {V4L2_PIX_FMT_SN9C10X, 352, 288, 0},
+static struct v4l2_pix_format sif_mode[] = {
+ {176, 144, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE,
+ .bytesperline = 176,
+ .sizeimage = 176 * 144,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {352, 288, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE,
+ .bytesperline = 352,
+ .sizeimage = 352 * 288,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
static const __u8 probe_ov7630[] = {0x08, 0x44};
__u8 reg01, reg17;
__u8 reg17_19[3];
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
switch (sd->sensor) {
case SENSOR_HV7131R:
sn9c10x = initHv7131;
#include "gspca.h"
#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/SONIX JPEG USB Camera Driver");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 160, 120, 2},
- {V4L2_PIX_FMT_JPEG, 320, 240, 1},
- {V4L2_PIX_FMT_JPEG, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 160,
+ .sizeimage = 160 * 120 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 2},
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 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},
};
/*Data from sn9c102p+hv71331r */
reg_w(dev, 0x99, &data, 1);
}
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
reg1 = 0x02;
reg17 = 0x61;
switch (sd->sensor) {
#include "gspca.h"
#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/SPCA500 USB Camera Driver");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240, 1},
- {V4L2_PIX_FMT_JPEG, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 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 struct cam_mode sif_mode[] = {
- {V4L2_PIX_FMT_JPEG, 176, 144, 1},
- {V4L2_PIX_FMT_JPEG, 352, 288, 0},
+static struct v4l2_pix_format sif_mode[] = {
+ {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 176,
+ .sizeimage = 176 * 144 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
+ {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 352,
+ .sizeimage = 352 * 288 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 0},
};
/* Frame packet header offsets for the spca500 */
reg_w(gspca_dev->dev, 0, 0x8002, ymult);
/* use compressed mode, VGA, with mode specific subsample */
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
reg_w(gspca_dev->dev, 0, 0x8003, mode << 4);
}
#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("GSPCA/SPCA501 USB Camera Driver");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_SPCA501, 160, 120, 2},
- {V4L2_PIX_FMT_SPCA501, 320, 240, 1},
- {V4L2_PIX_FMT_SPCA501, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {160, 120, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
+ .bytesperline = 160,
+ .sizeimage = 160 * 120 * 3 / 8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 2},
+ {320, 240, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 3 / 8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {640, 480, V4L2_PIX_FMT_SPCA501, V4L2_FIELD_NONE,
+ .bytesperline = 640,
+ .sizeimage = 640 * 480 * 3 / 8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
#define SPCA50X_REG_USB 0x2 /* spca505 501 */
int mode;
/* memorize the wanted pixel format */
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
/* Enable ISO packet machine CTRL reg=2,
* index=1 bitmask=0x2 (bit ordinal 1) */
#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("GSPCA/SPCA505 USB Camera Driver");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_YUYV, 160, 120, 5},
- {V4L2_PIX_FMT_YUYV, 176, 144, 4},
- {V4L2_PIX_FMT_YUYV, 320, 240, 2},
- {V4L2_PIX_FMT_YUYV, 352, 288, 1},
- {V4L2_PIX_FMT_YUYV, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 160 * 2,
+ .sizeimage = 160 * 120 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 5},
+ {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 176 * 2,
+ .sizeimage = 176 * 144 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 4},
+ {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 320 * 2,
+ .sizeimage = 320 * 240 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 2},
+ {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 352 * 2,
+ .sizeimage = 352 * 288 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 640 * 2,
+ .sizeimage = 640 * 480 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
#define SPCA50X_OFFSET_DATA 10
* only once after loading module */
/* stopping usb registers Tomasz change */
reg_write(dev, 0x02, 0x0, 0x0);
- 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_write(dev, 0x04, 0x00, 0x00);
reg_write(dev, 0x04, 0x06, 0x10);
#include "gspca.h"
-#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0)
-static const char version[] = "2.1.0";
+#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/SPCA506 USB Camera Driver");
/* specific webcam descriptor */
struct sd {
- struct gspca_dev gspca_dev; /* !! must be the first item */
+ struct gspca_dev gspca_dev; /* !! must be the first item */
int buflen;
- unsigned char tmpbuf[640 * 480 * 3]; /* YYUV per line */
- unsigned char tmpbuf2[640 * 480 * 2]; /* YUYV */
+ __u8 tmpbuf[640 * 480 * 3]; /* YYUV per line */
+ __u8 tmpbuf2[640 * 480 * 2]; /* YUYV */
unsigned char brightness;
unsigned char contrast;
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_YUYV, 160, 120, 5},
- {V4L2_PIX_FMT_YUYV, 176, 144, 4},
- {V4L2_PIX_FMT_YUYV, 320, 240, 2},
- {V4L2_PIX_FMT_YUYV, 352, 288, 1},
- {V4L2_PIX_FMT_YUYV, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 160 * 2,
+ .sizeimage = 160 * 120 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 5},
+ {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 176 * 2,
+ .sizeimage = 176 * 144 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 4},
+ {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 320 * 2,
+ .sizeimage = 320 * 240 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 2},
+ {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 352 * 2,
+ .sizeimage = 352 * 288 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 640 * 2,
+ .sizeimage = 640 * 480 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
#define SPCA50X_OFFSET_DATA 10
__u16 reg)
{
int retry = 60;
- unsigned char Data[2];
+ __u8 Data[2];
reg_w(gspca_dev->dev, 0x07, reg, 0x0001);
reg_w(gspca_dev->dev, 0x07, valeur, 0x0000);
static int spca506_ReadI2c(struct gspca_dev *gspca_dev, __u16 reg)
{
int retry = 60;
- unsigned char Data[2];
- unsigned char value;
+ __u8 Data[2];
+ __u8 value;
reg_w(gspca_dev->dev, 0x07, SAA7113_I2C_BASE_WRITE, 0x0004);
reg_w(gspca_dev->dev, 0x07, reg, 0x0001);
reg_w(dev, 0x05, 0x00, 0x0004);
reg_w(dev, 0x03, 0x10, 0x0001);
reg_w(dev, 0x03, 0x78, 0x0000);
- 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:
spca506_Setsize(gspca_dev, 0, 0x10, 0x10);
break;
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
- unsigned char *data, /* isoc packet */
+ __u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
#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("GSPCA/SPCA508 USB Camera Driver");
},
};
-static struct cam_mode sif_mode[] = {
- {V4L2_PIX_FMT_YUYV, 160, 120, 3},
- {V4L2_PIX_FMT_YUYV, 176, 144, 2},
- {V4L2_PIX_FMT_YUYV, 320, 240, 1},
- {V4L2_PIX_FMT_YUYV, 352, 288, 0},
+static struct v4l2_pix_format sif_mode[] = {
+ {160, 120, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 160 * 2,
+ .sizeimage = 160 * 120 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 3},
+ {176, 144, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 176 * 2,
+ .sizeimage = 176 * 144 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 2},
+ {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 320 * 2,
+ .sizeimage = 320 * 240 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {352, 288, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 352 * 2,
+ .sizeimage = 352 * 288 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
/* Frame packet header offsets for the spca508 */
{
int mode;
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
reg_write(gspca_dev->dev, 0x8500, mode);
switch (mode) {
case 0:
#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("GSPCA/SPCA561 USB Camera Driver");
},
};
-static struct cam_mode sif_mode[] = {
- {V4L2_PIX_FMT_SGBRG8, 160, 120, 3},
- {V4L2_PIX_FMT_SGBRG8, 176, 144, 2},
- {V4L2_PIX_FMT_SPCA561, 320, 240, 1},
- {V4L2_PIX_FMT_SPCA561, 352, 288, 0},
+static struct v4l2_pix_format sif_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_SPCA561, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 4 / 8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {352, 288, V4L2_PIX_FMT_SPCA561, V4L2_FIELD_NONE,
+ .bytesperline = 352,
+ .sizeimage = 352 * 288 * 4 / 8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
/*
__u8 Reg8307[] = { 0xaa, 0x00 };
int mode;
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
switch (sd->chip_revision) {
case Rev072A:
switch (mode) {
#include "gspca.h"
#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("Jean-Francois Moine <http://moinejf.free.fr>");
MODULE_DESCRIPTION("Syntek DV4000 (STK014) USB Camera Driver");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240},
- {V4L2_PIX_FMT_JPEG, 640, 480},
+static struct v4l2_pix_format vga_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 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},
};
/* -- read a register -- */
#include "gspca.h"
#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/SPCA5xx USB Camera Driver");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240, 2},
- {V4L2_PIX_FMT_JPEG, 640, 480, 1},
+static struct v4l2_pix_format vga_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 2},
+ {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 640,
+ .sizeimage = 640 * 480 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
};
-static struct cam_mode custom_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240, 2},
- {V4L2_PIX_FMT_JPEG, 464, 480, 1},
+static struct v4l2_pix_format custom_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 2},
+ {464, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 464,
+ .sizeimage = 464 * 480 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
};
-static struct cam_mode vga_mode2[] = {
- {V4L2_PIX_FMT_JPEG, 176, 144, 4},
- {V4L2_PIX_FMT_JPEG, 320, 240, 3},
- {V4L2_PIX_FMT_JPEG, 352, 288, 2},
- {V4L2_PIX_FMT_JPEG, 640, 480, 1},
+static struct v4l2_pix_format vga_mode2[] = {
+ {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 176,
+ .sizeimage = 176 * 144 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 4},
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 3},
+ {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 352,
+ .sizeimage = 352 * 288 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 2},
+ {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 640,
+ .sizeimage = 640 * 480 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
};
#define SPCA50X_OFFSET_DATA 10
__u8 Type;
int rc;
- Size = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ Size = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Type = 0;
switch (sd->bridge) {
case BRIDGE_SPCA533:
#define MODULE_NAME "t613"
#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";
#define MAX_GAMMA 0x10 /* 0 to 15 */
"Negative",
};
-static struct cam_mode vga_mode_t16[] = {
- {V4L2_PIX_FMT_JPEG, 160, 120, 4},
- {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_t16[] = {
+ {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 160,
+ .sizeimage = 160 * 120 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 4},
+ {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},
};
#define T16_OFFSET_DATA 631
0xb8, 0x00, 0xb9, 0xe7, 0xba, 0x01 };
static const __u8 t4[] = { 0x0b, 0x04, 0x0a, 0x40 };
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode]. mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode]. priv;
switch (mode) {
case 1: /* 352x288 */
t2[1] = 0x40;
#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("TV8532 USB Camera Driver");
},
};
-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},
};
/*
/************************************************/
data = TESTCOMP; /* 0x72 compressed mode */
reg_w(dev, TV8532_QUANT_COMP, &data, 1); /* 0x28 */
- if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) {
+ if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
/* 176x144 */
data = QCIFLINE; /* 0x84; // CIF | 4 packet */
reg_w(dev, TV8532_MODE_PACKET, &data, 1); /* 0x29 */
#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("GSPCA/VC032X USB Camera Driver");
},
};
-static struct cam_mode vc0321_mode[] = {
- {V4L2_PIX_FMT_YUYV, 320, 240, 1},
- {V4L2_PIX_FMT_YUYV, 640, 480, 0},
+static struct v4l2_pix_format vc0321_mode[] = {
+ {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 320 * 2,
+ .sizeimage = 320 * 240 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 1},
+ {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
+ .bytesperline = 640 * 2,
+ .sizeimage = 640 * 480 * 2,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 0},
};
-static struct cam_mode vc0323_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240, 1},
- {V4L2_PIX_FMT_JPEG, 640, 480, 0},
+static struct v4l2_pix_format vc0323_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 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 const __u8 mi1310_socinitVGA_JPG[][4] = {
reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfef);
}
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
switch (sd->sensor) {
case SENSOR_HV7131R:
GammaT = hv7131r_gamma;
#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>, "
"Serge A. Suchkov <Serge.A.S@tochka.ru>");
},
};
-static struct cam_mode vga_mode[] = {
- {V4L2_PIX_FMT_JPEG, 320, 240, 1},
- {V4L2_PIX_FMT_JPEG, 640, 480, 0},
+static struct v4l2_pix_format vga_mode[] = {
+ {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 240 * 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 struct cam_mode sif_mode[] = {
- {V4L2_PIX_FMT_JPEG, 176, 144, 1},
- {V4L2_PIX_FMT_JPEG, 352, 288, 0},
+static struct v4l2_pix_format sif_mode[] = {
+ {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 176,
+ .sizeimage = 176 * 144 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
+ {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 352,
+ .sizeimage = 352 * 288 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 0},
};
/* usb exchanges */
};
i = sd->lightfreq * 2;
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
if (!mode)
i++; /* 640x480 */
zc3_freq = freq_tb[(int) sd->sensor][i];
/* 16 */
};
- mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode;
+ mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
zc3_init = init_tb[(int) sd->sensor][mode];
switch (sd->sensor) {
case SENSOR_HV7131B: