aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index bfe25841dbf4..b02944d38932 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -1198,21 +1198,16 @@ static int vidioc_enum_input(struct file *file, void *priv,
1198 struct cx23885_fh *fh = file->private_data; 1198 struct cx23885_fh *fh = file->private_data;
1199 struct cx23885_dev *dev = fh->dev; 1199 struct cx23885_dev *dev = fh->dev;
1200 struct cx23885_input *input; 1200 struct cx23885_input *input;
1201 unsigned int n; 1201 int n;
1202 1202
1203 n = i->index; 1203 if (i->index >= 4)
1204
1205 if (n >= 4)
1206 return -EINVAL; 1204 return -EINVAL;
1207 1205
1208 input = &cx23885_boards[dev->board].input[n]; 1206 input = &cx23885_boards[dev->board].input[i->index];
1209 1207
1210 if (input->type == 0) 1208 if (input->type == 0)
1211 return -EINVAL; 1209 return -EINVAL;
1212 1210
1213 memset(i, 0, sizeof(*i));
1214 i->index = n;
1215
1216 /* FIXME 1211 /* FIXME
1217 * strcpy(i->name, input->name); */ 1212 * strcpy(i->name, input->name); */
1218 strcpy(i->name, "unset"); 1213 strcpy(i->name, "unset");
@@ -1255,7 +1250,6 @@ static int vidioc_g_tuner(struct file *file, void *priv,
1255 return -EINVAL; 1250 return -EINVAL;
1256 if (0 != t->index) 1251 if (0 != t->index)
1257 return -EINVAL; 1252 return -EINVAL;
1258 memset(t, 0, sizeof(*t));
1259 strcpy(t->name, "Television"); 1253 strcpy(t->name, "Television");
1260 cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_G_TUNER, t); 1254 cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_G_TUNER, t);
1261 cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_G_TUNER, t); 1255 cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_G_TUNER, t);
@@ -1286,7 +1280,6 @@ static int vidioc_g_frequency(struct file *file, void *priv,
1286 struct cx23885_fh *fh = file->private_data; 1280 struct cx23885_fh *fh = file->private_data;
1287 struct cx23885_dev *dev = fh->dev; 1281 struct cx23885_dev *dev = fh->dev;
1288 1282
1289 memset(f, 0, sizeof(*f));
1290 if (UNSET == dev->tuner_type) 1283 if (UNSET == dev->tuner_type)
1291 return -EINVAL; 1284 return -EINVAL;
1292 f->type = V4L2_TUNER_ANALOG_TV; 1285 f->type = V4L2_TUNER_ANALOG_TV;
@@ -1346,7 +1339,6 @@ static int vidioc_querycap(struct file *file, void *priv,
1346 struct cx23885_dev *dev = fh->dev; 1339 struct cx23885_dev *dev = fh->dev;
1347 struct cx23885_tsport *tsport = &dev->ts1; 1340 struct cx23885_tsport *tsport = &dev->ts1;
1348 1341
1349 memset(cap, 0, sizeof(*cap));
1350 strcpy(cap->driver, dev->name); 1342 strcpy(cap->driver, dev->name);
1351 strlcpy(cap->card, cx23885_boards[tsport->dev->board].name, 1343 strlcpy(cap->card, cx23885_boards[tsport->dev->board].name,
1352 sizeof(cap->card)); 1344 sizeof(cap->card));
@@ -1366,16 +1358,10 @@ static int vidioc_querycap(struct file *file, void *priv,
1366static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, 1358static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
1367 struct v4l2_fmtdesc *f) 1359 struct v4l2_fmtdesc *f)
1368{ 1360{
1369 int index; 1361 if (f->index != 0)
1370
1371 index = f->index;
1372 if (index != 0)
1373 return -EINVAL; 1362 return -EINVAL;
1374 1363
1375 memset(f, 0, sizeof(*f));
1376 f->index = index;
1377 strlcpy(f->description, "MPEG", sizeof(f->description)); 1364 strlcpy(f->description, "MPEG", sizeof(f->description));
1378 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1379 f->pixelformat = V4L2_PIX_FMT_MPEG; 1365 f->pixelformat = V4L2_PIX_FMT_MPEG;
1380 1366
1381 return 0; 1367 return 0;
@@ -1387,8 +1373,6 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
1387 struct cx23885_fh *fh = file->private_data; 1373 struct cx23885_fh *fh = file->private_data;
1388 struct cx23885_dev *dev = fh->dev; 1374 struct cx23885_dev *dev = fh->dev;
1389 1375
1390 memset(f, 0, sizeof(*f));
1391 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1392 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; 1376 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
1393 f->fmt.pix.bytesperline = 0; 1377 f->fmt.pix.bytesperline = 0;
1394 f->fmt.pix.sizeimage = 1378 f->fmt.pix.sizeimage =
@@ -1408,12 +1392,10 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
1408 struct cx23885_fh *fh = file->private_data; 1392 struct cx23885_fh *fh = file->private_data;
1409 struct cx23885_dev *dev = fh->dev; 1393 struct cx23885_dev *dev = fh->dev;
1410 1394
1411 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1412 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; 1395 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
1413 f->fmt.pix.bytesperline = 0; 1396 f->fmt.pix.bytesperline = 0;
1414 f->fmt.pix.sizeimage = 1397 f->fmt.pix.sizeimage =
1415 dev->ts1.ts_packet_size * dev->ts1.ts_packet_count; 1398 dev->ts1.ts_packet_size * dev->ts1.ts_packet_count;
1416 f->fmt.pix.sizeimage =
1417 f->fmt.pix.colorspace = 0; 1399 f->fmt.pix.colorspace = 0;
1418 dprintk(1, "VIDIOC_TRY_FMT: w: %d, h: %d, f: %d\n", 1400 dprintk(1, "VIDIOC_TRY_FMT: w: %d, h: %d, f: %d\n",
1419 dev->ts1.width, dev->ts1.height, fh->mpegq.field); 1401 dev->ts1.width, dev->ts1.height, fh->mpegq.field);
@@ -1426,7 +1408,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
1426 struct cx23885_fh *fh = file->private_data; 1408 struct cx23885_fh *fh = file->private_data;
1427 struct cx23885_dev *dev = fh->dev; 1409 struct cx23885_dev *dev = fh->dev;
1428 1410
1429 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1430 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; 1411 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
1431 f->fmt.pix.bytesperline = 0; 1412 f->fmt.pix.bytesperline = 0;
1432 f->fmt.pix.sizeimage = 1413 f->fmt.pix.sizeimage =