diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-01-10 09:43:18 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:04:51 -0500 |
commit | a19602f26a24c32e491108b49790b106a6351f24 (patch) | |
tree | dda8858ed20c14173fa15ba912c3c7a1a9eca19f /drivers/media | |
parent | 21a78091921915cd1afd0edb2940dd726edefe9b (diff) |
V4L/DVB (7011): cx23885: Cleanup of compiler defines and warnings
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 128 |
1 files changed, 13 insertions, 115 deletions
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 40d5e778aa25..44c809474ba1 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -270,11 +270,13 @@ void cx23885_video_wakeup(struct cx23885_dev *dev, | |||
270 | break; | 270 | break; |
271 | buf = list_entry(q->active.next, | 271 | buf = list_entry(q->active.next, |
272 | struct cx23885_buffer, vb.queue); | 272 | struct cx23885_buffer, vb.queue); |
273 | |||
273 | /* count comes from the hw and is is 16bit wide -- | 274 | /* count comes from the hw and is is 16bit wide -- |
274 | * this trick handles wrap-arounds correctly for | 275 | * this trick handles wrap-arounds correctly for |
275 | * up to 32767 buffers in flight... */ | 276 | * up to 32767 buffers in flight... */ |
276 | if ((s16) (count - buf->count) < 0) | 277 | if ((s16) (count - buf->count) < 0) |
277 | break; | 278 | break; |
279 | |||
278 | do_gettimeofday(&buf->vb.ts); | 280 | do_gettimeofday(&buf->vb.ts); |
279 | dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i, | 281 | dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i, |
280 | count, buf->count); | 282 | count, buf->count); |
@@ -301,7 +303,6 @@ int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm) | |||
301 | 303 | ||
302 | dev->tvnorm = norm; | 304 | dev->tvnorm = norm; |
303 | 305 | ||
304 | |||
305 | /* Tell the analog tuner/demods */ | 306 | /* Tell the analog tuner/demods */ |
306 | cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_S_STD, &norm); | 307 | cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_S_STD, &norm); |
307 | 308 | ||
@@ -455,20 +456,6 @@ static int cx23885_start_video_dma(struct cx23885_dev *dev, | |||
455 | return 0; | 456 | return 0; |
456 | } | 457 | } |
457 | 458 | ||
458 | #ifdef CONFIG_PM | ||
459 | static int cx23885_stop_video_dma(struct cx23885_dev *dev) | ||
460 | { | ||
461 | dprintk(1, "%s()\n", __FUNCTION__); | ||
462 | /* stop dma */ | ||
463 | cx_clear(VID_A_DMA_CTL, 0x11); | ||
464 | |||
465 | /* disable irqs */ | ||
466 | cx_clear(PCI_INT_MSK, 0x000001); | ||
467 | cx_clear(VID_A_INT_MSK, 0x000011); | ||
468 | |||
469 | return 0; | ||
470 | } | ||
471 | #endif | ||
472 | 459 | ||
473 | static int cx23885_restart_video_queue(struct cx23885_dev *dev, | 460 | static int cx23885_restart_video_queue(struct cx23885_dev *dev, |
474 | struct cx23885_dmaqueue *q) | 461 | struct cx23885_dmaqueue *q) |
@@ -877,6 +864,10 @@ static int video_release(struct inode *inode, struct file *file) | |||
877 | file->private_data = NULL; | 864 | file->private_data = NULL; |
878 | kfree(fh); | 865 | kfree(fh); |
879 | 866 | ||
867 | /* We are not putting the tuner to sleep here on exit, because | ||
868 | * we want to use the mpeg encoder in another session to capture | ||
869 | * tuner video. Closing this will result in no video to the encoder. | ||
870 | */ | ||
880 | 871 | ||
881 | return 0; | 872 | return 0; |
882 | } | 873 | } |
@@ -1337,6 +1328,9 @@ static int vidioc_g_register(struct file *file, void *fh, | |||
1337 | { | 1328 | { |
1338 | struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; | 1329 | struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; |
1339 | 1330 | ||
1331 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) | ||
1332 | return -EINVAL; | ||
1333 | |||
1340 | cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_G_REGISTER, reg); | 1334 | cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_G_REGISTER, reg); |
1341 | 1335 | ||
1342 | return 0; | 1336 | return 0; |
@@ -1347,108 +1341,14 @@ static int vidioc_s_register(struct file *file, void *fh, | |||
1347 | { | 1341 | { |
1348 | struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; | 1342 | struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; |
1349 | 1343 | ||
1350 | cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_S_REGISTER, reg); | 1344 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
1351 | return 0; | ||
1352 | } | ||
1353 | #endif | ||
1354 | |||
1355 | /* ----------------------------------------------------------- */ | ||
1356 | /* RADIO ESPECIFIC IOCTLS */ | ||
1357 | /* ----------------------------------------------------------- */ | ||
1358 | |||
1359 | static int radio_querycap(struct file *file, void *priv, | ||
1360 | struct v4l2_capability *cap) | ||
1361 | { | ||
1362 | struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev; | ||
1363 | |||
1364 | strcpy(cap->driver, "cx23885"); | ||
1365 | strlcpy(cap->card, cx23885_boards[dev->board].name, | ||
1366 | sizeof(cap->card)); | ||
1367 | sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci)); | ||
1368 | cap->version = CX23885_VERSION_CODE; | ||
1369 | cap->capabilities = V4L2_CAP_TUNER; | ||
1370 | return 0; | ||
1371 | } | ||
1372 | |||
1373 | static int radio_g_tuner(struct file *file, void *priv, | ||
1374 | struct v4l2_tuner *t) | ||
1375 | { | ||
1376 | struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev; | ||
1377 | |||
1378 | if (unlikely(t->index > 0)) | ||
1379 | return -EINVAL; | ||
1380 | |||
1381 | strcpy(t->name, "Radio"); | ||
1382 | t->type = V4L2_TUNER_RADIO; | ||
1383 | |||
1384 | cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_G_TUNER, t); | ||
1385 | return 0; | ||
1386 | } | ||
1387 | |||
1388 | static int radio_enum_input(struct file *file, void *priv, | ||
1389 | struct v4l2_input *i) | ||
1390 | { | ||
1391 | if (i->index != 0) | ||
1392 | return -EINVAL; | ||
1393 | strcpy(i->name, "Radio"); | ||
1394 | i->type = V4L2_INPUT_TYPE_TUNER; | ||
1395 | |||
1396 | return 0; | ||
1397 | } | ||
1398 | |||
1399 | static int radio_g_audio(struct file *file, void *priv, struct v4l2_audio *a) | ||
1400 | { | ||
1401 | if (unlikely(a->index)) | ||
1402 | return -EINVAL; | ||
1403 | |||
1404 | memset(a, 0, sizeof(*a)); | ||
1405 | strcpy(a->name, "Radio"); | ||
1406 | return 0; | ||
1407 | } | ||
1408 | |||
1409 | /* FIXME: Should add a standard for radio */ | ||
1410 | |||
1411 | static int radio_s_tuner(struct file *file, void *priv, | ||
1412 | struct v4l2_tuner *t) | ||
1413 | { | ||
1414 | struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev; | ||
1415 | |||
1416 | if (0 != t->index) | ||
1417 | return -EINVAL; | 1345 | return -EINVAL; |
1418 | 1346 | ||
1419 | cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_S_TUNER, t); | 1347 | cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_S_REGISTER, reg); |
1420 | |||
1421 | return 0; | ||
1422 | } | ||
1423 | |||
1424 | static int radio_s_audio(struct file *file, void *fh, | ||
1425 | struct v4l2_audio *a) | ||
1426 | { | ||
1427 | return 0; | ||
1428 | } | ||
1429 | |||
1430 | static int radio_s_input(struct file *file, void *fh, unsigned int i) | ||
1431 | { | ||
1432 | return 0; | ||
1433 | } | ||
1434 | |||
1435 | static int radio_queryctrl(struct file *file, void *priv, | ||
1436 | struct v4l2_queryctrl *c) | ||
1437 | { | ||
1438 | int i; | ||
1439 | 1348 | ||
1440 | if (c->id < V4L2_CID_BASE || | ||
1441 | c->id >= V4L2_CID_LASTP1) | ||
1442 | return -EINVAL; | ||
1443 | if (c->id == V4L2_CID_AUDIO_MUTE) { | ||
1444 | for (i = 0; i < CX23885_CTLS; i++) | ||
1445 | if (cx23885_ctls[i].v.id == c->id) | ||
1446 | break; | ||
1447 | *c = cx23885_ctls[i].v; | ||
1448 | } else | ||
1449 | *c = no_ctl; | ||
1450 | return 0; | 1349 | return 0; |
1451 | } | 1350 | } |
1351 | #endif | ||
1452 | 1352 | ||
1453 | /* ----------------------------------------------------------- */ | 1353 | /* ----------------------------------------------------------- */ |
1454 | 1354 | ||
@@ -1517,7 +1417,6 @@ int cx23885_video_irq(struct cx23885_dev *dev, u32 status) | |||
1517 | return handled; | 1417 | return handled; |
1518 | } | 1418 | } |
1519 | 1419 | ||
1520 | |||
1521 | /* ----------------------------------------------------------- */ | 1420 | /* ----------------------------------------------------------- */ |
1522 | /* exported stuff */ | 1421 | /* exported stuff */ |
1523 | 1422 | ||
@@ -1625,6 +1524,7 @@ int cx23885_video_register(struct cx23885_dev *dev) | |||
1625 | cx23885_risc_stopper(dev->pci, &dev->vidq.stopper, | 1524 | cx23885_risc_stopper(dev->pci, &dev->vidq.stopper, |
1626 | VID_A_DMA_CTL, 0x11, 0x00); | 1525 | VID_A_DMA_CTL, 0x11, 0x00); |
1627 | 1526 | ||
1527 | /* Don't enable VBI yet */ | ||
1628 | cx_set(PCI_INT_MSK, 1); | 1528 | cx_set(PCI_INT_MSK, 1); |
1629 | 1529 | ||
1630 | 1530 | ||
@@ -1647,8 +1547,6 @@ int cx23885_video_register(struct cx23885_dev *dev) | |||
1647 | cx23885_video_mux(dev, 0); | 1547 | cx23885_video_mux(dev, 0); |
1648 | mutex_unlock(&dev->lock); | 1548 | mutex_unlock(&dev->lock); |
1649 | 1549 | ||
1650 | /* FIXME start tvaudio thread */ | ||
1651 | |||
1652 | return 0; | 1550 | return 0; |
1653 | 1551 | ||
1654 | fail_unreg: | 1552 | fail_unreg: |