summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/b2c2/flexcop-pci.c4
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dvb-usb.h4
-rw-r--r--linux/drivers/media/radio/radio-si470x.c4
-rw-r--r--linux/drivers/media/video/cx88/cx88.h1
-rw-r--r--linux/drivers/media/video/em28xx/em28xx.h4
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c6
-rw-r--r--linux/drivers/media/video/gspca/mars.c23
-rw-r--r--linux/drivers/media/video/gspca/vc032x.c2
-rw-r--r--linux/drivers/media/video/meye.c4
-rw-r--r--linux/drivers/media/video/stk-webcam.c8
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-video.c3
-rw-r--r--linux/drivers/media/video/v4l2-dev.c7
-rw-r--r--linux/drivers/media/video/v4l2-ioctl.c5
-rw-r--r--linux/drivers/media/video/zoran/zoran_driver.c7
14 files changed, 29 insertions, 53 deletions
diff --git a/linux/drivers/media/dvb/b2c2/flexcop-pci.c b/linux/drivers/media/dvb/b2c2/flexcop-pci.c
index 5baf9ded9..2905ffccf 100644
--- a/linux/drivers/media/dvb/b2c2/flexcop-pci.c
+++ b/linux/drivers/media/dvb/b2c2/flexcop-pci.c
@@ -67,11 +67,7 @@ struct flexcop_pci {
unsigned long last_irq;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
- struct work_struct irq_check_work;
-#else
struct delayed_work irq_check_work;
-#endif
struct flexcop_device *fc_dev;
};
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
index 72503e2da..1279046e0 100644
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -364,11 +364,7 @@ struct dvb_usb_device {
/* remote control */
struct input_dev *rc_input_dev;
char rc_phys[64];
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
- struct work_struct rc_query_work;
-#else
struct delayed_work rc_query_work;
-#endif
u32 last_event;
int last_state;
diff --git a/linux/drivers/media/radio/radio-si470x.c b/linux/drivers/media/radio/radio-si470x.c
index b0a1e5832..a5ba4bf21 100644
--- a/linux/drivers/media/radio/radio-si470x.c
+++ b/linux/drivers/media/radio/radio-si470x.c
@@ -459,11 +459,7 @@ struct si470x_device {
unsigned short registers[RADIO_REGISTER_NUM];
/* RDS receive buffer */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
- struct work_struct work;
-#else
struct delayed_work work;
-#endif
wait_queue_head_t read_queue;
struct mutex lock; /* buffer locking */
unsigned char *buffer; /* size is always multiple of three */
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index d641c24c3..2227d93c7 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -306,7 +306,6 @@ struct cx88_dmaqueue {
struct btcx_riscmem stopper;
u32 count;
};
-struct cx88_core;
struct cx88_core {
struct list_head devlist;
diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h
index 235b63499..43c537e66 100644
--- a/linux/drivers/media/video/em28xx/em28xx.h
+++ b/linux/drivers/media/video/em28xx/em28xx.h
@@ -571,11 +571,7 @@ struct em28xx {
/* Snapshot button */
char snapshot_button_path[30]; /* path of the input dev */
struct input_dev *sbutton_input_dev;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
- struct work_struct sbutton_query_work;
-#else
struct delayed_work sbutton_query_work;
-#endif
struct em28xx_dvb *dvb;
};
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index 2bd7d4d99..7e79f7eca 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -104,7 +104,11 @@ int s5k4aa_probe(struct sd *sd)
}
/* Test some registers, but we don't know their exact meaning yet */
- if (m5602_read_sensor(sd, 0x00, prod_id, sizeof(prod_id)))
+ if (m5602_read_sensor(sd, 0x00, prod_id, 2))
+ return -ENODEV;
+ if (m5602_read_sensor(sd, 0x02, prod_id+2, 2))
+ return -ENODEV;
+ if (m5602_read_sensor(sd, 0x04, prod_id+4, 2))
return -ENODEV;
if (memcmp(prod_id, expected_prod_id, sizeof(prod_id)))
diff --git a/linux/drivers/media/video/gspca/mars.c b/linux/drivers/media/video/gspca/mars.c
index c5a19b5bc..5d54893eb 100644
--- a/linux/drivers/media/video/gspca/mars.c
+++ b/linux/drivers/media/video/gspca/mars.c
@@ -69,10 +69,10 @@ static struct ctrl sd_ctrls[] = {
.id = V4L2_CID_SATURATION,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Color",
- .minimum = 0,
- .maximum = 220,
+ .minimum = 1,
+ .maximum = 255,
.step = 1,
-#define COLOR_DEF 190
+#define COLOR_DEF 200
.default_value = COLOR_DEF,
},
.set = sd_setcolors,
@@ -191,7 +191,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
struct sd *sd = (struct sd *) gspca_dev;
int err_code;
u8 *data;
- int i, val;
+ int i;
data = gspca_dev->usb_buf;
@@ -253,9 +253,11 @@ static int sd_start(struct gspca_dev *gspca_dev)
data[1] = 0; /* reg 94, Y Gain (auto) */
#if 1
/*jfm: from win trace*/
- val = sd->colors * 0x40 + 0x400;
- data[2] = val; /* reg 0x5f/0x60 (LE) = saturation */
- data[3] = val >> 8;
+ /* reg 0x5f/0x60 (LE) = saturation */
+ /* h (60): xxxx x100
+ * l (5f): xxxx x000 */
+ data[2] = sd->colors << 3;
+ data[3] = ((sd->colors >> 2) & 0xf8) | 0x04;
data[4] = sd->brightness; /* reg 0x61 = brightness */
data[5] = 0x00;
#else
@@ -403,10 +405,11 @@ static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val)
sd->colors = val;
if (gspca_dev->streaming) {
- val = val * 0x40 + 0x400;
+
+ /* see sd_start */
gspca_dev->usb_buf[0] = 0x5f;
- gspca_dev->usb_buf[1] = val;
- gspca_dev->usb_buf[2] = val >> 8;
+ gspca_dev->usb_buf[1] = sd->colors << 3;
+ gspca_dev->usb_buf[2] = ((sd->colors >> 2) & 0xf8) | 0x04;
reg_w(gspca_dev, 3);
}
return 0;
diff --git a/linux/drivers/media/video/gspca/vc032x.c b/linux/drivers/media/video/gspca/vc032x.c
index 72cbf56c9..f1c149476 100644
--- a/linux/drivers/media/video/gspca/vc032x.c
+++ b/linux/drivers/media/video/gspca/vc032x.c
@@ -2316,7 +2316,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
break;
case SENSOR_MI1310_SOC:
GammaT = mi1320_gamma;
- MatrixT = mi0360_matrix;
+ MatrixT = mi1320_matrix;
switch (mode) {
case 1:
init = mi1310_socinitQVGA_JPG; /* 320x240 */
diff --git a/linux/drivers/media/video/meye.c b/linux/drivers/media/video/meye.c
index 323aa378b..0fd646f7c 100644
--- a/linux/drivers/media/video/meye.c
+++ b/linux/drivers/media/video/meye.c
@@ -1451,10 +1451,6 @@ static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *buf)
if (index < 0 || index >= gbuffers)
return -EINVAL;
- memset(buf, 0, sizeof(*buf));
-
- buf->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf->index = index;
buf->bytesused = meye.grab_buffer[index].size;
buf->flags = V4L2_BUF_FLAG_MAPPED;
diff --git a/linux/drivers/media/video/stk-webcam.c b/linux/drivers/media/video/stk-webcam.c
index 3af084640..52bf877bf 100644
--- a/linux/drivers/media/video/stk-webcam.c
+++ b/linux/drivers/media/video/stk-webcam.c
@@ -1140,16 +1140,10 @@ static int stk_vidioc_reqbufs(struct file *filp,
static int stk_vidioc_querybuf(struct file *filp,
void *priv, struct v4l2_buffer *buf)
{
- int index;
struct stk_camera *dev = priv;
struct stk_sio_buffer *sbuf;
- if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
- return -EINVAL;
-
- index = buf->index;
-
- if (index < 0 || index >= dev->n_sbufs)
+ if (buf->index < 0 || buf->index >= dev->n_sbufs)
return -EINVAL;
sbuf = dev->sio_bufs + buf->index;
*buf = sbuf->v4lbuf;
diff --git a/linux/drivers/media/video/usbvision/usbvision-video.c b/linux/drivers/media/video/usbvision/usbvision-video.c
index 33d79a5da..863fcb316 100644
--- a/linux/drivers/media/video/usbvision/usbvision-video.c
+++ b/linux/drivers/media/video/usbvision/usbvision-video.c
@@ -788,9 +788,6 @@ static int vidioc_querybuf (struct file *file,
/* FIXME : must control
that buffers are mapped (VIDIOC_REQBUFS has been called) */
- if(vb->type != V4L2_CAP_VIDEO_CAPTURE) {
- return -EINVAL;
- }
if(vb->index>=usbvision->num_frames) {
return -EINVAL;
}
diff --git a/linux/drivers/media/video/v4l2-dev.c b/linux/drivers/media/video/v4l2-dev.c
index e6dc1279a..861e3194f 100644
--- a/linux/drivers/media/video/v4l2-dev.c
+++ b/linux/drivers/media/video/v4l2-dev.c
@@ -404,12 +404,11 @@ int video_register_device_index(struct video_device *vdev, int type, int nr,
/* A minor value of -1 marks this video device as never
having been registered */
- if (vdev)
- vdev->minor = -1;
+ vdev->minor = -1;
/* the release callback MUST be present */
- WARN_ON(!vdev || !vdev->release);
- if (!vdev || !vdev->release)
+ WARN_ON(!vdev->release);
+ if (!vdev->release)
return -EINVAL;
/* Part 1: check device type */
diff --git a/linux/drivers/media/video/v4l2-ioctl.c b/linux/drivers/media/video/v4l2-ioctl.c
index ec139df5c..f2d74fedf 100644
--- a/linux/drivers/media/video/v4l2-ioctl.c
+++ b/linux/drivers/media/video/v4l2-ioctl.c
@@ -970,6 +970,11 @@ static long __video_do_ioctl(struct file *file,
if (ret)
break;
+ /* Zero out all fields starting with bytesysed, which is
+ * everything but index and type. */
+ memset(0, &p->bytesused,
+ sizeof(*p) - offsetof(typeof(*p), bytesused));
+
ret = ops->vidioc_querybuf(file, fh, p);
if (!ret)
dbgbuf(cmd, vfd, p);
diff --git a/linux/drivers/media/video/zoran/zoran_driver.c b/linux/drivers/media/video/zoran/zoran_driver.c
index 7ddbdf37d..8eda83b06 100644
--- a/linux/drivers/media/video/zoran/zoran_driver.c
+++ b/linux/drivers/media/video/zoran/zoran_driver.c
@@ -2499,12 +2499,7 @@ static int zoran_querybuf(struct file *file, void *__fh, struct v4l2_buffer *buf
{
struct zoran_fh *fh = __fh;
struct zoran *zr = fh->zr;
- __u32 type = buf->type;
- int index = buf->index, res;
-
- memset(buf, 0, sizeof(*buf));
- buf->type = type;
- buf->index = index;
+ int res;
mutex_lock(&zr->resource_lock);
res = zoran_v4l2_buffer_status(file, buf, buf->index);