diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-03-29 05:26:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:47 -0400 |
commit | 2983baf8d6c1a564b6bbcc3e142f2e9408d9cbbe (patch) | |
tree | 2106263db61b44b4e278900714aca862730f4913 /drivers/media/video/saa7134/saa7134-video.c | |
parent | ffe84b7a31bb39a26d74ff5a9ee921cd2c23e29c (diff) |
V4L/DVB (11282): saa7134: add RDS support.
The Terratec Cinergy 600 TV MK3 supports the RDS decoder saa6588.
Add support to saa7134 for such devices.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 6a4ae89a81a9..404f70eeb355 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "saa7134-reg.h" | 30 | #include "saa7134-reg.h" |
31 | #include "saa7134.h" | 31 | #include "saa7134.h" |
32 | #include <media/v4l2-common.h> | 32 | #include <media/v4l2-common.h> |
33 | #include <media/rds.h> | ||
33 | 34 | ||
34 | /* ------------------------------------------------------------------ */ | 35 | /* ------------------------------------------------------------------ */ |
35 | 36 | ||
@@ -1462,6 +1463,7 @@ static int video_release(struct file *file) | |||
1462 | { | 1463 | { |
1463 | struct saa7134_fh *fh = file->private_data; | 1464 | struct saa7134_fh *fh = file->private_data; |
1464 | struct saa7134_dev *dev = fh->dev; | 1465 | struct saa7134_dev *dev = fh->dev; |
1466 | struct rds_command cmd; | ||
1465 | unsigned long flags; | 1467 | unsigned long flags; |
1466 | 1468 | ||
1467 | /* turn off overlay */ | 1469 | /* turn off overlay */ |
@@ -1495,6 +1497,8 @@ static int video_release(struct file *file) | |||
1495 | saa_andorb(SAA7134_OFMT_DATA_B, 0x1f, 0); | 1497 | saa_andorb(SAA7134_OFMT_DATA_B, 0x1f, 0); |
1496 | 1498 | ||
1497 | saa_call_all(dev, core, s_standby, 0); | 1499 | saa_call_all(dev, core, s_standby, 0); |
1500 | if (fh->radio) | ||
1501 | saa_call_all(dev, core, ioctl, RDS_CMD_CLOSE, &cmd); | ||
1498 | 1502 | ||
1499 | /* free stuff */ | 1503 | /* free stuff */ |
1500 | videobuf_mmap_free(&fh->cap); | 1504 | videobuf_mmap_free(&fh->cap); |
@@ -1515,6 +1519,37 @@ static int video_mmap(struct file *file, struct vm_area_struct * vma) | |||
1515 | return videobuf_mmap_mapper(saa7134_queue(fh), vma); | 1519 | return videobuf_mmap_mapper(saa7134_queue(fh), vma); |
1516 | } | 1520 | } |
1517 | 1521 | ||
1522 | static ssize_t radio_read(struct file *file, char __user *data, | ||
1523 | size_t count, loff_t *ppos) | ||
1524 | { | ||
1525 | struct saa7134_fh *fh = file->private_data; | ||
1526 | struct saa7134_dev *dev = fh->dev; | ||
1527 | struct rds_command cmd; | ||
1528 | |||
1529 | cmd.block_count = count/3; | ||
1530 | cmd.buffer = data; | ||
1531 | cmd.instance = file; | ||
1532 | cmd.result = -ENODEV; | ||
1533 | |||
1534 | saa_call_all(dev, core, ioctl, RDS_CMD_READ, &cmd); | ||
1535 | |||
1536 | return cmd.result; | ||
1537 | } | ||
1538 | |||
1539 | static unsigned int radio_poll(struct file *file, poll_table *wait) | ||
1540 | { | ||
1541 | struct saa7134_fh *fh = file->private_data; | ||
1542 | struct saa7134_dev *dev = fh->dev; | ||
1543 | struct rds_command cmd; | ||
1544 | |||
1545 | cmd.instance = file; | ||
1546 | cmd.event_list = wait; | ||
1547 | cmd.result = -ENODEV; | ||
1548 | saa_call_all(dev, core, ioctl, RDS_CMD_POLL, &cmd); | ||
1549 | |||
1550 | return cmd.result; | ||
1551 | } | ||
1552 | |||
1518 | /* ------------------------------------------------------------------ */ | 1553 | /* ------------------------------------------------------------------ */ |
1519 | 1554 | ||
1520 | static int saa7134_try_get_set_fmt_vbi_cap(struct file *file, void *priv, | 1555 | static int saa7134_try_get_set_fmt_vbi_cap(struct file *file, void *priv, |
@@ -2439,8 +2474,10 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { | |||
2439 | static const struct v4l2_file_operations radio_fops = { | 2474 | static const struct v4l2_file_operations radio_fops = { |
2440 | .owner = THIS_MODULE, | 2475 | .owner = THIS_MODULE, |
2441 | .open = video_open, | 2476 | .open = video_open, |
2477 | .read = radio_read, | ||
2442 | .release = video_release, | 2478 | .release = video_release, |
2443 | .ioctl = video_ioctl2, | 2479 | .ioctl = video_ioctl2, |
2480 | .poll = radio_poll, | ||
2444 | }; | 2481 | }; |
2445 | 2482 | ||
2446 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { | 2483 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { |