summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/tv8532.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/gspca/tv8532.c')
-rw-r--r--linux/drivers/media/video/gspca/tv8532.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/linux/drivers/media/video/gspca/tv8532.c b/linux/drivers/media/video/gspca/tv8532.c
index 9af2a51bb..b9837841c 100644
--- a/linux/drivers/media/video/gspca/tv8532.c
+++ b/linux/drivers/media/video/gspca/tv8532.c
@@ -22,8 +22,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("TV8532 USB Camera Driver");
@@ -81,9 +81,17 @@ static struct ctrl sd_ctrls[] = {
},
};
-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},
};
/*
@@ -152,7 +160,7 @@ static struct cam_mode sif_mode[] = {
#define TV8532_AD_ROWBEGIN_L 0x14
#define TV8532_AD_ROWBEGIN_H 0x15
-static __u32 tv_8532_eeprom_data[] = {
+static const __u32 tv_8532_eeprom_data[] = {
/* add dataL dataM dataH */
0x00010001, 0x01018011, 0x02050014, 0x0305001c,
0x040d001e, 0x0505001f, 0x06050519, 0x0705011b,
@@ -192,8 +200,7 @@ static void tv_8532WriteEEprom(struct gspca_dev *gspca_dev)
datacmd = 0xb0;;
reg_w(dev, TV8532_GPIO, &datacmd, 1);
datacmd = TV8532_CMD_EEprom_Open;
- reg_w(dev, TV8532_CTRL, &datacmd,
- 1);
+ reg_w(dev, TV8532_CTRL, &datacmd, 1);
/* msleep(1); */
while (tv_8532_eeprom_data[i]) {
reg = (tv_8532_eeprom_data[i] & 0xff000000) >> 24;
@@ -244,7 +251,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
static void tv_8532ReadRegisters(struct gspca_dev *gspca_dev)
{
struct usb_device *dev = gspca_dev->dev;
- __u8 data = 0;
+ __u8 data;
/* __u16 vid, pid; */
reg_r(dev, 0x0001, &data);
@@ -276,7 +283,7 @@ static void tv_8532ReadRegisters(struct gspca_dev *gspca_dev)
static void tv_8532_setReg(struct gspca_dev *gspca_dev)
{
struct usb_device *dev = gspca_dev->dev;
- __u8 data = 0;
+ __u8 data;
__u8 value[2] = { 0, 0 };
data = ADCBEGINL;
@@ -321,7 +328,7 @@ static void tv_8532_setReg(struct gspca_dev *gspca_dev)
static void tv_8532_PollReg(struct gspca_dev *gspca_dev)
{
struct usb_device *dev = gspca_dev->dev;
- __u8 data = 0;
+ __u8 data;
int i;
/* strange polling from tgc */
@@ -339,9 +346,9 @@ static void tv_8532_PollReg(struct gspca_dev *gspca_dev)
static int sd_open(struct gspca_dev *gspca_dev)
{
struct usb_device *dev = gspca_dev->dev;
- __u8 data = 0;
- __u8 dataStart = 0;
- __u8 value[2] = { 0, 0 };
+ __u8 data;
+ __u8 dataStart;
+ __u8 value[2];
data = 0x32;
reg_w(dev, TV8532_AD_SLOPE, &data, 1);
@@ -390,8 +397,7 @@ static int sd_open(struct gspca_dev *gspca_dev)
tv_8532_setReg(gspca_dev);
/*************************************************/
data = 0x0b;
- reg_w(dev, TV8532_GPIO_OE, &data,
- 1);
+ reg_w(dev, TV8532_GPIO_OE, &data, 1);
/*************************************************/
tv_8532_setReg(gspca_dev);
/*************************************************/
@@ -417,8 +423,7 @@ static void setbrightness(struct gspca_dev *gspca_dev)
static void sd_start(struct gspca_dev *gspca_dev)
{
struct usb_device *dev = gspca_dev->dev;
- __u8 data = 0;
- __u8 dataStart = 0;
+ __u8 data;
__u8 value[2];
data = 0x32;
@@ -443,7 +448,7 @@ static void sd_start(struct gspca_dev *gspca_dev)
/************************************************/
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 */
@@ -459,8 +464,8 @@ static void sd_start(struct gspca_dev *gspca_dev)
reg_w(dev, TV8532_POINT_L, &data, 1); /* 0x2d */
data = TESTPTH; /* 0x04; */
reg_w(dev, TV8532_POINT_H, &data, 1); /* 0x2e */
- dataStart = TESTPTBL; /* 0x04; */
- reg_w(dev, TV8532_POINTB_L, &dataStart, 1); /* 0x2f */
+ data = TESTPTBL; /* 0x04; */
+ reg_w(dev, TV8532_POINTB_L, &data, 1); /* 0x2f */
data = TESTPTBH; /* 0x04; */
reg_w(dev, TV8532_POINTB_H, &data, 1); /* 0x30 */
data = TV8532_CMD_UPDATE;
@@ -611,7 +616,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
static void setcontrast(struct gspca_dev *gspca_dev)
{
#if 0
- __u8 value[2] = { 0xfc, 0x01 };
+ __u8 value[2];
__u8 data;
value[0] = (gspca_dev->contrast) & 0xff;
@@ -662,7 +667,7 @@ static int sd_getcontrast(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),
@@ -677,7 +682,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(0x046d, 0x0920), DVNM("QC Express")},
{USB_DEVICE(0x046d, 0x0921), DVNM("Labtec Webcam")},
{USB_DEVICE(0x0545, 0x808b), DVNM("Veo Stingray")},