summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-12 11:34:38 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-07-12 11:34:38 +0200
commit5d9abf072da54a382d318a6a23bc4d65d1c9f6a7 (patch)
tree0091520c14854a60961fc21d8942a1cf32ffa56b /linux/drivers/media/video
parent0b44aa87bd1a08f0c6c64872413937415f5cc7e9 (diff)
parent5d6597046c8d57aa650a06343c4d63ba7dbe57dc (diff)
downloadmediapointer-dvb-s2-5d9abf072da54a382d318a6a23bc4d65d1c9f6a7.tar.gz
mediapointer-dvb-s2-5d9abf072da54a382d318a6a23bc4d65d1c9f6a7.tar.bz2
merge: from v4l-dvb
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/bt819.c2
-rw-r--r--linux/drivers/media/video/cx18/cx18-av-firmware.c2
-rw-r--r--linux/drivers/media/video/gspca/gspca.c6
-rw-r--r--linux/drivers/media/video/ivtv/ivtvfb.c7
-rw-r--r--linux/drivers/media/video/ov7670.c16
-rw-r--r--linux/drivers/media/video/ovcamchip/ovcamchip_core.c1
-rw-r--r--linux/drivers/media/video/s2255drv.c61
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c25
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-dvb.c10
-rw-r--r--linux/drivers/media/video/saa7134/saa7134.h1
-rw-r--r--linux/drivers/media/video/tvaudio.c13
-rw-r--r--linux/drivers/media/video/uvc/uvc_driver.c18
-rw-r--r--linux/drivers/media/video/uvc/uvc_v4l2.c2
-rw-r--r--linux/drivers/media/video/videobuf-dma-sg.c6
-rw-r--r--linux/drivers/media/video/zoran_card.c11
15 files changed, 107 insertions, 74 deletions
diff --git a/linux/drivers/media/video/bt819.c b/linux/drivers/media/video/bt819.c
index 402bccaf7..90be239cc 100644
--- a/linux/drivers/media/video/bt819.c
+++ b/linux/drivers/media/video/bt819.c
@@ -517,7 +517,7 @@ bt819_detect_client (struct i2c_adapter *adapter,
dprintk(1,
KERN_INFO
- "saa7111.c: detecting bt819 client on address 0x%x\n",
+ "bt819: detecting bt819 client on address 0x%x\n",
address << 1);
/* Check if the adapter supports the needed features */
diff --git a/linux/drivers/media/video/cx18/cx18-av-firmware.c b/linux/drivers/media/video/cx18/cx18-av-firmware.c
index 6fa3b01a1..834b92482 100644
--- a/linux/drivers/media/video/cx18/cx18-av-firmware.c
+++ b/linux/drivers/media/video/cx18/cx18-av-firmware.c
@@ -30,7 +30,7 @@ int cx18_av_loadfw(struct cx18 *cx)
const struct firmware *fw = NULL;
u32 size;
u32 v;
- u8 *ptr;
+ const u8 *ptr;
int i;
int retries = 0;
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c
index eb7abbaa8..cb07f2b2e 100644
--- a/linux/drivers/media/video/gspca/gspca.c
+++ b/linux/drivers/media/video/gspca/gspca.c
@@ -219,7 +219,7 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
if (len > 0) {
if (frame->data_end - frame->data + len
> frame->v4l2_buf.length) {
- PDEBUG(D_ERR|D_PACK, "frame overflow %d > %d",
+ PDEBUG(D_ERR|D_PACK, "frame overflow %zd > %d",
frame->data_end - frame->data + len,
frame->v4l2_buf.length);
packet_type = DISCARD_PACKET;
@@ -1567,7 +1567,7 @@ static ssize_t dev_read(struct file *file, char __user *data,
struct timeval timestamp;
int n, ret, ret2;
- PDEBUG(D_FRAM, "read (%d)", count);
+ PDEBUG(D_FRAM, "read (%zd)", count);
if (!gspca_dev->present)
return -ENODEV;
switch (gspca_dev->memory) {
@@ -1618,7 +1618,7 @@ static ssize_t dev_read(struct file *file, char __user *data,
ret = copy_to_user(data, frame->data, count);
if (ret != 0) {
PDEBUG(D_ERR|D_STREAM,
- "read cp to user lack %d / %d", ret, count);
+ "read cp to user lack %d / %zd", ret, count);
ret = -EFAULT;
goto out;
}
diff --git a/linux/drivers/media/video/ivtv/ivtvfb.c b/linux/drivers/media/video/ivtv/ivtvfb.c
index 14f93341f..bdfda48e5 100644
--- a/linux/drivers/media/video/ivtv/ivtvfb.c
+++ b/linux/drivers/media/video/ivtv/ivtvfb.c
@@ -417,10 +417,11 @@ static ssize_t ivtvfb_write(struct fb_info *info, const char __user *buf,
if (!err) {
/* If transfer size > threshold and both src/dst
addresses are aligned, use DMA */
- if (count >= 4096 && ((u32)buf & 3) == ((u32)dst & 3)) {
+ if (count >= 4096 &&
+ ((unsigned long)buf & 3) == ((unsigned long)dst & 3)) {
/* Odd address = can't DMA. Align */
- if ((u32)dst & 3) {
- lead = 4 - ((u32)dst & 3);
+ if ((unsigned long)dst & 3) {
+ lead = 4 - ((unsigned long)dst & 3);
memcpy(dst, buf, lead);
buf += lead;
dst += lead;
diff --git a/linux/drivers/media/video/ov7670.c b/linux/drivers/media/video/ov7670.c
index fb8c607fc..dcf7678a8 100644
--- a/linux/drivers/media/video/ov7670.c
+++ b/linux/drivers/media/video/ov7670.c
@@ -407,8 +407,10 @@ static int ov7670_read(struct i2c_client *c, unsigned char reg,
int ret;
ret = i2c_smbus_read_byte_data(c, reg);
- if (ret >= 0)
+ if (ret >= 0) {
*value = (unsigned char) ret;
+ ret = 0;
+ }
return ret;
}
@@ -702,17 +704,17 @@ static int ov7670_try_fmt(struct i2c_client *c, struct v4l2_format *fmt,
for (index = 0; index < N_OV7670_FMTS; index++)
if (ov7670_formats[index].pixelformat == pix->pixelformat)
break;
- if (index >= N_OV7670_FMTS)
- return -EINVAL;
+ if (index >= N_OV7670_FMTS) {
+ /* default to first format */
+ index = 0;
+ pix->pixelformat = ov7670_formats[0].pixelformat;
+ }
if (ret_fmt != NULL)
*ret_fmt = ov7670_formats + index;
/*
* Fields: the OV devices claim to be progressive.
*/
- if (pix->field == V4L2_FIELD_ANY)
- pix->field = V4L2_FIELD_NONE;
- else if (pix->field != V4L2_FIELD_NONE)
- return -EINVAL;
+ pix->field = V4L2_FIELD_NONE;
/*
* Round requested image size down to the nearest
* we support, but not below the smallest.
diff --git a/linux/drivers/media/video/ovcamchip/ovcamchip_core.c b/linux/drivers/media/video/ovcamchip/ovcamchip_core.c
index 8063e33f1..065c24541 100644
--- a/linux/drivers/media/video/ovcamchip/ovcamchip_core.c
+++ b/linux/drivers/media/video/ovcamchip/ovcamchip_core.c
@@ -297,7 +297,6 @@ static int ovcamchip_attach(struct i2c_adapter *adap)
switch (adap->id) {
case I2C_HW_SMBUS_OV511:
case I2C_HW_SMBUS_OV518:
- case I2C_HW_SMBUS_OVFX2:
case I2C_HW_SMBUS_W9968CF:
PDEBUG(1, "Adapter ID 0x%06x accepted", adap->id);
break;
diff --git a/linux/drivers/media/video/s2255drv.c b/linux/drivers/media/video/s2255drv.c
index aca8c3d90..6eb396ffc 100644
--- a/linux/drivers/media/video/s2255drv.c
+++ b/linux/drivers/media/video/s2255drv.c
@@ -68,17 +68,17 @@
/* maximum time for DSP to start responding after last FW word loaded(ms) */
#define S2255_DSP_BOOTTIME 400
/* maximum time to wait for firmware to load (ms) */
-#define S2255_LOAD_TIMEOUT (5000+S2255_DSP_BOOTTIME)
+#define S2255_LOAD_TIMEOUT (5000 + S2255_DSP_BOOTTIME)
#define S2255_DEF_BUFS 16
#define MAX_CHANNELS 4
#define FRAME_MARKER 0x2255DA4AL
-#define MAX_PIPE_USBBLOCK (40*1024)
-#define DEFAULT_PIPE_USBBLOCK (16*1024)
+#define MAX_PIPE_USBBLOCK (40 * 1024)
+#define DEFAULT_PIPE_USBBLOCK (16 * 1024)
#define MAX_CHANNELS 4
#define MAX_PIPE_BUFFERS 1
#define SYS_FRAMES 4
/* maximum size is PAL full size plus room for the marker header(s) */
-#define SYS_FRAMES_MAXSIZE (720*288*2*2 + 4096)
+#define SYS_FRAMES_MAXSIZE (720 * 288 * 2 * 2 + 4096)
#define DEF_USB_BLOCK (4096)
#define LINE_SZ_4CIFS_NTSC 640
#define LINE_SZ_2CIFS_NTSC 640
@@ -169,7 +169,7 @@ struct s2255_bufferi {
#define DEF_MODEI_NTSC_CONT {FORMAT_NTSC, DEF_SCALE, DEF_COLOR, \
DEF_FDEC, DEF_BRIGHT, DEF_CONTRAST, DEF_SATURATION, \
- DEF_HUE, 0, DEF_USB_BLOCK, 0 }
+ DEF_HUE, 0, DEF_USB_BLOCK, 0}
struct s2255_dmaqueue {
struct list_head active;
@@ -276,6 +276,10 @@ struct s2255_fh {
struct s2255_mode mode;
};
+/*
+ * TODO: fixme S2255_MAX_USERS. Do not limit open driver handles.
+ * Limit V4L to one stream at a time.
+ */
#define S2255_MAX_USERS 1
#define CUR_USB_FWVER 774 /* current cypress EEPROM firmware version */
@@ -294,7 +298,7 @@ struct s2255_fh {
#define PREFIX_SIZE 512
/* Channels on box are in reverse order */
-static unsigned long G_chnmap[MAX_CHANNELS] = { 3, 2, 1, 0 };
+static unsigned long G_chnmap[MAX_CHANNELS] = {3, 2, 1, 0};
static LIST_HEAD(s2255_devlist);
@@ -330,11 +334,11 @@ static unsigned int vid_limit = 16; /* Video memory limit, in Mb */
/* start video number */
static int video_nr = -1; /* /dev/videoN, -1 for autodetect */
-module_param(debug, int, 0);
+module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Debug level(0-100) default 0");
-module_param(vid_limit, int, 0);
+module_param(vid_limit, int, 0644);
MODULE_PARM_DESC(vid_limit, "video memory limit(Mb)");
-module_param(video_nr, int, 0);
+module_param(video_nr, int, 0644);
MODULE_PARM_DESC(video_nr, "start video minor(-1 default autodetect)");
/* USB device table */
@@ -438,7 +442,10 @@ static int norm_minh(struct video_device *vdev)
}
-/* converts 2255 planar format to yuyv or uyvy */
+/*
+ * TODO: fixme: move YUV reordering to hardware
+ * converts 2255 planar format to yuyv or uyvy
+ */
static void planar422p_to_yuv_packed(const unsigned char *in,
unsigned char *out,
int width, int height,
@@ -503,7 +510,7 @@ static void s2255_fwchunk_complete(struct urb *urb)
struct usb_device *udev = urb->dev;
int len;
dprintk(100, "udev %p urb %p", udev, urb);
-
+ /* TODO: fixme. reflect change in status */
if (urb->status) {
dev_err(&udev->dev, "URB failed with status %d", urb->status);
return;
@@ -683,7 +690,7 @@ static int buffer_setup(struct videobuf_queue *vq, unsigned int *count,
if (0 == *count)
*count = S2255_DEF_BUFS;
- while (*size * *count > vid_limit * 1024 * 1024)
+ while (*size * (*count) > vid_limit * 1024 * 1024)
(*count)--;
return 0;
@@ -790,7 +797,7 @@ static int res_get(struct s2255_dev *dev, struct s2255_fh *fh)
static int res_locked(struct s2255_dev *dev, struct s2255_fh *fh)
{
- return (dev->resources[fh->channel]);
+ return dev->resources[fh->channel];
}
static void res_free(struct s2255_dev *dev, struct s2255_fh *fh)
@@ -807,7 +814,8 @@ static int vidioc_querycap(struct file *file, void *priv,
struct s2255_dev *dev = fh->dev;
strlcpy(cap->driver, "s2255", sizeof(cap->driver));
strlcpy(cap->card, "s2255", sizeof(cap->card));
- strlcpy(cap->bus_info, dev_name(&dev->udev->dev), sizeof(cap->bus_info));
+ strlcpy(cap->bus_info, dev_name(&dev->udev->dev),
+ sizeof(cap->bus_info));
cap->version = S2255_VERSION;
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
return 0;
@@ -840,8 +848,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
f->fmt.pix.pixelformat = fh->fmt->fourcc;
f->fmt.pix.bytesperline = f->fmt.pix.width * (fh->fmt->depth >> 3);
f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
-
- return (0);
+ return 0;
}
static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
@@ -962,7 +969,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
ret = vidioc_try_fmt_vid_cap(file, fh, f);
if (ret < 0)
- return (ret);
+ return ret;
fmt = format_by_fourcc(f->fmt.pix.pixelformat);
@@ -1337,7 +1344,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
inp->type = V4L2_INPUT_TYPE_CAMERA;
inp->std = S2255_NORMS;
strlcpy(inp->name, "Camera", sizeof(inp->name));
- return (0);
+ return 0;
}
static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
@@ -1361,7 +1368,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
for (i = 0; i < ARRAY_SIZE(s2255_qctrl); i++)
if (qc->id && qc->id == s2255_qctrl[i].id) {
memcpy(qc, &(s2255_qctrl[i]), sizeof(*qc));
- return (0);
+ return 0;
}
dprintk(4, "query_ctrl -EINVAL %d\n", qc->id);
@@ -1376,7 +1383,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
for (i = 0; i < ARRAY_SIZE(s2255_qctrl); i++)
if (ctrl->id == s2255_qctrl[i].id) {
ctrl->value = qctl_regs[i];
- return (0);
+ return 0;
}
dprintk(4, "g_ctrl -EINVAL\n");
@@ -1396,7 +1403,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
if (ctrl->id == s2255_qctrl[i].id) {
if (ctrl->value < s2255_qctrl[i].minimum ||
ctrl->value > s2255_qctrl[i].maximum)
- return (-ERANGE);
+ return -ERANGE;
qctl_regs[i] = ctrl->value;
/* update the mode to the corresponding value */
@@ -1572,6 +1579,11 @@ static void s2255_destroy(struct kref *kref)
usb_free_urb(dev->fw_data->fw_urb);
dev->fw_data->fw_urb = NULL;
}
+ /*
+ * TODO: fixme(above, below): potentially leaving timers alive.
+ * do not ignore timeout below if
+ * it occurs.
+ */
/* make sure we aren't waiting for the DSP */
if (atomic_read(&dev->fw_data->fw_state) == S2255_FW_LOADED_DSPWAIT) {
@@ -1583,15 +1595,12 @@ static void s2255_destroy(struct kref *kref)
}
if (dev->fw_data) {
+ if (dev->fw_data->fw)
+ release_firmware(dev->fw_data->fw);
kfree(dev->fw_data->pfw_data);
kfree(dev->fw_data);
}
- if (dev->fw_data->fw) {
- release_firmware(dev->fw_data->fw);
- dev->fw_data->fw = NULL;
- }
-
usb_put_dev(dev->udev);
dprintk(1, "%s", __func__);
kfree(dev);
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index f772e9da9..a2a4ca6f8 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -1287,6 +1287,22 @@ struct saa7134_board saa7134_boards[] = {
.vmux = 8,
}},
},
+ [SAA7134_BOARD_AVERMEDIA_M103] = {
+ /* Massimo Piccioni <dafastidio@libero.it> */
+ .name = "AVerMedia MiniPCI DVB-T Hybrid M103",
+ .audio_clock = 0x187de7,
+ .tuner_type = TUNER_XC2028,
+ .radio_type = UNSET,
+ .tuner_addr = ADDR_UNSET,
+ .radio_addr = ADDR_UNSET,
+ .mpeg = SAA7134_MPEG_DVB,
+ .inputs = {{
+ .name = name_tv,
+ .vmux = 1,
+ .amux = TV,
+ .tv = 1,
+ } },
+ },
[SAA7134_BOARD_NOVAC_PRIMETV7133] = {
/* toshii@netbsd.org */
.name = "Noval Prime TV 7133",
@@ -5416,6 +5432,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
.subdevice = 0x6290,
.driver_data = SAA7134_BOARD_BEHOLD_H6,
}, {
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
+ .subvendor = 0x1461, /* Avermedia Technologies Inc */
+ .subdevice = 0xf636,
+ .driver_data = SAA7134_BOARD_AVERMEDIA_M103,
+ }, {
/* --- boards without eeprom + subsystem ID --- */
.vendor = PCI_VENDOR_ID_PHILIPS,
.device = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -5517,6 +5539,7 @@ static int saa7134_xc2028_callback(struct saa7134_dev *dev,
saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00008000);
switch (dev->board) {
case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+ case SAA7134_BOARD_AVERMEDIA_M103:
saa7134_set_gpio(dev, 23, 0);
msleep(10);
saa7134_set_gpio(dev, 23, 1);
@@ -5750,6 +5773,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
msleep(10);
break;
case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+ case SAA7134_BOARD_AVERMEDIA_M103:
saa7134_set_gpio(dev, 23, 0);
msleep(10);
saa7134_set_gpio(dev, 23, 1);
@@ -5877,6 +5901,7 @@ static void saa7134_tuner_setup(struct saa7134_dev *dev)
switch (dev->board) {
case SAA7134_BOARD_AVERMEDIA_A16D:
case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+ case SAA7134_BOARD_AVERMEDIA_M103:
ctl.demod = XC3028_FE_ZARLINK456;
break;
default:
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
index 3cadbad1d..ef8baf5fe 100644
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -1263,6 +1263,7 @@ static int dvb_init(struct saa7134_dev *dev)
&avermedia_xc3028_mt352_dev,
&dev->i2c_adap);
attach_xc3028 = 1;
+ break;
#if 0
/*FIXME: What frontend does Videomate T750 use? */
case SAA7134_BOARD_VIDEOMATE_T750:
@@ -1294,6 +1295,15 @@ static int dvb_init(struct saa7134_dev *dev)
fe->ops.enable_high_lnb_voltage = md8800_set_high_voltage;
}
break;
+ case SAA7134_BOARD_AVERMEDIA_M103:
+ saa7134_set_gpio(dev, 25, 0);
+ msleep(10);
+ saa7134_set_gpio(dev, 25, 1);
+ dev->dvb.frontend = dvb_attach(mt352_attach,
+ &avermedia_xc3028_mt352_dev,
+ &dev->i2c_adap);
+ attach_xc3028 = 1;
+ break;
default:
wprintk("Huh? unknown DVB card?\n");
break;
diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h
index 6afbc0c57..4a9bebb2d 100644
--- a/linux/drivers/media/video/saa7134/saa7134.h
+++ b/linux/drivers/media/video/saa7134/saa7134.h
@@ -267,6 +267,7 @@ struct saa7134_format {
#define SAA7134_BOARD_BEHOLD_H6 142
#define SAA7134_BOARD_BEHOLD_M63 143
#define SAA7134_BOARD_BEHOLD_M6_EXTRA 144
+#define SAA7134_BOARD_AVERMEDIA_M103 145
#define SAA7134_MAXBOARDS 8
#define SAA7134_INPUT_MAX 8
diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c
index 84e2c43b7..53ece95db 100644
--- a/linux/drivers/media/video/tvaudio.c
+++ b/linux/drivers/media/video/tvaudio.c
@@ -72,7 +72,6 @@ typedef struct AUDIOCMD {
/* chip description */
struct CHIPDESC {
char *name; /* chip name */
- int id; /* ID */
int addr_lo, addr_hi; /* i2c address range */
int registers; /* # of registers */
@@ -1264,7 +1263,6 @@ module_param(ta8874z, int, 0444);
static struct CHIPDESC chiplist[] = {
{
.name = "tda9840",
- .id = I2C_DRIVERID_TDA9840,
.insmodopt = &tda9840,
.addr_lo = I2C_ADDR_TDA9840 >> 1,
.addr_hi = I2C_ADDR_TDA9840 >> 1,
@@ -1280,7 +1278,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tda9873h",
- .id = I2C_DRIVERID_TDA9873,
.checkit = tda9873_checkit,
.insmodopt = &tda9873,
.addr_lo = I2C_ADDR_TDA985x_L >> 1,
@@ -1301,7 +1298,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tda9874h/a",
- .id = I2C_DRIVERID_TDA9874,
.checkit = tda9874a_checkit,
.initialize = tda9874a_initialize,
.insmodopt = &tda9874a,
@@ -1314,7 +1310,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tda9850",
- .id = I2C_DRIVERID_TDA9850,
.insmodopt = &tda9850,
.addr_lo = I2C_ADDR_TDA985x_L >> 1,
.addr_hi = I2C_ADDR_TDA985x_H >> 1,
@@ -1327,7 +1322,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tda9855",
- .id = I2C_DRIVERID_TDA9855,
.insmodopt = &tda9855,
.addr_lo = I2C_ADDR_TDA985x_L >> 1,
.addr_hi = I2C_ADDR_TDA985x_H >> 1,
@@ -1352,7 +1346,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tea6300",
- .id = I2C_DRIVERID_TEA6300,
.insmodopt = &tea6300,
.addr_lo = I2C_ADDR_TEA6300 >> 1,
.addr_hi = I2C_ADDR_TEA6300 >> 1,
@@ -1373,7 +1366,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tea6320",
- .id = I2C_DRIVERID_TEA6300,
.initialize = tea6320_initialize,
.insmodopt = &tea6320,
.addr_lo = I2C_ADDR_TEA6300 >> 1,
@@ -1395,7 +1387,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tea6420",
- .id = I2C_DRIVERID_TEA6420,
.insmodopt = &tea6420,
.addr_lo = I2C_ADDR_TEA6420 >> 1,
.addr_hi = I2C_ADDR_TEA6420 >> 1,
@@ -1408,7 +1399,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "tda8425",
- .id = I2C_DRIVERID_TDA8425,
.insmodopt = &tda8425,
.addr_lo = I2C_ADDR_TDA8425 >> 1,
.addr_hi = I2C_ADDR_TDA8425 >> 1,
@@ -1432,7 +1422,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "pic16c54 (PV951)",
- .id = I2C_DRIVERID_PIC16C54_PV9,
.insmodopt = &pic16c54,
.addr_lo = I2C_ADDR_PIC16C54 >> 1,
.addr_hi = I2C_ADDR_PIC16C54>> 1,
@@ -1448,8 +1437,6 @@ static struct CHIPDESC chiplist[] = {
},
{
.name = "ta8874z",
- .id = -1,
- /*.id = I2C_DRIVERID_TA8874Z, */
.checkit = ta8874z_checkit,
.insmodopt = &ta8874z,
.addr_lo = I2C_ADDR_TDA9840 >> 1,
diff --git a/linux/drivers/media/video/uvc/uvc_driver.c b/linux/drivers/media/video/uvc/uvc_driver.c
index 2c0b16960..f2b2983fe 100644
--- a/linux/drivers/media/video/uvc/uvc_driver.c
+++ b/linux/drivers/media/video/uvc/uvc_driver.c
@@ -1633,13 +1633,16 @@ static void uvc_disconnect(struct usb_interface *intf)
* reference to the uvc_device instance after uvc_v4l2_open() received
* the pointer to the device (video_devdata) but before it got the
* chance to increase the reference count (kref_get).
+ *
+ * Note that the reference can't be released with the lock held,
+ * otherwise a AB-BA deadlock can occur with videodev_lock that
+ * videodev acquires in videodev_open() and video_unregister_device().
*/
mutex_lock(&uvc_driver.open_mutex);
-
dev->state |= UVC_DEV_DISCONNECTED;
- kref_put(&dev->kref, uvc_delete);
-
mutex_unlock(&uvc_driver.open_mutex);
+
+ kref_put(&dev->kref, uvc_delete);
}
static int uvc_suspend(struct usb_interface *intf, pm_message_t message)
@@ -1826,6 +1829,15 @@ static struct usb_device_id uvc_ids[] = {
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
.driver_info = UVC_QUIRK_STREAM_NO_FID },
+ /* Asus F9SG */
+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
+ | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x174f,
+ .idProduct = 0x8a31,
+ .bInterfaceClass = USB_CLASS_VIDEO,
+ .bInterfaceSubClass = 1,
+ .bInterfaceProtocol = 0,
+ .driver_info = UVC_QUIRK_STREAM_NO_FID },
/* Syntek (Asus U3S) */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
diff --git a/linux/drivers/media/video/uvc/uvc_v4l2.c b/linux/drivers/media/video/uvc/uvc_v4l2.c
index 0456bbdcd..b5a11eb8f 100644
--- a/linux/drivers/media/video/uvc/uvc_v4l2.c
+++ b/linux/drivers/media/video/uvc/uvc_v4l2.c
@@ -1032,7 +1032,7 @@ static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
{
struct video_device *vdev = video_devdata(file);
struct uvc_video_device *video = video_get_drvdata(vdev);
- struct uvc_buffer *buffer;
+ struct uvc_buffer *uninitialized_var(buffer);
struct page *page;
unsigned long addr, start, size;
unsigned int i;
diff --git a/linux/drivers/media/video/videobuf-dma-sg.c b/linux/drivers/media/video/videobuf-dma-sg.c
index 39ae44bda..21194d6fe 100644
--- a/linux/drivers/media/video/videobuf-dma-sg.c
+++ b/linux/drivers/media/video/videobuf-dma-sg.c
@@ -81,17 +81,15 @@ struct scatterlist*
videobuf_pages_to_sg(struct page **pages, int nr_pages, int offset)
{
struct scatterlist *sglist;
- int i = 0;
+ int i;
if (NULL == pages[0])
return NULL;
- sglist = kcalloc(nr_pages, sizeof(*sglist), GFP_KERNEL);
+ sglist = kmalloc(nr_pages * sizeof(*sglist), GFP_KERNEL);
if (NULL == sglist)
return NULL;
sg_init_table(sglist, nr_pages);
- if (NULL == pages[0])
- goto nopage;
if (PageHighMem(pages[0]))
/* DMA to highmem pages might not work */
goto highmem;
diff --git a/linux/drivers/media/video/zoran_card.c b/linux/drivers/media/video/zoran_card.c
index 56d8edecc..cc45ae5cd 100644
--- a/linux/drivers/media/video/zoran_card.c
+++ b/linux/drivers/media/video/zoran_card.c
@@ -359,14 +359,6 @@ i2cid_to_modulename (u16 i2c_id)
case I2C_DRIVERID_VPX3220:
name = "vpx3220";
break;
-/* case I2C_DRIVERID_VPX3224:
- name = "vpx3224";
- break;
- case I2C_DRIVERID_MSE3000:
- name = "mse3000";
- break;*/
- default:
- break;
}
return name;
@@ -387,8 +379,6 @@ codecid_to_modulename (u16 codecid)
case CODEC_TYPE_ZR36016:
name = "zr36016";
break;
- default:
- break;
}
return name;
@@ -429,7 +419,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
.type = DC10_old,
.name = "DC10(old)",
.i2c_decoder = I2C_DRIVERID_VPX3220,
- /*.i2c_encoder = I2C_DRIVERID_MSE3000,*/
.video_codec = CODEC_TYPE_ZR36050,
.video_vfe = CODEC_TYPE_ZR36016,