summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/spca505.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-07-07 12:00:02 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-07 12:00:02 -0300
commit876b68cd089ef4531e4d3ce90c3c3d3ddd4e1e84 (patch)
treeaf6fbec2863ac782814892e9c5681cce64a9b008 /linux/drivers/media/video/gspca/spca505.c
parentff46ee4712cba0b0c55a2524553637e9c08120de (diff)
parent1cc2bcdebab8f8ecb9e95fb82ca21e0e90a48006 (diff)
downloadmediapointer-dvb-s2-876b68cd089ef4531e4d3ce90c3c3d3ddd4e1e84.tar.gz
mediapointer-dvb-s2-876b68cd089ef4531e4d3ce90c3c3d3ddd4e1e84.tar.bz2
merge: http://linuxtv.org/hg/~jfrancois/gspca/
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/gspca/spca505.c')
-rw-r--r--linux/drivers/media/video/gspca/spca505.c60
1 files changed, 40 insertions, 20 deletions
diff --git a/linux/drivers/media/video/gspca/spca505.c b/linux/drivers/media/video/gspca/spca505.c
index 840785cec..cecbc4362 100644
--- a/linux/drivers/media/video/gspca/spca505.c
+++ b/linux/drivers/media/video/gspca/spca505.c
@@ -23,8 +23,8 @@
#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/SPCA505 USB Camera Driver");
@@ -66,12 +66,32 @@ static struct ctrl sd_ctrls[] = {
},
};
-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
@@ -91,7 +111,7 @@ static struct cam_mode vga_mode[] = {
/*
* Data to initialize a SPCA505. Common to the CCD and external modes
*/
-static __u16 spca505_init_data[][3] = {
+static const __u16 spca505_init_data[][3] = {
/* line bmRequest,value,index */
/* 1819 */
{SPCA50X_REG_GLOBAL, SPCA50X_GMISC3_SAA7113RST, SPCA50X_GLOBAL_MISC3},
@@ -130,7 +150,7 @@ static __u16 spca505_init_data[][3] = {
/*
* Data to initialize the camera using the internal CCD
*/
-static __u16 spca505_open_data_ccd[][3] = {
+static const __u16 spca505_open_data_ccd[][3] = {
/* line bmRequest,value,index */
/* Internal CCD data set */
/* 1891 */ {0x3, 0x04, 0x01},
@@ -312,7 +332,7 @@ static __u16 spca505_open_data_ccd[][3] = {
/*
* Data to initialize the camera in external video mode
*/
-static __u16 spca505_open_data_ext[][3] = {
+static const __u16 spca505_open_data_ext[][3] = {
/* line bmRequest,value,index */
/* External video input dataset */
/* 0808 */ {0x3, 0x04, 0x01},
@@ -350,7 +370,7 @@ static __u16 spca505_open_data_ext[][3] = {
/*
* Additional data needed to initialze the camera in external mode
*/
-static __u16 spca505_open_data2[][3] = {
+static const __u16 spca505_open_data2[][3] = {
/* line bmRequest,value,index */
/* 1384 */ {0x3, 0x68, 0x03},
/* 1385 */ {0x3, 0x10, 0x01},
@@ -388,7 +408,7 @@ static __u16 spca505_open_data2[][3] = {
/*
* Data to initialize a SPCA505. Common to the CCD and external modes
*/
-static __u16 spca505b_init_data[][3] = {
+static const __u16 spca505b_init_data[][3] = {
/* start */
{0x02, 0x00, 0x00}, /* init */
{0x02, 0x00, 0x01},
@@ -452,7 +472,7 @@ static __u16 spca505b_init_data[][3] = {
/*
* Data to initialize the camera using the internal CCD
*/
-static __u16 spca505b_open_data_ccd[][3] = {
+static const __u16 spca505b_open_data_ccd[][3] = {
/* {0x02,0x00,0x00}, */
{0x03, 0x04, 0x01}, /* rst */
@@ -648,7 +668,7 @@ static int reg_read(struct usb_device *dev,
__u16 length) /* wLength (1 or 2 only) */
{
int ret;
- unsigned char buf[4];
+ __u8 buf[4];
buf[1] = 0;
ret = usb_control_msg(dev,
@@ -668,7 +688,7 @@ static int reg_read(struct usb_device *dev,
}
static int write_vector(struct gspca_dev *gspca_dev,
- __u16 data[][3])
+ const __u16 data[][3])
{
struct usb_device *dev = gspca_dev->dev;
int ret, i = 0;
@@ -777,7 +797,7 @@ static void sd_start(struct gspca_dev *gspca_dev)
* 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);
@@ -870,7 +890,7 @@ static void yyuv_decode(unsigned char *out,
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;
@@ -947,7 +967,7 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
}
/* sub-driver description */
-static struct sd_desc sd_desc = {
+static const struct sd_desc sd_desc = {
.name = MODULE_NAME,
.ctrls = sd_ctrls,
.nctrls = ARRAY_SIZE(sd_ctrls),
@@ -962,7 +982,7 @@ static struct sd_desc sd_desc = {
/* -- module initialisation -- */
#define DVNM(name) .driver_info = (kernel_ulong_t) name
-static __devinitdata struct usb_device_id device_table[] = {
+static const __devinitdata struct usb_device_id device_table[] = {
{USB_DEVICE(0x041e, 0x401d), DVNM("Creative Webcam NX ULTRA")},
{USB_DEVICE(0x0733, 0x0430), DVNM("Intel PC Camera Pro")},
{}